================ CODE SNIPPETS ================ TITLE: Build and Install Release (CMake CLI) DESCRIPTION: Builds and installs the Release version of Cesium Native using the CMake command-line. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-windows.md#_snippet_6 LANGUAGE: bash CODE: ``` cmake --build build --config Release --target install ``` -------------------------------- TITLE: Configure and Install Release for Android (CMake CLI) DESCRIPTION: Configures and installs the Release version of Cesium Native for Android using CMake and Ninja. Requires Android Studio, NDK, and Ninja to be set up. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-windows.md#_snippet_8 LANGUAGE: bash CODE: ``` cmake -B build-android -S . -G Ninja -DCMAKE_TOOLCHAIN_FILE="unreal-android-toolchain.cmake" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release cmake --build build-android --config Release --target install ``` -------------------------------- TITLE: Cesium for Unreal Installation Guide DESCRIPTION: Provides instructions on how to install the Cesium for Unreal plugin, either from the Unreal Engine Marketplace or directly from releases. It covers uninstalling previous versions and extracting the plugin to the correct directory. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/README.md#_snippet_0 LANGUAGE: UnrealScript CODE: ``` 1. If you previously installed the Cesium for Unreal plugin via the Unreal Engine Marketplace, uninstall it. 2. Extract the release ZIP to Unreal Engine's `Engine/Plugins/Marketplace` directory. For example, on Unreal Engine 5.3 on Windows, this is typically `C:\Program Files\Epic Games\UE_5.3\Engine\Plugins\Marketplace`. 3. You may need to create the `Marketplace` directory yourself. 4. If you've done this correctly, you'll find a `CesiumForUnreal` sub-directory inside the `Marketplace` directory, and the plugin is ready to use. ``` -------------------------------- TITLE: Cesium for Unreal Developer Setup DESCRIPTION: Guides users on setting up a development environment for Cesium for Unreal, enabling compilation, customization, and contribution to the project's development. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/README.md#_snippet_1 LANGUAGE: UnrealScript CODE: ``` See the [Developer Setup Guide](Documentation/developer-setup.md) to learn how to set up a development environment for Cesium for Unreal, allowing you to compile it, customize it, and contribute to its development. ``` -------------------------------- TITLE: Build and Install Debug (CMake CLI) DESCRIPTION: Builds and installs the Debug version of Cesium Native using the CMake command-line. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-windows.md#_snippet_7 LANGUAGE: bash CODE: ``` cmake --build build --config Debug --target install ``` -------------------------------- TITLE: Generating Reference Documentation DESCRIPTION: Commands to generate the reference documentation for Cesium for Unreal using Doxygen. This process requires Node.js and Doxygen to be installed. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup.md#_snippet_3 LANGUAGE: bash CODE: ``` Install Doxygen and make sure `doxygen` is in your path. Run `npm install` Run `npm run doxygen` The reference documentation will be written to `Documentation/Reference`. ``` -------------------------------- TITLE: Build Cesium Native Debug (Visual Studio) DESCRIPTION: Builds a Debug version of Cesium Native by installing it to the expected project directory using Visual Studio's Solution Explorer. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-windows.md#_snippet_2 LANGUAGE: visualstudio CODE: ``` Right-click on the root CMakeLists.txt and select "Install". ``` -------------------------------- TITLE: Clone and Use Cesium for Unreal Samples Project DESCRIPTION: Clones the Cesium for Unreal Samples project from GitHub and opens it in the Unreal Editor. This project is used for testing and demonstrating the features of the Cesium for Unreal plugin. Once the plugin is installed in the Engine directory, the samples project will automatically detect it. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-linux.md#_snippet_9 LANGUAGE: bash CODE: ``` cd ~/dev git clone https://github.com/CesiumGS/cesium-unreal-samples.git # Then launch the Unreal Editor and open ~/dev/cesium-unreal-samples/CesiumForUnrealSamples.uproject ``` -------------------------------- TITLE: Metadata Value Type Examples DESCRIPTION: Illustrates various metadata type definitions and their corresponding explanations, showing how combinations of Type, ComponentType, and bIsArray define the data structure. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/Pages/upgrade-to-2.0-guide.md#_snippet_7 LANGUAGE: APIDOC CODE: ``` Example 1: Type: Boolean ComponentType: None bIsArray: false Explanation: Describes a boolean property. Values are retrieved as booleans. Example 2: Type: Vec2 ComponentType: Uint8 bIsArray: false Explanation: Describes a VEC2 property where the vectors contain unsigned 8-bit integer components. Values are retrieved as two-dimensional unsigned 8-bit integer vectors. Example 3: Type: String ComponentType: None bIsArray: true Explanation: Describes a string array property. Values are retrieved as arrays of strings. Example 4: Type: Scalar ComponentType: Float32 bIsArray: true Explanation: Describes a scalar array property where the scalars are single-precision floats. Values are retrieved as arrays of single-precision floats. ``` -------------------------------- TITLE: Compute Bounding Rectangle DESCRIPTION: A refactored example demonstrating improved clarity by using more descriptive parameter names for computing a bounding rectangle. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/Pages/style-guide.md#_snippet_5 LANGUAGE: cpp CODE: ``` // Better. static void ComputeBoundingRectangle(FVector BottomLeft, FVector TopRight) {...} ``` -------------------------------- TITLE: Convert Samples Project to C++ DESCRIPTION: Converts the Cesium for Unreal Samples project from Blueprint-only to a C++ project by copying the necessary Source directory. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-osx.md#_snippet_9 LANGUAGE: bash CODE: ``` cd ~/dev/cesium-unreal-samples cp -r ./Plugins/cesium-unreal/Documentation/Source . ``` -------------------------------- TITLE: Code Formatting with clang DESCRIPTION: Instructions on how to format the Cesium for Unreal codebase using clang to ensure consistency with the project's CI build process. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup.md#_snippet_1 LANGUAGE: bash CODE: ``` npm ci npm run format ``` -------------------------------- TITLE: Configure Xcode Scheme for Debugging DESCRIPTION: Guides on how to select the 'devEditor' scheme in Xcode and switch to a 'DebugGame' build configuration for debugging. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-osx.md#_snippet_11 LANGUAGE: bash CODE: ``` In Xcode, on the Product -> Scheme menu, choose 'devEditor'. If you want to build a debug configuration, go to Product -> Scheme -> Edit Scheme -> Run, select the Info tab and then change the "Build Configuration" to "DebugGame". ``` -------------------------------- TITLE: Build cesium-native (Debug Configuration) DESCRIPTION: Builds the cesium-native libraries and their dependencies using CMake for a Debug configuration. Installs the built libraries to the appropriate ThirdParty directory for Unreal Engine. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-osx.md#_snippet_2 LANGUAGE: bash CODE: ``` export UNREAL_ENGINE_ROOT='/Users/Shared/Epic Games/UE_5.4' cd ~/dev/cesium-unreal-samples/Plugins/cesium-unreal/extern cmake -B build -S . -DCMAKE_BUILD_TYPE=Debug cmake --build build --target install --parallel 14 ``` -------------------------------- TITLE: Build Cesium Native Release (Visual Studio) DESCRIPTION: Builds a Release version of Cesium Native using Visual Studio. This involves configuring CMake settings, selecting the Release configuration, and then installing. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-windows.md#_snippet_3 LANGUAGE: visualstudio CODE: ``` Right click on CMakeLists.txt and select "CMake Settings for cesium-unreal-extern". Add a new configuration by clicking the '+' and choose 'x64-Release'. Select the new "x64-Release" from the Solution Configuration dropdown. Right-click on CMakeLists.txt again and choose "Install". ``` -------------------------------- TITLE: Build cesium-native (Release Configuration) DESCRIPTION: Builds the cesium-native libraries and their dependencies using CMake for a Release or RelWithDebInfo configuration. Installs the built libraries to the appropriate ThirdParty directory for Unreal Engine. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-osx.md#_snippet_3 LANGUAGE: bash CODE: ``` export UNREAL_ENGINE_ROOT='/Users/Shared/Epic Games/UE_5.4' cd ~/dev/cesium-unreal-samples/Plugins/cesium-unreal/extern cmake -B build -S . -DCMAKE_BUILD_TYPE=RelWithDebInfo cmake --build build --target install --parallel 14 ``` -------------------------------- TITLE: Create Universal Libraries for macOS DESCRIPTION: Generates universal binary libraries for macOS by comparing and combining arm64 and x86_64 architectures using 'lipo'. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-osx.md#_snippet_7 LANGUAGE: bash CODE: ``` mkdir -p ~/dev/cesium-unreal-samples/Plugins/cesium-unreal/Source/ThirdParty/lib/Darwin-universal-Release for f in ~/dev/cesium-unreal-samples/Plugins/cesium-unreal/Source/ThirdParty/lib/Darwin-x86_64-Release/*.a do arm64f=~/dev/cesium-unreal-samples/Plugins/cesium-unreal/Source/ThirdParty/lib/Darwin-arm64-Release/$(basename -- $f) x64f=~/dev/cesium-unreal-samples/Plugins/cesium-unreal/Source/ThirdParty/lib/Darwin-x86_64-Release/$(basename -- $f) universalf=~/dev/cesium-unreal-samples/Plugins/cesium-unreal/Source/ThirdParty/lib/Darwin-universal-Release/$(basename -- $f) if diff $arm64f $x64f; cp $arm64f $universalf else lipo -create -output $universalf $arm64f $x64f fi done ``` -------------------------------- TITLE: Generate Xcode Project Files DESCRIPTION: Generates Xcode project files for the Cesium for Unreal Samples project, enabling building within Xcode. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-osx.md#_snippet_10 LANGUAGE: bash CODE: ``` cd ~/dev/cesium-unreal-samples "/Users/Shared/Epic Games/UE_5.4/Engine/Build/BatchFiles/Mac/GenerateProjectFiles.sh" -game -project="$PWD/CesiumForUnrealSamples.uproject" ``` -------------------------------- TITLE: Install Cesium for Unreal ZIP DESCRIPTION: Steps to install a downloaded pre-release ZIP file of the Cesium for Unreal plugin into an Unreal Engine project. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/Pages/using-prerelease-packages.md#_snippet_2 LANGUAGE: unreal-engine CODE: ``` 1. Uninstall any existing Cesium for Unreal plugin installed via the Unreal Engine Marketplace. 2. Locate Unreal Engine's `Engine/Plugins/Marketplace` directory (e.g., `C:\Epic Games\UE_5.3\Engine\Plugins\Marketplace`). 3. Delete the `CesiumForUnreal` subdirectory if it exists. 4. Extract the downloaded ZIP file into the `Marketplace` directory, ensuring a `CesiumForUnreal` sub-directory is created. ``` -------------------------------- TITLE: Build Release Version of cesium-native DESCRIPTION: Configures, builds, and installs a Release version of the cesium-native library using CMake. It specifies the toolchain file, enables position-independent code, and sets the build type to Release. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-linux.md#_snippet_4 LANGUAGE: cmake CODE: ``` cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE="unreal-linux-toolchain.cmake" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release cmake --build build --target install ``` -------------------------------- TITLE: Install Cesium for Unreal Plugin DESCRIPTION: Copies the built Cesium for Unreal plugin into the Unreal Engine's Marketplace plugins directory on Linux. This step is crucial for the Unreal Editor to recognize and load the plugin. Note the specific subdirectory requirement for Linux. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-linux.md#_snippet_8 LANGUAGE: bash CODE: ``` mkdir -p $UNREAL_ENGINE_DIR/Engine/Plugins/Marketplace cp -r $CESIUM_FOR_UNREAL_DIR/../packages/CesiumForUnreal $UNREAL_ENGINE_DIR/Engine/Plugins/Marketplace/ ``` -------------------------------- TITLE: UPROPERTY Specifiers Example DESCRIPTION: Demonstrates the usage of various UPROPERTY specifiers for a MaximumScreenSpaceError property in ACesium3DTileset. It shows how specifiers control editor visibility, Blueprint interaction, categorization, and metadata. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/Pages/api-design-guide.md#_snippet_1 LANGUAGE: cpp CODE: ``` UPROPERTY( EditAnywhere, BlueprintGetter = GetMaximumScreenSpaceError, BlueprintSetter = SetMaximumScreenSpaceError, Category = "Cesium|Level of Detail", meta = (ClampMin = 0.0)) double MaximumScreenSpaceError = 16.0; ``` -------------------------------- TITLE: Clone Cesium for Unreal Repositories DESCRIPTION: Clones the Cesium for Unreal samples project and the Cesium for Unreal plugin itself, including its submodules. It also demonstrates how to update submodules if the `--recursive` flag was initially missed. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-windows.md#_snippet_1 LANGUAGE: git CODE: ``` git clone https://github.com/CesiumGS/cesium-unreal-samples.git cd cesium-unreal-samples mkdir Plugins cd Plugins git clone --recursive https://github.com/CesiumGS/cesium-unreal.git ``` LANGUAGE: git CODE: ``` git submodule update --init --recursive ``` -------------------------------- TITLE: Visual Studio Solution Configurations and Dependencies DESCRIPTION: Explanation of common Visual Studio solution configurations ('DebugGame Editor', 'Development Editor') for Cesium for Unreal projects and their specific build requirements for the cesium-native library. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-windows.md#_snippet_11 LANGUAGE: visualstudio CODE: ``` Solution Configurations: - DebugGame Editor: Easier to debug, requires Debug build of cesium-native (or falls back to Release). - Development Editor: Faster, always requires Release build of cesium-native. Build Process: - When building 'DebugGame Editor', the build process first looks for an installed Debug build of cesium-native. If not found, it uses an installed Release build. - When building 'Development Editor', the build process always uses an installed Release build of cesium-native and fails if one does not exist. Recommendation: - For 'Development Editor', build and install the 'Release' configuration of cesium-native. - For 'DebugGame Editor', build and install the 'Debug' configuration of cesium-native. ``` -------------------------------- TITLE: Build Debug Version of cesium-native DESCRIPTION: Configures, builds, and installs a Debug version of the cesium-native library using CMake. It specifies the toolchain file, enables position-independent code, and sets the build type to Debug. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-linux.md#_snippet_3 LANGUAGE: cmake CODE: ``` cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE="unreal-linux-toolchain.cmake" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Debug cmake --build build --target install ``` -------------------------------- TITLE: Build cesium-native with Multiple Threads DESCRIPTION: Builds and installs the cesium-native library using CMake with parallel processing enabled. The `-j` flag specifies the number of CPU cores to use for faster compilation. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-linux.md#_snippet_5 LANGUAGE: cmake CODE: ``` cmake --build build --target install -j14 ``` -------------------------------- TITLE: Build Cesium for Unreal for Intel macOS DESCRIPTION: Configures and builds the Cesium for Unreal project for Intel macOS using CMake, specifying architecture and build type. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-osx.md#_snippet_6 LANGUAGE: bash CODE: ``` cmake -B build-x64 -S . -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DCMAKE_BUILD_TYPE=RelWithDebInfo cmake --build build --target install --parallel 14 ``` -------------------------------- TITLE: Remove Symlink DESCRIPTION: Removes a previously created symbolic link, for example, when switching build configurations or processor targets. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-osx.md#_snippet_5 LANGUAGE: bash CODE: ``` cd ~/dev/cesium-unreal-samples/Plugins/cesium-unreal/extern # Remove the symlink if it exists rm ~/dev/cesium-unreal-samples/Plugins/cesium-unreal/Source/ThirdParty/lib/Darwin-universal-Release ``` -------------------------------- TITLE: UPROPERTY Categorization Examples DESCRIPTION: Demonstrates how to use the `Category` specifier in UPROPERTY to organize properties into logical groups, including nested categories using the '|' delimiter. This is crucial for maintainability and preventing packaging errors. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/Pages/api-design-guide.md#_snippet_7 LANGUAGE: cpp CODE: ``` UFUNCTION(Category = "Cesium") void RefreshTileset(); UPROPERTY(Category = "Cesium|Debug") bool SuspendUpdate; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium|Debug") bool SuspendUpdate; UPROPERTY(EditAnywhere, Category = "Cesium|Tile Loading") bool PreloadAncestors; UPROPERTY(EditAnywhere, Category = "Cesium|Debug") bool UpdateInEditor; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium|Debug") bool SuspendUpdate; UPROPERTY(EditAnywhere, Category = "Cesium|Debug") bool UpdateInEditor; UPROPERTY(EditAnywhere, Category = "Cesium|Tile Loading") bool PreloadAncestors; UPROPERTY() EOriginPlacement OriginPlacement = EOriginPlacement::CartographicOrigin; UPROPERTY() double OriginLatitude; UPROPERTY() double OriginLongitude; UPROPERTY() double OriginHeight; UPROPERTY() double Scale = 100.0; ``` -------------------------------- TITLE: Doxygen Documentation Standards DESCRIPTION: Details the documentation generation process using Doxygen and Cesium Native style guides. It highlights the exception for `UPROPERTY`s and `UFUNCTION`s, where `@copydoc` should be avoided to prevent tooltip issues, and manual duplication is preferred. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/Pages/style-guide.md#_snippet_8 LANGUAGE: APIDOC CODE: ``` /** * @brief Brief description of the function or property. * * Detailed explanation of the functionality, parameters, and return values. * Avoid @copydoc for UPROPERTY and UFUNCTION to ensure proper tooltip generation. */ void MyFunction(int Parameter); ``` -------------------------------- TITLE: Create Symlinks for Universal Libraries DESCRIPTION: Creates symbolic links to allow Cesium for Unreal to find the built libraries for a specific architecture (e.g., Apple Silicon) under the universal directory names. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-osx.md#_snippet_4 LANGUAGE: bash CODE: ``` cd ~/dev/cesium-unreal-samples/Plugins/cesium-unreal/Source/ThirdParty/lib ln -s ./Darwin-arm64-Debug Darwin-universal-Debug ln -s ./Darwin-arm64-Release Darwin-universal-Release ``` -------------------------------- TITLE: Running Cesium for Unreal Tests DESCRIPTION: Steps to execute the automated tests for the Cesium for Unreal plugin within an Unreal Engine project. This involves opening a specific project and using the Test Automation framework. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup.md#_snippet_2 LANGUAGE: bash CODE: ``` Open cesium-unreal/TestsProject/TestsProject.uproject in Unreal Engine From the menu, select Tools -> Test Automation In the Session Frontend Window, look for the Automation tab, and find the "Cesium" group of tests Check the Cesium group Click on "Start Tests" ``` -------------------------------- TITLE: Cesium for Unreal Build Principles DESCRIPTION: Key principles for building Cesium for Unreal, emphasizing the dependency on cesium-native and compiler consistency. It also details how Unreal Engine configurations interact with cesium-native builds. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup.md#_snippet_0 LANGUAGE: cpp CODE: ``` To build Cesium for Unreal, you must first compile and cmake-install cesium-native and its dependencies to Plugins/cesium-unreal/Source/ThirdParty. cesium-native is built and installed using CMake and the CMakeLists.txt found in the cesium-unreal/extern directory, _not_ the one in the cesium-unreal/extern/cesium-native directory. When installing from this directory, the default install path will put cesium-native where Cesium for Unreal expects to find it. You must use the same compiler to build cesium-native and Cesium for Unreal. The Unreal project "DebugGame" configuration tries to use the debug build of cesium-native if one is built and installed, and falls back on the release build otherwise. The "Development" and "Shipping" configurations use the release build exclusively. ``` -------------------------------- TITLE: Clone Cesium for Unreal Repository DESCRIPTION: Clones the Cesium for Unreal repository and its submodules. The `--recursive` flag is essential to ensure that all necessary dependencies, including cesium-native, are downloaded. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-linux.md#_snippet_1 LANGUAGE: bash CODE: ``` git clone -b ue5-main --recursive https://github.com/CesiumGS/cesium-unreal.git ``` -------------------------------- TITLE: Unreal Editor Setup for Testing DESCRIPTION: Steps to configure Unreal Editor for repeatable testing. This involves enabling the Functional Testing plugin and setting the Editor Startup Map to ensure a consistent environment when launching from Visual Studio. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/performance-profiling-setup-test.md#_snippet_0 LANGUAGE: unreal-engine CODE: ``` 1. Open Unreal Editor (UnrealEditor.exe) 2. Create a blank map (project doesn't matter. Choose an existing one or create a new one) 3. Go to Edit->Plugins 4. Search for "Functional Testing plugin". Check it to enable it 5. Save all 6. Set this map as the 'Editor Startup Map' so it loads when starting from Visual Studio ``` -------------------------------- TITLE: Visual Studio CPU Usage Tool Setup DESCRIPTION: Steps to configure Visual Studio's Diagnostic Tools for CPU profiling. This includes disabling memory usage and initially unchecking CPU profiling before starting a capture session. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/performance-profiling-with-cpu-usage.md#_snippet_0 LANGUAGE: visualstudio CODE: ``` 1. Open your project's Visual Studio solution (.sln). 2. From the menu, choose Debug->Windows->Show Diagnostic Tools 3. Configure it. Uncheck 'Memory Usage'. Under Settings, Uncheck "Enable CPU Profiling". ``` -------------------------------- TITLE: vcpkg Setup and Triplet Detection DESCRIPTION: Configures vcpkg by setting overlay directories and detecting the appropriate vcpkg triplet for the project, including handling potential errors. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/extern/CMakeLists.txt#_snippet_5 LANGUAGE: cmake CODE: ``` set(ENV{VCPKG_OVERLAY_PORTS} "${CMAKE_CURRENT_LIST_DIR}/vcpkg-overlays") set(ENV{VCPKG_OVERLAY_TRIPLETS} "${CMAKE_CURRENT_LIST_DIR}/vcpkg-overlays/triplets") include(${CMAKE_CURRENT_SOURCE_DIR}/cesium-native/cmake/detect-vcpkg-triplet.cmake) if (NOT VCPKG_TRIPLET) if (DEFINED ENV{VCPKG_TRIPLET}) set(VCPKG_TRIPLET "$ENV{VCPKG_TRIPLET}") elseif(DETECTED_VCPKG_TRIPLET_ERROR) message(FATAL_ERROR "${DETECTED_VCPKG_TRIPLET_ERROR}") else() set(VCPKG_TRIPLET "${DETECTED_VCPKG_TRIPLET}-unreal") endif() endif() ``` -------------------------------- TITLE: Quick Add Panel Additions DESCRIPTION: Added 'Google Photorealistic 3D Tiles' to the Quick Add panel for simplified project setup. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/CHANGES.md#_snippet_92 LANGUAGE: UnrealScript CODE: ``` Quick Add Panel::Google Photorealistic 3D Tiles ``` -------------------------------- TITLE: Navigating cesium-native Files for Debugging DESCRIPTION: Methods to access and debug files within the cesium-native library from the Cesium for Unreal Visual Studio solution. This includes using Solution Explorer's Folder View or copying file paths. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-windows.md#_snippet_13 LANGUAGE: APIDOC CODE: ``` Method 1: Solution Explorer Folder View 1. Switch Solution Explorer to Folder View. 2. Turn on "Show All Files". 3. Navigate to `Plugins\cesium-unreal\extern\cesium-native`. 4. To return to default view: double-click the .sln file in Folder View. Method 2: Copy File Path 1. Open cesium-native files in a separate Visual Studio instance with the cesium-native solution. 2. Right-click on the file's tab and choose "Copy Full Path". 3. In the Cesium for Unreal solution, go to `File` -> `Open` -> `File`. 4. Paste the copied file path and open the file. ``` -------------------------------- TITLE: Troubleshooting: Explicitly Install Specific MSVC Build Tools DESCRIPTION: When CMake consistently defaults to an older compiler version despite attempts to specify a newer one, it might be because the specific newer version's build tools are not explicitly installed. This involves modifying the Visual Studio installation to include the desired MSVC build tools version (e.g., 'MSVC v143 - VS2022 C++ x64/x86 build tools (Latest)'). SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-windows-gotchas.md#_snippet_6 LANGUAGE: text CODE: ``` Modify Visual Studio Installation: 1. Go to "Add / Remove Programs". 2. Find "Visual Studio Professional 2022" and click "Modify". 3. In the "Individual Components" tab, ensure the specific MSVC build tools version you need (e.g., 'MSVC v143 - VS2022 C++ x64/x86 build tools (Latest)') is checked. ``` -------------------------------- TITLE: Build Release Code in Visual Studio DESCRIPTION: Instructions for building the Unreal project's C++ code in release mode with debug symbols. This is crucial for performance profiling as it mirrors the typical game packaging configuration. Assumes prior successful build and familiarity with developer setup. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/performance-profiling-setup-test.md#_snippet_1 LANGUAGE: visual-studio CODE: ``` 1. If building the cesium-native library, make sure you are using a release configuration derived from "RelWithDebInfo" 2. Open your Unreal project's Visual Studio solution (.sln). 3. Choose "Development Editor" 4. From the menu, choose Build -> Build Solution ``` -------------------------------- TITLE: Metadata Picking with Blueprint DESCRIPTION: Demonstrates how to pick features and retrieve metadata using Cesium for Unreal's Blueprint library. It involves tracing a line into the scene, getting hit component and face index, and then querying metadata values. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/Pages/upgrade-to-2.0-guide.md#_snippet_20 LANGUAGE: Blueprint CODE: ``` Line Trace By Channel -> Get Hit Component, Get Face Index -> Get Metadata Values For Face (or Get Metadata Values For Face As Strings) ``` -------------------------------- TITLE: CMake Project Setup and UE Root Configuration DESCRIPTION: Initializes the CMake project, sets the project version, and configures the Unreal Engine root directory. It attempts to locate the UE installation automatically or via environment variables, providing error messages if not found. This is crucial for integrating Cesium with an Unreal Engine build. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/extern/CMakeLists.txt#_snippet_0 LANGUAGE: cmake CODE: ``` cmake_minimum_required(VERSION 3.15) project( cesium-unreal-extern VERSION 0.1.0 LANGUAGES CXX C ) if (DEFINED ENV{UNREAL_ENGINE_ROOT} AND NOT UNREAL_ENGINE_ROOT) set(UNREAL_ENGINE_ROOT "$ENV{UNREAL_ENGINE_ROOT}") endif() if (NOT UNREAL_ENGINE_ROOT) # On Windows and Mac, try to use the default UE 5.4 location if (WIN32) set(DEFAULT_UNREAL_INSTALLATION "C:/Program Files/Epic Games/UE_5.4") elseif(APPLE) set(DEFAULT_UNREAL_INSTALLATION "/Users/Shared/Epic Games/UE_5.4") endif() if (NOT EXISTS "${DEFAULT_UNREAL_INSTALLATION}") message(FATAL_ERROR "Please specify the root of your Unreal Engine installation, either by setting the UNREAL_ENGINE_ROOT environment variable or with -DUNREAL_ENGINE_ROOT=path on the cmake command-line.") else() set(UNREAL_ENGINE_ROOT "${DEFAULT_UNREAL_INSTALLATION}") endif() endif() message(STATUS "Using Unreal Engine installation at: ${UNREAL_ENGINE_ROOT}") # Set the UE environment variable so it's inherited by vcpkg builds. set(ENV{UNREAL_ENGINE_ROOT} "${UNREAL_ENGINE_ROOT}") ``` -------------------------------- TITLE: Example C++ Code Analysis DESCRIPTION: An example of interpreting profiling results for C++ code, highlighting functions like `stbir_resample_horizontal_downsample` and `CesiumTextureUtility::loadTextureAnyThreadPart` as potential areas for optimization. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/performance-profiling-with-cpu-usage.md#_snippet_3 LANGUAGE: cpp CODE: ``` // Example interpretation of profiling data: // - 20% of sampled CPU time spent in CesiumTextureUtility::loadTextureAnyThreadPart (texture loading). // - stbir_XXX functions are candidates for optimization. // - stbir_resample_horizontal_downsample is the highest cost single function, but consider sampling limits. ``` -------------------------------- TITLE: Configure Source Code Editor in Unreal Engine DESCRIPTION: Instructions on how to set the default C++ compiler toolchain in Unreal Engine's Editor Preferences to ensure compatibility, especially when multiple Visual Studio versions are installed. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-windows.md#_snippet_10 LANGUAGE: unrealscript CODE: ``` Edit -> Editor Preferences General -> Source Code Change Source Code Editor to Visual Studio 2019 Click "Set as Default" ``` -------------------------------- TITLE: Build Cesium for Unreal for iOS DESCRIPTION: Configures and builds the Cesium for Unreal project for iOS using CMake and Xcode toolchain, supporting Release, Debug, and RelWithDebInfo build types. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-osx.md#_snippet_8 LANGUAGE: bash CODE: ``` export UNREAL_ENGINE_ROOT='/Users/Shared/Epic Games/UE_5.4' cd ~/dev/cesium-unreal-samples/Plugins/cesium-unreal/extern cmake -B build-ios -S . -GXcode -DCMAKE_TOOLCHAIN_FILE="unreal-ios-toolchain.cmake" -DCMAKE_BUILD_TYPE=Release cmake --build build-ios --target install --config Release --parallel 14 ``` -------------------------------- TITLE: Clone Cesium for Unreal Repositories DESCRIPTION: Clones the Cesium for Unreal samples and the Cesium for Unreal plugin itself, including its native dependencies. Ensures the plugin is placed correctly within the project structure for automatic detection by Unreal Engine. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-osx.md#_snippet_0 LANGUAGE: bash CODE: ``` git clone https://github.com/CesiumGS/cesium-unreal-samples.git cd cesium-unreal-samples mkdir Plugins cd Plugins git clone --recursive https://github.com/CesiumGS/cesium-unreal.git ``` -------------------------------- TITLE: UFUNCTION Specifiers Example DESCRIPTION: Illustrates the use of UFUNCTION specifiers for a BlueprintPure function that transforms position data. It highlights BlueprintPure, Category, and meta specifiers like ReturnDisplayName for controlling Blueprint node behavior. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/Pages/api-design-guide.md#_snippet_2 LANGUAGE: cpp CODE: ``` UFUNCTION( BlueprintPure, Category = "Cesium", meta = (ReturnDisplayName = "UnrealPosition")) FVector TransformLongitudeLatitudeHeightPositionToUnreal( const FVector& LongitudeLatitudeHeight) const; ``` -------------------------------- TITLE: Defining a New Custom Version Enum Value DESCRIPTION: Provides an example of adding a new version to the `Versions` enum in `CesiumCustomVersion.h` to handle property changes, specifically replacing a boolean with an enum. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/Pages/api-design-guide.md#_snippet_19 LANGUAGE: cpp CODE: ``` enum Versions { // Other versions omitted. // (...) // Replaced the UseWebMercatorProjection property in // CesiumWebMapTileServiceOverlay with the enum Projection property. WebMapTileServiceProjectionAsEnum = 8, VersionPlusOne, LatestVersion = VersionPlusOne - 1 } ``` -------------------------------- TITLE: Configure Cesium Native for Visual Studio (CMake CLI) DESCRIPTION: Configures the Cesium Native project for Visual Studio 2022 using the CMake command-line interface. This prepares the project for building within Visual Studio. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-windows.md#_snippet_5 LANGUAGE: bash CODE: ``` cmake -B build -S . -G "Visual Studio 17 2022" -A x64 ``` -------------------------------- TITLE: Blueprint Naming and Parameter Order DESCRIPTION: Guidelines for aligning Blueprint API design with Unreal Engine conventions and prioritizing parameters for clarity. Demonstrates parameter ordering in C++ and its reflection in Blueprints. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/Pages/api-design-guide.md#_snippet_14 LANGUAGE: cpp CODE: ``` TMap GetPropertyTableValuesFromHit( const FHitResult& Hit, int64 FeatureIDSetIndex = 0); // In Blueprints, 'Hit' would appear first, followed by 'FeatureIDSetIndex'. ``` -------------------------------- TITLE: Cesium Unreal UFUNCTION Specifiers DESCRIPTION: Details the UFUNCTION specifiers used in Cesium for Unreal, explaining how they control function behavior in Blueprints and the editor. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/Pages/api-design-guide.md#_snippet_9 LANGUAGE: APIDOC CODE: ``` BlueprintCallable: - Function can be executed in a Blueprint or Level Blueprint graph. - Use for functions requiring sequential node execution. - Generates an execution pin. BlueprintPure: - Function can be executed in a Blueprint or Level Blueprint graph without an execution pin. - Use for functions whose execution doesn't require explicit sequencing and doesn't affect the owning object. BlueprintGetter: - Function can be used as a BlueprintGetter for a UPROPERTY. BlueprintSetter: - Function can be used as a BlueprintSetter for a UPROPERTY. BlueprintNativeEvent: - For functions designed to be overridden by a Blueprint, with a default native implementation. - Implementation function must be named `[OriginalFunctionName]_Implementation`. - Use for Blueprint-like virtual function behavior. meta = (ReturnDisplayName = ""): - Function output on the Blueprint node will be labeled with the specified name. - Use for visual clarity of function outputs. ``` -------------------------------- TITLE: Update Git Submodules DESCRIPTION: Updates and initializes git submodules for an existing clone of the Cesium for Unreal repository. This command is used if the `--recursive` flag was not initially used during cloning. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-linux.md#_snippet_2 LANGUAGE: bash CODE: ``` git submodule update --init --recursive ``` -------------------------------- TITLE: UObject Design Principles DESCRIPTION: Details the core concepts and best practices for designing UObjects within the Cesium for Unreal plugin, aligning with Unreal Engine's object-oriented system. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/Pages/api-design-guide.md#_snippet_0 LANGUAGE: APIDOC CODE: ``` UObject Design: - Base class for gameplay objects in Unreal Engine. - Most Cesium for Unreal plugin classes inherit from UObject. - Exposes functionality to Unreal Engine systems. UObject Creation: - UObjects may only use default constructors (no arguments). - Initialization should be handled in methods like BeginPlay, OnConstruction, PostLoad, Serialize, etc., as BeginPlay is not always called (e.g., in the Editor). - UObjects are garbage collected when no longer referenced; be mindful of strong references (UProperties, class instances, TStrongObjectPtr). - Regular pointers to UObjects become invalid after garbage collection, leading to undefined behavior upon dereferencing. Properties (UPROPERTY): - Declared in C++ and exposed to Unreal Engine using the UPROPERTY macro. - Enables accessibility through Blueprints, Editor UI, event handlers, and delegates. Functions (UFUNCTION): - Exposed to Blueprints or the Editor interface using the UFUNCTION macro. Structs (USTRUCT): - Do not inherit from UObject and are not managed by Garbage Collection. - Can contain UProperties. - UObjects can have USTRUCT type properties. - Exposed to Blueprints via specifiers: - BlueprintType: Enables the 'Make' node. - BlueprintReadOnly/BlueprintReadWrite: Required for properties to appear in the 'Break' node. Enums (UENUM): - Used for enum classes in UObject contexts (e.g., UPROPERTY, Blueprints). - Should be used on enum class of uint8; typically does not work on pure enums. Example Enum: ```cpp UENUM() enum class EMyEnum : uint8 { ... }; ``` ``` -------------------------------- TITLE: Unreal Editor Setup for Profiling DESCRIPTION: Steps to prepare the Unreal Editor for performance profiling using Unreal Insights. This involves debugging the project and accessing the Test Automation window to select a specific test case. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/performance-profiling-with-unreal-insights.md#_snippet_0 LANGUAGE: APIDOC CODE: ``` 1. In Visual Studio, click Debug -> Start Debugging (F5) 2. In Unreal, click Tools->Test Automation 3. Check the Cesium.Performance.LoadTestDenver row (don't start the test yet) ``` -------------------------------- TITLE: Configure and Generate Project (CMake GUI) DESCRIPTION: Generates Visual Studio project files for Cesium Native using the CMake GUI. This involves specifying source and build directories, configuring, and generating. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-windows.md#_snippet_4 LANGUAGE: cmake CODE: ``` Start cmake-gui In the "Where is the source code" text field, enter C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\extern In the "Where to build the binaries" text field, enter C:\Dev\cesium-unreal-samples\Plugins\cesium-unreal\extern\build Press "Configure" Press "Generate" ``` -------------------------------- TITLE: UPROPERTY Blueprint Specifiers DESCRIPTION: Provides a quick reference for UPROPERTY specifiers commonly used in Cesium for Unreal development to control property accessibility and behavior in Blueprints. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/Pages/api-design-guide.md#_snippet_8 LANGUAGE: APIDOC CODE: ``` UPROPERTY Specifiers for Blueprints: BlueprintReadOnly: Description: Property is accessible in Blueprints but read-only. When to Use: Self-explanatory. BlueprintReadWrite: Description: Property is editable from Blueprints. When to Use: When the "set" logic is simple enough that nothing additional must happen after the property is set. If additional logic is required, use BlueprintSetter instead. BlueprintGetter=[FunctionName]: Description: Property uses the specified function to get the value. When to Use: Whenever you have to use BlueprintSetter. BlueprintSetter=[FunctionName]: Description: Property uses the specified function to set the value. When to Use: Whenever you have to do additional work after setting a property, e.g., recomputing the object's internal state. BlueprintAssignable: Description: For delegate or event properties, allows the property to be assigned in Blueprints. When to Use: Self-explanatory. ``` -------------------------------- TITLE: Configure vcpkg Triplet for Specific Compiler Version DESCRIPTION: This snippet shows how to modify a vcpkg triplet file to explicitly set the VCPKG_PLATFORM_TOOLSET_VERSION. This is necessary because vcpkg's default behavior is to select the latest installed compiler, which can lead to linker errors if dependencies are built with different versions. Ensure this change is not committed to version control. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-windows-gotchas.md#_snippet_2 LANGUAGE: cmake CODE: ``` set(VCPKG_PLATFORM_TOOLSET_VERSION "14.38") ``` -------------------------------- TITLE: Feature ID Sets from Attribute DESCRIPTION: Example of material nodes generated for an attribute-based feature ID set in Cesium for Unreal. This demonstrates how to retrieve feature IDs from an attribute within the material editor. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/Pages/upgrade-to-2.0-guide.md#_snippet_25 LANGUAGE: Unreal Engine Material CODE: ``` Image: Images/materialGetFeatureIdsFromAttribute.jpeg ``` -------------------------------- TITLE: Deprecating a Function with DeprecationMessage DESCRIPTION: Demonstrates how to deprecate a UFUNCTION using the DeprecatedFunction meta tag and provide a deprecation message that suggests a replacement. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/Pages/api-design-guide.md#_snippet_16 LANGUAGE: cpp CODE: ``` UFUNCTION( Meta = (DeprecatedFunction, DeprecationMessage = "CesiumMetadataPrimitive is deprecated. Get the associated property texture indices from CesiumPrimitiveMetadata instead.")) static const TArray GetFeatureTextureNames(UPARAM(ref) const FCesiumMetadataPrimitive& MetadataPrimitive); ``` -------------------------------- TITLE: UPROPERTY Specifiers DESCRIPTION: Details the common UPROPERTY specifiers in Unreal Engine and their usage within Cesium for Unreal. Covers categories, serialization, and Blueprint accessibility. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/Pages/api-design-guide.md#_snippet_12 LANGUAGE: APIDOC CODE: ``` UPROPERTY Specifiers: Category = "" - Assigns the property to a specific category in the Details panel. - Required for all public UPROPERTYs. Transient - Prevents the property from being serialized when the UObject is saved. - Use for temporary runtime references. meta = (AllowPrivateAccess) - Allows private C++ properties to be accessed in Blueprints. - Use according to Change Detection practices. meta = (DeprecatedProperty) - Marks the property as deprecated. - Refer to Deprecation and Backwards Compatibility guidelines. ``` -------------------------------- TITLE: Core Redirects for API Changes DESCRIPTION: Explains the use of Core Redirects in `Config/Engine.ini` to maintain backward compatibility when renaming classes, functions, properties, or enums. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/Pages/api-design-guide.md#_snippet_15 LANGUAGE: APIDOC CODE: ``` Core Redirects Configuration: Location: Config/Engine.ini Purpose: To link old API names (classes, functions, properties, enums) to their new names, preserving Blueprint scripts. Format: Each redirect must be on a single line. Example (Conceptual): [CoreRedirects] OldClassName=/Script/MyModule.NewClassName OldFunctionName=/Script/MyModule.MyFunction/NewFunction OldPropertyName=/Script/MyModule.MyObject.OldProp/NewProp ``` -------------------------------- TITLE: Cesium Unreal CallInEditor UFUNCTION DESCRIPTION: Details the `CallInEditor` UFUNCTION specifier, which allows functions to be executed via a button in the Details panel. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/Pages/api-design-guide.md#_snippet_11 LANGUAGE: APIDOC CODE: ``` CallInEditor: - Function can be executed using a button in the Details panel. - Use for helpful in-editor functionality (e.g., `RefreshTileset`). - The function must have no parameters and no return value. ``` -------------------------------- TITLE: UFUNCTION Specifiers DESCRIPTION: Details the UFUNCTION specifiers, specifically focusing on deprecation. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/Pages/api-design-guide.md#_snippet_13 LANGUAGE: APIDOC CODE: ``` UFUNCTION Specifiers: meta = (DeprecatedFunction) - Marks the function as deprecated. - Refer to Deprecation and Backwards Compatibility guidelines. ``` -------------------------------- TITLE: Build Cesium for Unreal Plugin (Linux) DESCRIPTION: Builds the Cesium for Unreal plugin using Unreal Automation Tool (UAT) on Linux. This command requires the Unreal Engine directory and the Cesium for Unreal plugin directory to be set up correctly. It compiles the plugin and packages it for the Linux platform. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-linux.md#_snippet_7 LANGUAGE: bash CODE: ``` export CESIUM_FOR_UNREAL_DIR=~/dev/cesium-unreal cd $UNREAL_ENGINE_DIR/Engine/Build/BatchFiles ./RunUAT.sh BuildPlugin -Plugin="$CESIUM_FOR_UNREAL_DIR/CesiumForUnreal.uplugin" -Package="$CESIUM_FOR_UNREAL_DIR/../packages/CesiumForUnreal" -CreateSubFolder -TargetPlatforms=Linux ``` -------------------------------- TITLE: Accessing AppData Environment Variable in PowerShell DESCRIPTION: Demonstrates how to access the `%AppData%` environment variable in PowerShell, which is used to locate the Unreal Build Tool configuration file. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-windows-gotchas.md#_snippet_1 LANGUAGE: powershell CODE: ``` $env:AppData ``` -------------------------------- TITLE: Blueprint Library Additions DESCRIPTION: Highlights new functions added to the Blueprint libraries for more accurate feature ID retrieval and property texture value extraction from line trace hits. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/Pages/upgrade-to-2.0-guide.md#_snippet_22 LANGUAGE: Blueprint CODE: ``` UCesiumPrimitiveFeaturesBlueprintLibrary::GetFeatureIDFromHit UCesiumPropertyTextureBlueprintLibrary::GetMetadataValuesFromHit ``` -------------------------------- TITLE: Visual Studio Debugging Options DESCRIPTION: Configuration steps within Visual Studio to enable debugging through external native code. This involves disabling the 'Just my Code' option to allow stepping into libraries like cesium-native. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-windows.md#_snippet_12 LANGUAGE: APIDOC CODE: ``` Tools -> Options Debugging -> General Enable Just My Code: Unchecked ``` -------------------------------- TITLE: CPU Usage Tool Capture Session DESCRIPTION: Instructions for running a CPU usage capture session within Visual Studio. This involves starting the debugging session, running performance tests, and initiating the CPU profile recording. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/performance-profiling-with-cpu-usage.md#_snippet_1 LANGUAGE: visualstudio CODE: ``` 1. From Visual Studio, start your debugging session (Debug->Start Debugging, F5) 2. Find the performance tests in Unreal. Tools->Test Automation 3. Check "LoadTestDenver" 4. Click "Start Tests" 5. Your first break point should hit in Visual Studio 6. Go back to the Diagnostic Tools window, click on "Record CPU Profile". It should turn red. 7. Continue the debugging session (Debug->Continue, F5) 8. Your second break point should hit 9. Go back to the Diagnostic Tools window, you should now see a report ``` -------------------------------- TITLE: Set Android NDK Root Environment Variable DESCRIPTION: Sets the ANDROID_NDK_ROOT environment variable, which is required for cross-compiling Android projects. Ensure you use forward slashes in the path. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/developer-setup-windows.md#_snippet_0 LANGUAGE: windows-cmd CODE: ``` SET ANDROID_NDK_ROOT= ``` -------------------------------- TITLE: Material Generation Pseudocode DESCRIPTION: This pseudocode illustrates the logic for generating material nodes based on property values, 'no data' conditions, and default values in Cesium for Unreal. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/Pages/upgrade-to-2.0-guide.md#_snippet_33 LANGUAGE: pseudocode CODE: ``` if (propertyHasValue) { if (rawValue == noDataValue) { return defaultValue; } transformedValue = rawValue * scale + offset; return transformedValue; } else { return defaultValue; } ``` -------------------------------- TITLE: Feature ID Status Checks DESCRIPTION: Introduces ECesiumFeatureIdAttributeStatus and ECesiumFeatureIdTextureStatus enums to indicate invalid feature ID sets. These statuses can be queried using 'Get Feature ID Attribute Status' and 'Get Feature ID Texture Status' Blueprint nodes for debugging and validation. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/Pages/upgrade-to-2.0-guide.md#_snippet_3 LANGUAGE: Blueprint CODE: ``` Get Feature ID Attribute Status Get Feature ID Texture Status ``` -------------------------------- TITLE: Feature ID Sets from Implicit DESCRIPTION: Example of material nodes generated for an implicit feature ID set in Cesium for Unreal. Implicit feature IDs are passed as attributes to the material, as vertex indices cannot be directly retrieved. SOURCE: https://github.com/cesiumgs/cesium-unreal/blob/main/Documentation/Pages/upgrade-to-2.0-guide.md#_snippet_27 LANGUAGE: Unreal Engine Material CODE: ``` Image: Images/materialGetFeatureIdsFromImplicit.jpeg ```