This page has been translated automatically.
Видеоуроки
Интерфейс
Основы
Продвинутый уровень
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Профессиональный уровень (SIM)
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Браузер SDK 2
Лицензирование и типы лицензий
Дополнения (Add-Ons)
Демонстрационные проекты
API Samples
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Контроль версий
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Освещение
Sandworm
Использование инструментов редактора для конкретных задач
Расширение функционала редактора
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World-ноды
Звуковые объекты
Объекты поиска пути
Player-ноды
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
C#
UnigineScript
Унифицированный язык шейдеров UUSL (Unified UNIGINE Shader Language)
Плагины
Форматы файлов
Материалы и шейдеры
Rebuilding the Engine Tools
Интерфейс пользователя (GUI)
Двойная точность координат
Справочник API
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Визуальный редактор материалов
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Учебные материалы

ImGuiSamples Plugin

General Information#

The ImGUI Plugin Sample demonstrates how to integrate the Dear ImGui library with UnigineEditor, as well as how to use the Editor's API to build advanced custom tools for various development tasks.

This sample is available on the Add-On Store as ImGuiSamplesPlugin and covers multiple basic cases encountered by users when making their own Editor plugins.

The plugin adds a custom window to the UnigineEditor, which contains three separate tabs - each showcasing a different sample:

Spline Editor#

This sample demonstrates:

  • Using the Editor's Undo/Redo system via the API
  • Handling hotkeys
  • Implementing custom visualization - all within the context of spline editing.

When the Edit Mode option is enabled, the spline editor becomes active. The following actions are available (associated with remappable hotkeys via Windows -> Settings -> Hotkeys):

  • LMB - Select a point
  • Shift + LMB - Create a new point at the end of the spline or add/remove a point from the selection
  • Del - Delete point
  • F - Focus camera on the selected point
  • Ctrl + Z - Undo
  • Ctrl + Y - Redo.

Editor (Immediate Mode)#

This sample shows how to use Editor and Engine widgets in immediate mode (in ImGui-like style), using the EditorImmediate class. Programming in this mode is simple, but it has a number of limitations. This mode is recommended for prototyping or simple plugins.

In the sample, four connected points form a polygon at the center of the world. Click Edit Mode to:

  • Display manipulators for each point
  • Move points using the manipulators
  • Use the F key to focus the camera on the polygon.

The current position of each point (X, Y, Z) is updated each frame in the widget at the top-left corner of the viewport.

Components#

This sample illustrates how to work with C++ components directly inside the Editor.

  • Click Initialize the ComponentSystem to register and activate the NodeRotation component (a property written in C++)
  • Once initialized, you can assign the component to any node - it will start rotating immediately, right within the Editor
  • The component provides three sliders to control the rotation speed along the X, Y, Z axes.

How to Run the Sample#

Prerequisites#

  • UNIGINE SDK Browser (latest version)
  • UNIGINE SDK Community or Community PRO edition
  • Visual Studio 2022 (recommended)
  • GitHub access to clone the repository.

Step-by-Step Guide#

Starting the ImGUI Plugin Sample requires you to perform the following steps:

  1. Clone or download the sample from the UNIGINE Git repository
  2. Open SDK Browser and make sure you have the latest version
  3. Add the sample project to SDK Browser:

    • Go to the My Projects tab
    • Click Add Existing then select the *.project file located in the cloned sample folder, and click Import Project

  4. Repair the project

    • After importing, you'll see a Repair warning - this is expected, as only essential files are stored in the Git repository. SDK Browser will restore the rest

    • Click Repair to let SDK Browser restore the required files.
    • When the configuration window opens, click Configure Project without making any changes
      Notice
      This sample is currently released for UNIGINE SDK Community or Community PRO editions only. If you do not have a Community edition of the latest SDK, you should add it via the SDKs tab (this edition is free).
  5. Install Required Dependencies

    • This sample uses the Qt framework. Make sure you have Qt 5.12.3 installed and that the corresponding QT environment variable is correctly set
    • To check or set them click Start, type Environment Variables, and open Edit the system environment variables. In the System Environment Variables dialog, click New (or Edit, if it already exists) and set:

      • Variable name: QTROOT
      • Value: full path to your Qt installation (e.g., C:\Qt\5.12.3\msvc2017_64)

      • Restart your IDE or system to apply the changes
  6. Open the project in your IDE
    • Launch the recommended Visual Studio 2022 (other C++ IDE with CMake support can be used as well)
    • Load your project: source/plugins/Unigine/ImGuiSamples - the root folder of CMakeLists.txt. If everything is set up correctly, the CMakeLists.txt file will be highlighted in bold in the Solution Explorer window, indicating that the project is ready to build
  7. Build and Open the project - start the Editor from SDK Browser.

If you're still having trouble running the application, revisit the steps above to ensure nothing was skipped. If you encounter CMake issues in Visual Studio, try rebuilding the project by right-clicking on it in the Visual Studio 2022, selecting Delete Cache and Reconfigure and then Build again.

The information on this page is valid for UNIGINE 2.20 SDK.

Last update: 20.06.2025
Build: ()