Skip to content

Vamps023/GantryLabelTool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GantryLabelTool — Unigine 2.18 Editor Plugin

A Qt-based editor plugin for Unigine 2.18 that provides a UI panel for applying labels to gantry structures in the scene. Supports both single numbers and sequence number assignment.

Features

  • Editor Integration: Dockable UI panel in Unigine Editor with dark theme
  • Multi-Gantry Support: Select and apply labels to multiple gantries simultaneously
  • Label Types:
    • Label 1: Same text applied to all selected gantries
    • Label 2: Single number OR sequence number assignment
  • Sequence Number Logic: Per-gantry assignment (each gantry gets one number from sequence)
  • Even/Odd Filtering: Optional filtering for sequence numbers
  • Automatic Detection: Finds gantry nodes with GantryLabel property
  • Real-time Preview: Immediate visual feedback in the editor

Project Structure

GantryLabelTool/
├── CMakeLists.txt           # CMake build configuration
├── README.md
├── source/
│   ├── plugin_editor.cpp    # Qt plugin implementation
│   ├── plugin_editor.h
│   ├── ui_panel_editor.cpp  # Qt UI panel with label controls
│   ├── ui_panel_editor.h
│   ├── label_generator.cpp  # Label creation and scene logic
│   ├── label_generator.h
│   └── GantryLabelTool.json # Plugin metadata
└── build/                   # CMake build output directory

Prerequisites

  • Unigine SDK 2.18 (sim_windows_2.18.0.1_bin or later)
  • Visual Studio 2022 with C++ development tools
  • Qt 5.12.3 (included with Unigine SDK)
  • CMake 3.16 or later
  • Git (for version control)

Build Instructions

Step 1 — Configure CMake

  1. Open Command Prompt in the project root directory
  2. Create build directory and configure:
mkdir build
cd build
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release

Step 2 — Build the Plugin

cmake --build . --config Release

The output DLL will be: GantryLabelTool_editorplugin_double_x64.dll

Step 3 — Deploy to Unigine Project

Copy the following files to your Unigine project:

FROM: build/source/GantryLabelTool_editorplugin_double_x64.dll
TO:   YOUR_PROJECT/bin/plugins/Vamps/GantryLabelTool/

FROM: source/GantryLabelTool.json
TO:   YOUR_PROJECT/bin/plugins/Vamps/GantryLabelTool/

Example paths:

Copy DLL to: C:/Users/YOU/Documents/UNIGINE Projects/your_project/bin/plugins/Vamps/GantryLabelTool/
Copy JSON to: C:/Users/YOU/Documents/UNIGINE Projects/your_project/bin/plugins/Vamps/GantryLabelTool/

Step 4 — Launch Unigine Editor

  1. Open your Unigine project in the editor
  2. The plugin will be automatically detected and loaded
  3. Look for the "Gantry Label Tool" panel in the editor interface

Scene Requirements

The scene must contain gantry nodes with the following structure:

Required Components:

  • Gantry Nodes: Named with gantry_pole_ prefix (e.g., gantry_pole_1)
  • GantryLabel Property: Property assigned to gantry nodes with label_text parameter
  • Dummy Nodes: Inside gantry hierarchy named label and label2

Property Structure:

Property: GantryLabel
├── Parameter: label_text (string)
└── Mesh surfaces: "Label1", "Label2"

Usage

1. Select Gantries

  • Select gantry nodes in the editor outline (multi-select supported)
  • Click "Refresh Selection" to update the selection counter

2. Apply Label 1 (Same to All)

  • Enter text (e.g., "Gantry")
  • Click "Apply Label 1" - same text applied to all selected gantries

3. Apply Label 2 (Single or Sequence)

Single Number Mode:

  • Select "Single Number" radio button
  • Enter number (e.g., "42")
  • Click "Apply Label 2" - same number applied to all selected gantries

Sequence Number Mode:

  • Select "Sequence Number" radio button
  • Set range: From: 1 To: 10
  • Optional: Check "Even numbers only"
  • Click "Apply Label 2" - assigns one number per gantry in alphabetical order

Example: 3 gantries (A, B, C) with sequence 1-5:

  • Gantry A gets "1"
  • Gantry B gets "2"
  • Gantry C gets "3"

4. Apply Both Labels

  • Click "Apply Both Labels to Selected" to apply both labels simultaneously

Plugin Architecture

Components:

  • GantryLabelToolEditorPlugin: Main Qt plugin class
  • UiPanelEditor: Qt UI panel with controls
  • LabelGenerator: Core logic for label creation and scene interaction

Key Features:

  • Qt Integration: Uses Qt5 for UI components
  • Unigine API: Direct integration with Unigine Editor API
  • Automatic Discovery: Plugin automatically detected by editor
  • Metadata: JSON metadata file for plugin identification

Troubleshooting

Issue Solution
Plugin not loading Verify DLL is in bin/plugins/Vamps/GantryLabelTool/ and JSON metadata exists
UI panel not visible Check editor console for initialization messages
Gantries not detected Ensure nodes have GantryLabel property and correct naming
Labels not applying Verify dummy nodes label and label2 exist in gantry hierarchy
Sequence numbers not working Ensure sequence mode is selected and range is valid

Development Notes

Build System:

  • Uses CMake for cross-platform compatibility
  • Follows Unigine 2.18 editor plugin conventions
  • Qt5 MOC automatically generated for Q_OBJECT classes

Code Organization:

  • Header files contain class declarations
  • Implementation files contain logic
  • JSON metadata for plugin identification
  • Clear separation between UI and business logic

Version History

  • v1.0: Initial release with basic labeling functionality
  • v1.1: Added sequence number support and multi-gantry selection
  • v1.2: Converted to editor plugin with Qt UI integration
  • v1.3: Fixed sequence logic and added radio button mode selection

License

Internal tool — not for distribution.

About

A DLL plugin for Unigine 2.18 that dynamically generates text textures and applies them to gantry label meshes in the scene.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors