CesiumGS / cesium-omniverse

Bringing the 3D geospatial ecosystem to Omniverse
https://cesium.com/platform/cesium-for-omniverse/
Apache License 2.0
58 stars 7 forks source link

Hot reloading #2

Closed lilleyse closed 9 months ago

lilleyse commented 2 years ago

Omniverse Code will automatically hot-reload extensions when files that match the fswatcher pattern are changed. This works pretty well for Python code. Hot reloading C++ code is more complicated for several reasons:

One possibility is to handle the hot-reloading completely within the DLL's. On every update CesiumOmniversePythonBindings.cp37-win_amd64.pyd could check if a new variant of CesiumOmniverse[N].dll has been created and dynamically load it.

Also see:

lilleyse commented 2 years ago

Since we don't have hot reloading yet, here are the commands I run whenever I makes C++ changes on Windows:

taskkill //f //im kit.exe
cmake -B build && cmake --build build --config Release
cmake --install build --config Release --component kit
../cesium-kit-exts/app/omni.code.bat --ext-folder exts --enable cesium.omniverse

Or as a one liner in git bash:

taskkill //f //im kit.exe ; cmake -B build && cmake --build build --config Release && cmake --install build --config Release --component kit && ../cesium-kit-exts/app/omni.code.bat --ext-folder exts --enable cesium.omniverse
lilleyse commented 2 years ago

Carbonite plugins might be hot reloadable

const struct carb::PluginImplDesc pluginImplDesc = { "omni.example.cpp.hello_world.plugin",
                                                     "An example C++ extension.", "NVIDIA",
                                                     carb::PluginHotReload::eEnabled, "dev" };

From https://github.com/NVIDIA-Omniverse/kit-extension-template-cpp/blob/main/source/extensions/omni.example.cpp.hello_world/plugins/omni.example.cpp.hello_world/HelloWorldExtension.cpp#L17-L19

lilleyse commented 9 months ago

Unlikely to tackle this any time soon