### Build and Start Docker Container Source: https://github.com/mrnerf/lichtfeld-studio/wiki/Build-instructions-‐-Docker Builds the Docker image and starts the container with a specified version. Use this for initial setup or when updating the version. ```bash # Build and start the container ./docker/run_docker.sh -bu 12.8.0 ``` -------------------------------- ### Install License Files Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/external/nvImageCodec/src/CMakeLists.txt Installs the LICENSE.txt and Acknowledgements.txt files into a share/nvImageCodec directory under the installation prefix, marked as optional. ```cmake set(NVIMGCODEC_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/..") if(EXISTS "${NVIMGCODEC_ROOT}/LICENSE.txt") install( FILES "${NVIMGCODEC_ROOT}/LICENSE.txt" "${NVIMGCODEC_ROOT}/Acknowledgements.txt" DESTINATION "share/nvImageCodec" COMPONENT lib OPTIONAL ) endif() ``` -------------------------------- ### Install Plugin from GitHub Repository Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/docs/plugins/getting-started.md Install a plugin directly from a GitHub repository using its owner and repository name or a full URL. LichtFeld handles the cloning and setup process. ```python import lichtfeld as lf lf.plugins.install("owner/repo") lf.plugins.install("https://github.com/owner/repo") ``` -------------------------------- ### Configure Example Benchmark Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/external/nvImageCodec/external/NVTX/tools/benchmarks/CMakeLists.txt Uses the 'ConfigureBench' function to build the example benchmark executable. ```cmake ConfigureBench(EXAMPLE_BENCH "${EXAMPLE_BENCH_SRC}") ``` -------------------------------- ### Install License File Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/CMakeLists.txt Installs the project's LICENSE file to the root of the installation directory. ```cmake install(FILES "${CMAKE_SOURCE_DIR}/LICENSE" DESTINATION ".") ``` -------------------------------- ### Install Dependencies Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/docs/README.md Installs all project dependencies using pnpm. Run this command from the `docs` directory. ```bash pnpm install ``` -------------------------------- ### Start Local Development Server Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/docs/README.md Starts a local development server for the documentation. Changes are reflected live. Run this command from the `docs` directory. ```bash pnpm start ``` -------------------------------- ### Set Example Benchmark Source Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/external/nvImageCodec/external/NVTX/tools/benchmarks/CMakeLists.txt Defines the source file for the example benchmark. ```cmake set(EXAMPLE_BENCH_SRC "${CMAKE_CURRENT_SOURCE_DIR}/example/example_benchmark.cpp") ``` -------------------------------- ### Install Pre-commit Hook Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/CONTRIBUTING.md Installs the pre-commit hook for the project. This should be done after cloning the repository. ```bash cp tools/pre-commit .git/hooks/ ``` -------------------------------- ### Install OpenMeshTools Target Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/external/OpenMesh/src/OpenMesh/Tools/CMakeLists.txt Installs the OpenMeshTools target, including its archive, library, and runtime components, to the specified directories within the project's installation structure. ```cmake install(TARGETS OpenMeshTools EXPORT OpenMeshConfig ARCHIVE DESTINATION ${VCI_PROJECT_LIBDIR} LIBRARY DESTINATION ${VCI_PROJECT_LIBDIR} RUNTIME DESTINATION ${VCI_PROJECT_BINDIR}) ``` -------------------------------- ### Enable Debugpy in Plugin Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/docs/plugins/getting-started.md Add this code to your plugin's `on_load()` function to start the debugpy listener. Ensure it's wrapped in a try-except block to handle cases where debugpy might not be installed. ```python def on_load(): try: import debugpy debugpy.listen(5678) lf.log.info("debugpy listening on port 5678") except ImportError: pass ``` -------------------------------- ### Install Project Targets Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/CMakeLists.txt Installs various project targets, including the main executable, core libraries, and auxiliary components like diagnostics, logger, event bridge, visualizer, and MCP. These are placed in standard installation directories. ```cmake install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) install(TARGETS lfs_core LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) install(TARGETS lfs_diagnostics LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) install(TARGETS lfs_logger LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) install(TARGETS lfs_event_bridge LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) install(TARGETS lfs_visualizer LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) install(TARGETS lfs_mcp LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) ``` -------------------------------- ### Install Package Configuration Files Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/external/nvImageCodec/src/CMakeLists.txt Installs the generated Config.cmake and ConfigVersion.cmake files into the cmake/nvimgcodec directory. ```cmake install( FILES "${project_config}" "${version_config}" DESTINATION "cmake/nvimgcodec" COMPONENT lib ) ``` -------------------------------- ### Start Training Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/docs/docs/development/mcp/recipes/load-dataset-and-train.md Initiate the training process using the `training.start` tool. This tool takes no arguments. ```json { "tool": "training.start", "arguments": {} } ``` -------------------------------- ### Install Shader Resources Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/CMakeLists.txt Installs Vulkan shader SPIR-V files to a specific subdirectory within the installation's data directory if the source directory is defined. ```cmake set(INSTALL_RESOURCE_DIR "${CMAKE_INSTALL_DATADIR}/LichtFeld-Studio") if(_LFS_VULKAN_RASTERIZER_SPV_DIR) install(DIRECTORY "${_LFS_VULKAN_RASTERIZER_SPV_DIR}/" DESTINATION "${INSTALL_RESOURCE_DIR}/shaders/vulkan_rasterizer" FILES_MATCHING PATTERN "*.spv") endif() ``` -------------------------------- ### Install Extensions and Vcpkg DLLs on Windows Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/CMakeLists.txt On Windows, this snippet installs DLLs from the build's extensions directory and any Vcpkg-installed DLLs into the installation's bin directory. It handles different build configurations (Release, Debug, etc.). ```cmake install(CODE " # Copy extensions/ from build to dist/extensions/ # Handle both single-config (Ninja) and multi-config (VS) generators foreach(_cfg IN ITEMS \"\" \"Release\" \"Debug\" \"RelWithDebInfo\" \"MinSizeRel\") if(_cfg) set(_ext_dir \"${CMAKE_BINARY_DIR}/${\_cfg}/extensions\") else() set(_ext_dir \"${CMAKE_BINARY_DIR}/extensions\") endif() if(EXISTS \"${_ext_dir}\") # Install only DLLs from the build extensions directory to avoid non-binary files file(GLOB _ext_dlls \"${_ext_dir}/*.dll\") if(_ext_dlls) foreach(_e IN LISTS _ext_dlls) file(INSTALL \"${_e}\" DESTINATION \"${CMAKE_INSTALL_PREFIX}/extensions\") endforeach() endif() break() endif() endforeach() # Copy vcpkg DLLs if(EXISTS \"${CMAKE_BINARY_DIR}/vcpkg_installed/${VCPKG_TARGET_TRIPLET}/bin\") file(GLOB _vcpkg \"${CMAKE_BINARY_DIR}/vcpkg_installed/${VCPKG_TARGET_TRIPLET}/bin/*.dll\") foreach(_v IN LISTS _vcpkg) file(INSTALL \"${_v}\" DESTINATION \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}\") endforeach() endif() " COMPONENT runtime) ``` -------------------------------- ### Install Libraries and DLLs on Windows Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/external/OpenMesh/src/OpenMesh/Core/CMakeLists.txt Installs .lib and .dll files to the 'lib' and root directories respectively when building in debug and release modes on Windows. ```cmake if ( ${CMAKE_PROJECT_NAME} MATCHES "OpenMesh") if ( WIN32 ) FILE(GLOB files_install_libs "${CMAKE_BINARY_DIR}/Build/lib/*.lib" ) FILE(GLOB files_install_dlls "${CMAKE_BINARY_DIR}/Build/*.dll" ) INSTALL(FILES ${files_install_libs} DESTINATION lib ) INSTALL(FILES ${files_install_dlls} DESTINATION . ) endif() endif() ``` -------------------------------- ### Install Linux Prerequisites Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/docs/building_and_distribution.md Installs necessary development tools and libraries on Debian/Ubuntu systems for building LichtFeld Studio. Ensure you have at least one windowing backend (x11 or wayland) for SDL3. ```bash sudo apt install \ git curl unzip cmake gcc-14 g++-14 ccache ninja-build zip tar pkg-config python3 python3-dev \ libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev \ libwayland-dev libxkbcommon-dev libegl-dev libdecor-0-dev libibus-1.0-dev libdbus-1-dev \ libsystemd-dev nasm autoconf autoconf-archive automake libtool ``` -------------------------------- ### Install Plugin Documentation Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/CMakeLists.txt Installs Markdown documentation files for plugins to a specified directory within the application's data path. Use this to ensure plugin-related documentation is available to users. ```cmake set(DOC_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/doc/LichtFeld-Studio") install( FILES "${CMAKE_SOURCE_DIR}/docs/PYTHON_API.md" "${CMAKE_SOURCE_DIR}/docs/plugin-system.md" "${CMAKE_SOURCE_DIR}/docs/plugin-use-cases.md" "${CMAKE_SOURCE_DIR}/docs/plugin-dev-workflow.md" DESTINATION "${DOC_INSTALL_DIR}" OPTIONAL ) ``` -------------------------------- ### Search and Install Plugins from Registry Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/docs/plugins/getting-started.md Interact with the LichtFeld plugin registry to search for plugins, install them by ID, check for updates, and update existing plugins. ```python import lichtfeld as lf results = lf.plugins.search("neural rendering") lf.plugins.install_from_registry("plugin_id") lf.plugins.check_updates() lf.plugins.update("my_plugin") ``` -------------------------------- ### Start Training Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/docs/plugins/api-reference.md Initiates the training process. Use this function to begin model training. ```python lf.start_training() ``` -------------------------------- ### Set Default Install Directories Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/external/nvImageCodec/CMakeLists.txt Sets default installation directories for libraries, binaries, and include files based on the operating system. Uses 'lib64' on UNIX systems for libraries. ```cmake if(NOT DEFINED CMAKE_INSTALL_LIBDIR) if(UNIX) set(CMAKE_INSTALL_LIBDIR "lib64") # use lib64 instead of lib else() set(CMAKE_INSTALL_LIBDIR "lib") endif() endif() ``` -------------------------------- ### Install GUI and Asset Resources Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/CMakeLists.txt Installs various graphical assets, including icons, fonts, themes, environments, and RLMUI resources, into the designated asset directory. ```cmake install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/visualizer/gui/assets/icon" DESTINATION "${INSTALL_RESOURCE_DIR}/assets") install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/visualizer/gui/assets/fonts" DESTINATION "${INSTALL_RESOURCE_DIR}/assets") install(FILES "${CMAKE_SOURCE_DIR}/src/rendering/resources/assets/JetBrainsMono-Regular.ttf" DESTINATION "${INSTALL_RESOURCE_DIR}/assets/fonts") install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/visualizer/gui/assets/themes" DESTINATION "${INSTALL_RESOURCE_DIR}/assets") install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/visualizer/gui/assets/environments" DESTINATION "${INSTALL_RESOURCE_DIR}/assets") install(FILES "${CMAKE_SOURCE_DIR}/src/visualizer/gui/assets/lichtfeld-icon.png" DESTINATION "${INSTALL_RESOURCE_DIR}/assets") install(FILES "${CMAKE_SOURCE_DIR}/src/visualizer/gui/assets/lichtfeld-splash-logo.png" DESTINATION "${INSTALL_RESOURCE_DIR}/assets") install(FILES "${CMAKE_SOURCE_DIR}/src/visualizer/gui/assets/lichtfeld-splash-logo-dark.png" DESTINATION "${INSTALL_RESOURCE_DIR}/assets") install(FILES "${CMAKE_SOURCE_DIR}/src/visualizer/gui/assets/lichtfeld-splash-loading.png" DESTINATION "${INSTALL_RESOURCE_DIR}/assets") install(FILES "${CMAKE_SOURCE_DIR}/src/visualizer/gui/assets/lichtfeld-splash-loading-dark.png" DESTINATION "${INSTALL_RESOURCE_DIR}/assets") install(FILES "${CMAKE_SOURCE_DIR}/src/visualizer/gui/assets/core11-logo.png" DESTINATION "${INSTALL_RESOURCE_DIR}/assets") install(FILES "${CMAKE_SOURCE_DIR}/src/visualizer/gui/assets/core11-logo-dark.png" DESTINATION "${INSTALL_RESOURCE_DIR}/assets") install(FILES "${CMAKE_SOURCE_DIR}/src/visualizer/gui/assets/volinga-logo.png" DESTINATION "${INSTALL_RESOURCE_DIR}/assets") install(FILES "${CMAKE_SOURCE_DIR}/src/visualizer/gui/assets/volinga-logo-dark.png" DESTINATION "${INSTALL_RESOURCE_DIR}/assets") install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/visualizer/gui/rmlui/resources/" DESTINATION "${INSTALL_RESOURCE_DIR}/assets/rmlui") install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/visualizer/gui/resources/locales" DESTINATION "${INSTALL_RESOURCE_DIR}") ``` -------------------------------- ### Training Start Hook Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/docs/plugins/api-reference.md Decorator to register a callback function that is executed when training starts. ```python @lf.on_training_start ``` -------------------------------- ### Install Visualizer Resources Directory Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/src/visualizer/CMakeLists.txt Installs all TTF files from the visualizer resources directory to the share directory. This ensures all necessary font assets are included. ```cmake install(DIRECTORY ${VISUALIZER_SOURCE_RESOURCE_DIR}/ DESTINATION share/LichtFeld-Studio/visualizer/resources FILES_MATCHING PATTERN "*.ttf") ``` -------------------------------- ### Install OpenMeshCore Target Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/external/OpenMesh/src/OpenMesh/Core/CMakeLists.txt Installs the 'OpenMeshCore' target, including its archive, library, and runtime components, to specified directories based on project variables. ```cmake install(TARGETS OpenMeshCore EXPORT OpenMeshConfig ARCHIVE DESTINATION ${VCI_PROJECT_LIBDIR} LIBRARY DESTINATION ${VCI_PROJECT_LIBDIR} RUNTIME DESTINATION ${VCI_PROJECT_BINDIR}) ``` -------------------------------- ### Install Python Executable Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/src/python/CMakeLists.txt Installs the Python executable to the specified binary directory and renames it to 'python3'. This is part of the runtime component. ```cmake install( PROGRAMS ${Python_EXECUTABLE} DESTINATION "${CMAKE_INSTALL_BINDIR}" RENAME "python3" COMPONENT runtime ) ``` -------------------------------- ### Scrub Field Controller Setup Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/docs/plugins/api-reference.md Define scrub field specifications and initialize the ScrubFieldController for a panel. This setup allows for interactive scrubbing of values. ```python from lfs_plugins import ScrubFieldController, ScrubFieldSpec SCRUB_FIELD_SPECS = { "quality": ScrubFieldSpec(min_value=0.0, max_value=1.0, step=0.01, fmt="%.2f"), } class MyPanel(lf.ui.Panel): # ... def on_bind_model(self, ctx): model = ctx.create_data_model("my_panel") if model is None: return model.bind("quality", lambda: f"{self._quality:.2f}", self._set_quality) def __init__(self): self._scrub_fields = ScrubFieldController( SCRUB_FIELD_SPECS, self._get_scrub_value, self._set_scrub_value, ) def on_mount(self, doc): self._scrub_fields.mount(doc) def on_unmount(self, doc): self._scrub_fields.unmount() def on_update(self, doc): return self._scrub_fields.sync_all() ``` -------------------------------- ### Install Locale Files Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/src/visualizer/CMakeLists.txt Installs all JSON locale files from the GUI resources directory to the share directory. This makes localization files available for the application. ```cmake install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/gui/resources/locales/ DESTINATION share/LichtFeld-Studio/locales FILES_MATCHING PATTERN "*.json") ``` -------------------------------- ### Install OpenUSD Plugin Resources Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/CMakeLists.txt Installs OpenUSD plugin resources, including schema definitions and plugInfo.json files. The installation destination varies based on the operating system to ensure compatibility with USD's plugin discovery mechanism. ```cmake if(WIN32) set(_USD_INSTALL_DEST "${CMAKE_INSTALL_BINDIR}/usd") else() set(_USD_INSTALL_DEST "${CMAKE_INSTALL_LIBDIR}/usd") endif() if(EXISTS "${_USD_PLUGIN_SOURCE_DIR}") install(DIRECTORY "${_USD_PLUGIN_SOURCE_DIR}/" DESTINATION "${_USD_INSTALL_DEST}" PATTERN "__pycache__" EXCLUDE PATTERN "*.pyc" EXCLUDE) endif() if(EXISTS "${_USD_ROOT_INDEX}") install(FILES "${_USD_ROOT_INDEX}" DESTINATION "${_USD_INSTALL_DEST}") endif() ``` -------------------------------- ### Install Library Targets and Headers Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/external/nvImageCodec/src/CMakeLists.txt Installs the library targets, including libraries, archives, runtime artifacts, and public headers, to their respective destinations and assigns them to the 'lib' component. ```cmake install( TARGETS ${LIBTOPACK} EXPORT "${TARGETS_EXPORT_NAME}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT lib PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" COMPONENT lib ) ``` -------------------------------- ### Install nvjpeg Extension Libraries (Unix) Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/external/nvImageCodec/extensions/nvjpeg/CMakeLists.txt Installs the `nvjpeg_ext` and `nvjpeg_ext_static` targets on Unix systems. Libraries are placed in the 'lib' component, and public headers in the 'include' component. ```cmake if(UNIX) install(TARGETS ${EXT_LIBRARY_NAME} ${EXT_LIBRARY_NAME}_static LIBRARY DESTINATION extensions NAMELINK_SKIP COMPONENT lib ARCHIVE COMPONENT lib PUBLIC_HEADER DESTINATION include COMPONENT lib ) else() install(TARGETS ${EXT_LIBRARY_NAME} RUNTIME DESTINATION extensions COMPONENT lib LIBRARY COMPONENT lib ARCHIVE COMPONENT lib PUBLIC_HEADER DESTINATION include COMPONENT lib ) endif() ``` -------------------------------- ### Install Font Resource Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/src/visualizer/CMakeLists.txt Installs a specific font file to the share directory for the visualizer resources. This makes the font available at runtime. ```cmake install(FILES ${RENDERING_SOURCE_RESOURCE_DIR}/assets/JetBrainsMono-Regular.ttf DESTINATION share/LichtFeld-Studio/visualizer/resources/assets/fonts) ``` -------------------------------- ### Install Visualizer Header File Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/src/visualizer/CMakeLists.txt Installs the visualizer header file to the include directory if the BUILD_PORTABLE flag is not set. This ensures the header is available for external use. ```cmake if(NOT BUILD_PORTABLE) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/visualizer/visualizer.hpp DESTINATION include/visualizer) endif() ``` -------------------------------- ### Generate openmesh.pc file Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/external/OpenMesh/CMakeLists.txt Configures the openmesh.pc file using a template and installs it to the pkgconfig directory. ```cmake set(DEST_DIR "${CMAKE_INSTALL_PREFIX}") set(PRIVATE_LIBS "-lOpenMeshCore -lOpenMeshTools") configure_file("openmesh.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/openmesh.pc" @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/openmesh.pc DESTINATION libdata/pkgconfig) ``` -------------------------------- ### Install Include Directory Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/src/io/CMakeLists.txt Conditionally installs the 'io' include directory from the current source directory to the 'include' destination if BUILD_PORTABLE is not set. ```cmake if(NOT BUILD_PORTABLE) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/io DESTINATION include) endif() ``` -------------------------------- ### Install nvimgcodec Target Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/CMakeLists.txt Installs the nvimgcodec target library and runtime components if the target exists. This is typically used for core plugin libraries. ```cmake if(TARGET nvimgcodec) install(TARGETS nvimgcodec LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) endif() ``` -------------------------------- ### Install nvjpeg_ext Extension Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/CMakeLists.txt Installs the nvjpeg_ext extension target, placing its library and runtime components in a dedicated 'extensions' subdirectory. Use for specific plugin extensions. ```cmake if(TARGET nvjpeg_ext) install(TARGETS nvjpeg_ext LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/extensions" RUNTIME DESTINATION "extensions" ) endif() ``` -------------------------------- ### Basic Panel Implementation Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/docs/plugin-dev-workflow.md A simple panel that starts with an immediate-mode draw function. ```python import lichtfeld as lf class MainPanel(lf.ui.Panel): id = "my_plugin.main_panel" label = "My Plugin" space = lf.ui.PanelSpace.MAIN_PANEL_TAB def draw(self, ui): ui.heading("Hello") ui.text_disabled("Start simple and keep state on self.") ``` -------------------------------- ### Configure Package Config File Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/external/nvImageCodec/src/CMakeLists.txt Generates the Config.cmake file from a template, installing it to the specified destination. ```cmake configure_package_config_file( "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/template/Config.cmake.in" "${project_config}" INSTALL_DESTINATION "${config_install_dir}" ) ``` -------------------------------- ### Set up vcpkg Package Manager Source: https://github.com/mrnerf/lichtfeld-studio/wiki/Build-Instructions-‐-Windows Clone the vcpkg repository and run the bootstrap script to set up the C++ package manager. This is a one-time setup. ```powershell git clone https://github.com/microsoft/vcpkg.git cd vcpkg && .\bootstrap-vcpkg.bat -disableMetrics && cd .. ``` -------------------------------- ### Install Lichtfeld Plugins Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/src/python/CMakeLists.txt Installs the lfs_plugins Python package. For portable builds, plugins are installed to the bin directory; otherwise, they are installed to the Python installation directory. ```cmake # Install lfs_plugins Python package to bin for portable builds if(BUILD_PORTABLE) install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/lfs_plugins" DESTINATION "${CMAKE_INSTALL_BINDIR}" FILES_MATCHING PATTERN "*.py" ) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/_lfs_panel_contract.py" DESTINATION "${CMAKE_INSTALL_BINDIR}" ) else() install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/lfs_plugins" DESTINATION "${PYTHON_INSTALL_DIR}" FILES_MATCHING PATTERN "*.py" ) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/_lfs_panel_contract.py" DESTINATION "${PYTHON_INSTALL_DIR}" ) endif() ``` -------------------------------- ### Install GCC 14 on Ubuntu 24.04+ Source: https://github.com/mrnerf/lichtfeld-studio/wiki/Build-Instructions-‐-Linux Installs GCC 14 and its associated tools on Ubuntu 24.04 and later. Sets GCC 14 as the default compiler using update-alternatives. ```bash # Install GCC 14 sudo apt update sudo apt install gcc-14 g++-14 gfortran-14 # Set as default sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 60 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 60 sudo update-alternatives --config gcc sudo update-alternatives --config g++ ``` -------------------------------- ### Create and Navigate to Repositories Directory Source: https://github.com/mrnerf/lichtfeld-studio/wiki/Build-Instructions-‐-Windows Create a 'repos' directory in your user profile and then navigate into it. Ensure the chosen directory path does not contain spaces to avoid build failures. ```powershell mkdir repos cd repos ``` -------------------------------- ### Install Lichtfeld Python Module Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/src/python/CMakeLists.txt Installs the lfs_py Python module (.so/.pyd). For portable builds, it's installed to the bin directory; otherwise, it's installed to the Python installation directory. ```cmake set(PYTHON_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/python") # Install lichtfeld Python module (.so/.pyd) to bin for portable builds if(BUILD_PORTABLE) install(TARGETS lfs_py LIBRARY DESTINATION "${CMAKE_INSTALL_BINDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" # Windows DLLs ) else() install(TARGETS lfs_py LIBRARY DESTINATION "${PYTHON_INSTALL_DIR}" RUNTIME DESTINATION "${PYTHON_INSTALL_DIR}" # Windows DLLs ) endif() ``` -------------------------------- ### Setup vcpkg and Build LichtFeld-Studio Source: https://github.com/mrnerf/lichtfeld-studio/wiki/Build-Instructions-‐-Linux Clones the vcpkg repository and bootstraps it, disabling metrics. Clones the LichtFeld-Studio repository with submodules. Configures and builds the project using CMake with Ninja generator. ```bash # Set up vcpkg (one-time setup) git clone https://github.com/microsoft/vcpkg.git cd vcpkg && ./bootstrap-vcpkg.sh -disableMetrics && cd .. ## If you want you can specify vcpkg locally without globally setting env variable (see -DCMAKE_TOOLCHAIN_FILE version) export VCPKG_ROOT=/path/to/vcpkg # Add to ~/.bashrc # Clone repository and submodules git clone --recursive https://github.com/MrNeRF/LichtFeld-Studio cd LichtFeld-Studio # Build cmake -B build -DCMAKE_BUILD_TYPE=Release -G Ninja ## Or if you want you can specify your own vcpkg # cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="/scripts/buildsystems/vcpkg.cmake" -G Ninja cmake --build build -- -j$(nproc) ``` -------------------------------- ### Basic Training Configuration Source: https://github.com/mrnerf/lichtfeld-studio/wiki/Example-Dataset This is the basic command to start training with LichtFeld Studio. It specifies the dataset directory and the output directory. ```bash ./build/LichtFeld-Studio -d data/garden -o output/garden ``` -------------------------------- ### Install Python Shared Library Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/src/python/CMakeLists.txt Installs the Python shared library (e.g., libpython3.12.so*) if it is found. The library is installed to the specified library directory as part of the runtime component. ```cmake file(GLOB PYTHON_SHARED_LIBS "${VCPKG_PYTHON_TOOLS_DIR}/../../lib/libpython3.12.so*") if(PYTHON_SHARED_LIBS) install(FILES ${PYTHON_SHARED_LIBS} DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT runtime ) endif() ``` -------------------------------- ### Build Static Documentation Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/docs/README.md Generates static content for the documentation in the `build` directory, ready for hosting. Run this command from the `docs` directory. ```bash pnpm build ``` -------------------------------- ### Install Lichtfeld Python Runtime Library Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/src/python/CMakeLists.txt Installs the lfs_python_runtime shared library, which is required by the Lichtfeld module and executable. It's installed to the library directory or the bin directory for Windows DLLs. ```cmake # Install lfs_python_runtime shared library (required by lichtfeld module and exe) install(TARGETS lfs_python_runtime LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" # Windows DLLs ) ``` -------------------------------- ### Install Python Standard Library on Windows Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/src/python/CMakeLists.txt Installs the Python standard library to the 'Lib' directory, excluding specific subdirectories like '__pycache__', 'test', and 'ensurepip', to maintain a clean portable installation. ```cmake if(EXISTS "${VCPKG_PYTHON_STDLIB}") install(DIRECTORY "${VCPKG_PYTHON_STDLIB}/" DESTINATION "${PYTHON_INSTALL_STDLIB}" COMPONENT runtime PATTERN "__pycache__" EXCLUDE PATTERN "*.pyc" EXCLUDE PATTERN "test" EXCLUDE PATTERN "tests" EXCLUDE PATTERN "idle_test" EXCLUDE PATTERN "tkinter" EXCLUDE PATTERN "turtledemo" EXCLUDE PATTERN "idlelib" EXCLUDE PATTERN "lib2to3" EXCLUDE PATTERN "ensurepip" EXCLUDE ) message(STATUS " Will bundle Python stdlib from: ${VCPKG_PYTHON_STDLIB}") else() message(WARNING "Python stdlib not found at ${VCPKG_PYTHON_STDLIB}") endif() ``` -------------------------------- ### Create Data Directory Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/eval/README.md Creates a 'data' directory in the project root. This is the first step before downloading the dataset. ```bash mkdir data ``` -------------------------------- ### Install Header Files on macOS Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/external/OpenMesh/src/OpenMesh/Tools/CMakeLists.txt Installs header files for various OpenMesh Tools modules on macOS when the project is not a bundle. It uses GLOB to find header files and then installs them to specific subdirectories. ```cmake if ( NOT VCI_PROJECT_MACOS_BUNDLE AND APPLE ) FILE(GLOB files_install_Decimater "${CMAKE_CURRENT_SOURCE_DIR}/Decimater/*.hh" ) FILE(GLOB files_install_Dualizer "${CMAKE_CURRENT_SOURCE_DIR}/Dualizer/*.hh" ) FILE(GLOB files_install_HoleFiller "${CMAKE_CURRENT_SOURCE_DIR}/HoleFiller/*.hh" ) FILE(GLOB files_install_KERNEL_OSG "${CMAKE_CURRENT_SOURCE_DIR}/Kernel_OSG/*.hh" ) FILE(GLOB files_install_Smoother "${CMAKE_CURRENT_SOURCE_DIR}/Smoother/*.hh" ) FILE(GLOB files_install_SmartTagger "${CMAKE_CURRENT_SOURCE_DIR}/SmartTagger/*.hh" ) FILE(GLOB files_install_Subdivider_Adaptive "${CMAKE_CURRENT_SOURCE_DIR}/Subdivider/Adaptive/Composite/*.hh" ) FILE(GLOB files_install_Subdivider_Uniform "${CMAKE_CURRENT_SOURCE_DIR}/Subdivider/Uniform/*.hh" ) FILE(GLOB files_install_Subdivider_Uniform_Composite "${CMAKE_CURRENT_SOURCE_DIR}/Subdivider/Uniform/Composite/*.hh" ) FILE(GLOB files_install_Utils "${CMAKE_CURRENT_SOURCE_DIR}/Utils/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/Utils/getopt.h" ) FILE(GLOB files_install_VDPM "${CMAKE_CURRENT_SOURCE_DIR}/VDPM/*.hh" ) INSTALL(FILES ${files_install_Decimater} DESTINATION include/OpenMesh/Tools/Decimater ) INSTALL(FILES ${files_install_Dualizer} DESTINATION include/OpenMesh/Tools/Dualizer ) INSTALL(FILES ${files_install_HoleFiller} DESTINATION include/OpenMesh/Tools/HoleFiller ) INSTALL(FILES ${files_install_KERNEL_OSG} DESTINATION include/OpenMesh/Tools/Kernel_OSG ) INSTALL(FILES ${files_install_Smoother} DESTINATION include/OpenMesh/Tools/Smoother ) INSTALL(FILES ${files_install_SmartTagger} DESTINATION include/OpenMesh/Tools/SmartTagger ) INSTALL(FILES ${files_install_Subdivider_Adaptive} DESTINATION include/OpenMesh/Tools/Subdivider/Adaptive/Composite ) INSTALL(FILES ${files_install_Subdivider_Uniform} DESTINATION include/OpenMesh/Tools/Subdivider/Uniform ) INSTALL(FILES ${files_install_Subdivider_Uniform_Composite} DESTINATION include/OpenMesh/Tools/Subdivider/Uniform/Composite ) INSTALL(FILES ${files_install_Utils} DESTINATION include/OpenMesh/Tools/Utils ) INSTALL(FILES ${files_install_VDPM} DESTINATION include/OpenMesh/Tools/VDPM ) endif() ``` -------------------------------- ### Viewer Configuration and Initialization Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/src/visualizer/gui/resources/viewer/viewer_template.html Parses URL parameters to configure viewer settings like poster, skybox, content, and UI options. Initializes the viewer with fetched settings and content. ```javascript const createImage = (url) => { const img = new Image(); img.src = url; return img; }; const url = new URL(location.href); const posterUrl = url.searchParams.get('poster'); const skyboxUrl = url.searchParams.get('skybox'); const settingsUrl = url.searchParams.has('settings') ? url.searchParams.get('settings') : './settings.json'; const contentUrl = url.searchParams.has('content') ? url.searchParams.get('content') : './scene.compressed.ply'; const sseConfig = { poster: posterUrl && createImage(posterUrl), skyboxUrl, contentUrl, contents: fetch(contentUrl), noui: url.searchParams.has('noui'), noanim: url.searchParams.has('noanim'), ministats: url.searchParams.has('ministats'), unified: url.searchParams.has('unified'), aa: url.searchParams.has('aa') }; window.sse = { config: sseConfig, settings: fetch(settingsUrl).then(response => response.json()) }; ``` -------------------------------- ### Install Python Stubs Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/src/python/CMakeLists.txt Installs Python stubs. The source directory for stubs is determined by BUILD_PYTHON_STUBS. If true, it uses GENERATED_STUBS_DIR; otherwise, it uses the committed stubs directory. Installation location depends on BUILD_PORTABLE. ```cmake # Stubs: use generated when available, otherwise committed from source tree if(BUILD_PYTHON_STUBS) set(STUBS_DIR "${GENERATED_STUBS_DIR}") else() set(STUBS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/stubs") endif() if(BUILD_PORTABLE) install(DIRECTORY "${STUBS_DIR}/" DESTINATION "${CMAKE_INSTALL_BINDIR}" OPTIONAL) else() install(DIRECTORY "${STUBS_DIR}/" DESTINATION "${PYTHON_INSTALL_DIR}" OPTIONAL) endif() ``` -------------------------------- ### Create Plugin with CLI Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/docs/plugin-dev-workflow.md Use the CLI to create a new plugin package and local development helpers. ```bash LichtFeld-Studio plugin create my_plugin ``` -------------------------------- ### Install Python Executable on Linux Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/src/python/CMakeLists.txt Installs the Python executable to the library directory for Linux portable builds. ```cmake install(PROGRAMS "${Python_EXECUTABLE}" ``` -------------------------------- ### Install Python Executable on Windows Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/src/python/CMakeLists.txt Installs the Python executable to the bin directory for Windows portable builds. ```cmake install(PROGRAMS "${Python_EXECUTABLE}" DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT runtime ) ``` -------------------------------- ### Install Header Files (Non-macOS) Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/external/OpenMesh/src/OpenMesh/Tools/CMakeLists.txt Installs header files for OpenMesh Tools on non-macOS platforms, excluding specific patterns like CVS, .svn, tmp, Templates, and Debian files. It also installs the getopt.h file separately. ```cmake if (NOT APPLE AND NOT ${OPENMESH_NO_INSTALL_HEADERS}) # Install Header Files install(DIRECTORY . DESTINATION include/OpenMesh/Tools FILES_MATCHING PATTERN "*.hh" PATTERN "CVS" EXCLUDE PATTERN ".svn" EXCLUDE PATTERN "tmp" EXCLUDE PATTERN "Templates" EXCLUDE PATTERN "Debian*" EXCLUDE) #install the config file install(FILES Utils/getopt.h DESTINATION include/OpenMesh/Tools/Utils) endif() ``` -------------------------------- ### Install NVTX using Conda Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/external/nvImageCodec/external/NVTX/README.md Installs the NVTX library using the Conda package manager from the conda-forge channel. ```bash conda install -c conda-forge nvtx ``` -------------------------------- ### Install Scrub Controls Demo Plugin Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/docs/plugins/examples/scrub_controls_demo/README.md Copy the demo plugin package to the LichtFeld Studio plugins directory. Ensure you restart the application or reload plugins for the changes to take effect. ```bash cp -r docs/plugins/examples/scrub_controls_demo ~/.lichtfeld/plugins/scrub_controls_demo ``` -------------------------------- ### Create a Reactive Training Monitor Panel Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/docs/plugins/getting-started.md Implement a custom UI panel to display real-time training metrics like loss, best loss, PSNR, and Gaussian count. It also includes a plot for visualizing the loss history. ```python import lichtfeld as lf from lfs_plugins.ui import RuntimeState from lfs_plugins.ui.signals import Signal class TrainingMonitor(lf.ui.Panel): label = "Training Monitor" space = lf.ui.PanelSpace.MAIN_PANEL_TAB order = 50 def __init__(self): self.best_loss = Signal(float("inf"), name="best_loss") self.loss_history = [] RuntimeState.loss.subscribe_as("my_plugin", self._on_loss_change) def _on_loss_change(self, loss: float): if loss > 0: self.loss_history.append(loss) if loss < self.best_loss.value: self.best_loss.value = loss @classmethod def poll(cls, context) -> bool: return RuntimeState.has_trainer.value def draw(self, ui): ui.heading("Training Monitor") state = RuntimeState.trainer_state.value ui.label(f"State: {state}") ui.label(f"Iteration: {RuntimeState.iteration.value}") ui.label(f"Loss: {RuntimeState.loss.value:.6f}") ui.label(f"Best Loss: {self.best_loss.value:.6f}") ui.label(f"PSNR: {RuntimeState.psnr.value:.2f}") ui.label(f"Gaussians: {RuntimeState.num_gaussians.value:,}") progress = RuntimeState.training_progress.value ui.progress_bar(progress, f"{progress * 100:.1f}%") if self.loss_history: ui.plot_lines( "Loss##monitor", self.loss_history[-200:] 0.0, max(self.loss_history[-200:]), (0, 80), ) ``` -------------------------------- ### Native Build for Development Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/docs/building_and_distribution.md Builds LichtFeld Studio for your local GPU, offering the fastest compile times. Use this for active development. After building, you can run the executable with the --help flag or start a training run. ```bash cmake -B build cmake --build build -j 16 ./build/LichtFeld-Studio --help # Example training run ./build/LichtFeld-Studio -d /path/to/data -o /path/to/output ``` -------------------------------- ### Install NVTX using PIP Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/external/nvImageCodec/external/NVTX/README.md Installs the NVTX Python package using pip. Requires Python 3.6 or newer. ```bash python3 -m pip install nvtx ``` -------------------------------- ### Install Exported Targets Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/external/nvImageCodec/src/CMakeLists.txt Installs the exported targets file (e.g., nvimgcodecTargets.cmake) into the cmake/nvimgcodec directory, using a specified namespace. ```cmake install( EXPORT "${TARGETS_EXPORT_NAME}" NAMESPACE "${namespace}" DESTINATION "cmake/nvimgcodec" COMPONENT lib ) ``` -------------------------------- ### Install nvjpeg2k_ext Extension Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/CMakeLists.txt Installs the nvjpeg2k_ext extension target, similar to nvjpeg_ext, into the 'extensions' subdirectory. This is for JPEG2000 related plugin extensions. ```cmake if(TARGET nvjpeg2k_ext) install(TARGETS nvjpeg2k_ext LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/extensions" RUNTIME DESTINATION "extensions" ) endif() ``` -------------------------------- ### Build Project Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/REACTIVE_UI_REMAINING_PLAN.md Builds the entire project using CMake. Use this command to compile all project components. ```bash cmake --build build -j16 ``` -------------------------------- ### Set Installation Prefix Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/CMakeLists.txt Configures the installation prefix for the project. If the CMAKE_INSTALL_PREFIX is not yet set, it defaults to a subdirectory within the build directory. ```cmake if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "" FORCE) endif() ``` -------------------------------- ### LichtFeld Studio Runtime Logging Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/docs/plugin-system.md Example of using the LichtFeld logging utility to output messages at different severity levels during runtime. ```python import lichtfeld as lf lf.log.debug("debug") lf.log.info("info") lf.log.warn("warn") lf.log.error("error") ``` -------------------------------- ### Install Header Files on Apple Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/external/OpenMesh/src/OpenMesh/Core/CMakeLists.txt Installs various header files for OpenMesh components to specific subdirectories under 'include/OpenMesh/Core' on Apple systems. ```cmake if ( NOT VCI_PROJECT_MACOS_BUNDLE AND APPLE ) FILE(GLOB files_install_Geometry "${CMAKE_CURRENT_SOURCE_DIR}/Geometry/*.hh" ) FILE(GLOB files_install_IO "${CMAKE_CURRENT_SOURCE_DIR}/IO/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/IO/*.inl" ) FILE(GLOB files_install_IO_importer "${CMAKE_CURRENT_SOURCE_DIR}/IO/importer/*.hh" ) FILE(GLOB files_install_IO_exporter "${CMAKE_CURRENT_SOURCE_DIR}/IO/exporter/*.hh" ) FILE(GLOB files_install_IO_reader "${CMAKE_CURRENT_SOURCE_DIR}/IO/reader/*.hh" ) FILE(GLOB files_install_IO_writer "${CMAKE_CURRENT_SOURCE_DIR}/IO/writer/*.hh" ) FILE(GLOB files_install_Mesh "${CMAKE_CURRENT_SOURCE_DIR}/Mesh/*.hh" ) FILE(GLOB files_install_Mesh_Gen "${CMAKE_CURRENT_SOURCE_DIR}/Mesh/gen/*.hh" ) FILE(GLOB files_install_System "${CMAKE_CURRENT_SOURCE_DIR}/System/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/System/config.h" ) FILE(GLOB files_install_Utils "${CMAKE_CURRENT_SOURCE_DIR}/Utils/*.hh" ) INSTALL(FILES ${files_install_Geometry} DESTINATION include/OpenMesh/Core/Geometry ) INSTALL(FILES ${files_install_IO} DESTINATION include/OpenMesh/Core/IO ) INSTALL(FILES ${files_install_IO_importer} DESTINATION include/OpenMesh/Core/IO/importer ) INSTALL(FILES ${files_install_IO_exporter} DESTINATION include/OpenMesh/Core/IO/exporter ) INSTALL(FILES ${files_install_IO_reader} DESTINATION include/OpenMesh/Core/IO/reader ) INSTALL(FILES ${files_install_IO_writer} DESTINATION include/OpenMesh/Core/IO/writer ) INSTALL(FILES ${files_install_Mesh} DESTINATION include/OpenMesh/Core/Mesh ) INSTALL(FILES ${files_install_Mesh_Gen} DESTINATION include/OpenMesh/Core/Mesh/gen ) INSTALL(FILES ${files_install_System} DESTINATION include/OpenMesh/Core/System ) INSTALL(FILES ${files_install_Utils} DESTINATION include/OpenMesh/Core/Utils ) endif() ``` -------------------------------- ### Method Delegation Example Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/docs/layout-composition.md Shows how `SubLayout` delegates widget methods not explicitly bound for performance to the underlying `UILayout` object. ```python with layout.row() as row: row.same_line() # delegated to UILayout row.begin_group() # delegated to UILayout row.end_group() # delegated to UILayout ``` -------------------------------- ### Plugin Development Helpers Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/docs/plugin-dev-workflow.md Useful companion commands for managing plugins. ```bash LichtFeld-Studio plugin check my_plugin LichtFeld-Studio plugin list ``` -------------------------------- ### Navigate to User Directory Source: https://github.com/mrnerf/lichtfeld-studio/wiki/Build-Instructions-‐-Windows Change the current directory to your user profile directory. This is a common starting point for setting up development environments. ```powershell cd %userprofile% ``` -------------------------------- ### Layout Composition Example Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/docs/plugins/api-reference.md Demonstrates how to use sub-layouts like row, box, column, and grid_flow for creating complex UI structures. Sub-layouts are context managers that allow for nested widget composition and state cascading. ```python def draw(self, ui): with ui.row() as row: row.prop_enum(self, "mode", "fast", "Fast") row.prop_enum(self, "mode", "quality", "Quality") with ui.box() as box: box.heading("Settings") box.prop(self, "opacity") with ui.column() as col: col.enabled = self.is_active col.prop(self, "value") with col.row() as row: row.button("Apply") row.button("Cancel") with ui.grid_flow(columns=3) as grid: for item in items: with grid.box() as cell: cell.label(item.name) cell.button("Select") ``` -------------------------------- ### Convenience Gizmo Constructors Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/docs/plugins/getting-started.md Use shortcut constructors for TranslationGizmo, RotationGizmo, and ScaleGizmo for quicker setup of common transform operations. ```python move = lf.TranslationGizmo(id="move_anchor") rotate = lf.RotationGizmo(id="rotate_anchor") scale = lf.ScaleGizmo(id="scale_anchor") ``` -------------------------------- ### Define Benchmark Sources List Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/tests/CMakeLists.txt Initializes the list of benchmark source files and appends existing benchmark files from the source directory. ```cmake set(BENCHMARK_SOURCES test_main.cpp) foreach(BENCH_FILE ${BENCHMARK_FILES}) if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${BENCH_FILE}") list(APPEND BENCHMARK_SOURCES ${BENCH_FILE}) endif() endforeach() ``` -------------------------------- ### Install Python DLLs Directory on Windows Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/src/python/CMakeLists.txt Installs the directory containing compiled Python extensions (e.g., _socket.pyd) to the 'DLLs' destination for Windows portable builds. ```cmake if(EXISTS "${VCPKG_PYTHON_DLLS}") install(DIRECTORY "${VCPKG_PYTHON_DLLS}/" DESTINATION "DLLs" COMPONENT runtime PATTERN "__pycache__" EXCLUDE ) endif() ``` -------------------------------- ### Print Python Installation Status Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/src/python/CMakeLists.txt Prints the detected Python executable path and the Python standard library path to the console. This is useful for debugging and verifying the installation configuration. ```cmake message(STATUS " Python executable: ${Python_EXECUTABLE}") message(STATUS " Python stdlib: ${VCPKG_PYTHON_STDLIB}") ``` -------------------------------- ### Basic Signal Usage Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/docs/plugins/getting-started.md Demonstrates creating, updating, and subscribing to a basic signal. Use `subscribe_as` for automatic cleanup. ```python from lfs_plugins.ui.signals import Signal, ComputedSignal, ThrottledSignal, Batch # Basic signal count = Signal(0, name="count") count.value = 5 # Notifies subscribers current = count.value # Read current value current = count.peek() # Read without tracking # Subscribe unsub = count.subscribe(lambda v: print(f"Count: {v}")) unsub() # Stop receiving updates # Owner-tracked subscription (auto-cleanup on plugin unload) unsub = count.subscribe_as("my_plugin", lambda v: print(v)) ``` -------------------------------- ### Loading Icons with Lichtfeld Studio Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/docs/plugins/api-reference.md Demonstrates how to load icons using the Lichtfeld Studio API. It shows direct loading and freeing of texture IDs, which are opaque handles managed by the C++ backend. ```python import lichtfeld as lf texture_id = lf.load_icon(name) lf.free_icon(texture_id) ``` -------------------------------- ### Create a New Plugin with Python API Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/docs/plugins/getting-started.md Use the `lichtfeld.plugins.create()` Python API to generate the minimal source files for a new plugin. This is a quick way to scaffold a new plugin project. ```python import lichtfeld as lf path = lf.plugins.create("my_new_plugin") ``` -------------------------------- ### Install Header Files (Non-Apple) Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/external/OpenMesh/src/OpenMesh/Core/CMakeLists.txt Installs header files from the current directory to 'include/OpenMesh/Core', excluding specific patterns like CVS, .svn, tmp, Templates, and Debian*. ```cmake if (NOT APPLE AND NOT ${OPENMESH_NO_INSTALL_HEADERS}) # Install Header Files) install(DIRECTORY . DESTINATION include/OpenMesh/Core FILES_MATCHING PATTERN "*.hh" PATTERN "CVS" EXCLUDE PATTERN ".svn" EXCLUDE PATTERN "tmp" EXCLUDE PATTERN "Templates" EXCLUDE PATTERN "Debian*" EXCLUDE) #install the config file install(FILES System/config.h DESTINATION include/OpenMesh/Core/System) endif () ``` -------------------------------- ### Set Install Prefix for Windows Source: https://github.com/mrnerf/lichtfeld-studio/blob/master/external/nvImageCodec/CMakeLists.txt Configures the installation prefix for Windows systems, setting a default path including project version and CUDA version if the prefix is not already set. ```cmake if(WIN32) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "C:\\Program Files\\NVIDIA nvImageCodec\\v${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}\\${CUDA_VERSION_MAJOR}" CACHE PATH "where nvImageCodec will be installed" FORCE) endif() else() if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "/opt/nvidia/nvimgcodec_cuda${CUDA_VERSION_MAJOR}" CACHE PATH "where nvImageCodec will be installed" FORCE) endif() endif() ```