### Build godot-cpp Test Plugin Source: https://terrain3d.readthedocs.io/en/stable/_sources/docs/building_from_source.md.txt Compile the example plugin located in the godot-cpp test directory to verify your godot-cpp setup. ```bash scons ``` -------------------------------- ### Scons Build Error Example Source: https://terrain3d.readthedocs.io/en/stable/_sources/docs/building_from_source.md.txt This error indicates that the 'godot-cpp' directory is likely empty and needs to be updated. ```bash Terrain3D$ scons scons: Reading SConscript files ... scons: warning: Calling missing SConscript without error is deprecated. Transition by adding must_exist=False to SConscript calls. Missing SConscript 'godot-cpp\SConstruct' File "C:\gd\Terrain3D\SConstruct", line 6, in AttributeError: 'NoneType' object has no attribute 'Append': File "C:\gd\Terrain3D\SConstruct", line 9: env.Append(CPPPATH=["src/"]) ``` -------------------------------- ### Encode/Decode Formula Example Source: https://terrain3d.readthedocs.io/en/stable/_sources/docs/controlmap_format.md.txt Illustrates the use of unsigned integer literals in encode/decode formulas, particularly when working with C++ or GLSL. ```glsl x >> 14u & 0xFFu ``` -------------------------------- ### Name Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3dmeshasset.html Sets and gets the user-specified name for this asset. ```APIDOC ## set_name ### Description Sets the user-specified name for this asset. ### Method void ### Parameters * **value** (String) - The name for the asset. ## get_name ### Description Gets the user-specified name for this asset. ### Method String ### Returns The name of the asset. ``` -------------------------------- ### Material Overlay Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3dmeshasset.html Sets and gets a material overlay for the mesh. This overlay is applied using `next_pass` and overlays the base material. ```APIDOC ## set_material_overlay ### Description Sets a material overlay for the mesh. ### Method void ### Parameters * **value** (Material) - The material to use as an overlay. ## get_material_overlay ### Description Gets the material overlay applied to the mesh. ### Method Material ### Returns The material overlay. ``` -------------------------------- ### Enable Terrain3D Debugging via Command Line Source: https://terrain3d.readthedocs.io/en/stable/docs/troubleshooting.html Run Godot with a specific debug level for Terrain3D to get detailed logs. This is useful for diagnosing issues when the game or editor is running. ```bash # To run the demo with debug messages cd /c/gd/Terrain3D/project /c/gd/bin/Godot_v4.1.3-stable_win64.exe --terrain3d-debug=DEBUG # To run the editor with debug messages /c/gd/bin/Godot_v4.1.3-stable_win64.exe -e --terrain3d-debug=DEBUG ``` -------------------------------- ### Error Loading Addon Script Source: https://terrain3d.readthedocs.io/en/stable/docs/troubleshooting.html This error message indicates an improper plugin installation. Ensure the plugin files are in the correct directory (`project/addons/terrain_3d/`) and that binary library files are present. ```text Unable to load addon script from path: xxxxxxxxxxx. This might be due to a code error in that script. Disabling the addon at 'res://addons/terrain_3d/plugin.cfg' to prevent further errors. ``` -------------------------------- ### Navigate and Initialize Submodules Source: https://terrain3d.readthedocs.io/en/stable/_sources/docs/building_from_source.md.txt After cloning, navigate into the project directory and initialize/update the Git submodules, including godot-cpp. ```bash cd Terrain3D Terrain3D$ git submodule init Submodule 'godot-cpp' (https://github.com/godotengine/godot-cpp.git) registered for path 'godot-cpp' Terrain3D$ git submodule update Cloning into 'C:/GD/Terrain3D/godot-cpp'... Submodule path 'godot-cpp': checked out '9d1c396c54fc3bdfcc7da4f3abcb52b14f6cce8f' ``` -------------------------------- ### Run Demo with Debugging Source: https://terrain3d.readthedocs.io/en/stable/_sources/docs/troubleshooting.md.txt Execute the Terrain3D demo with DEBUG level logging enabled from the command line. Adjust file paths as necessary for your system. ```bash # To run the demo with debug messages cd /c/gd/Terrain3D/project /c/gd/bin/Godot_v4.1.3-stable_win64.exe --terrain3d-debug=DEBUG ``` -------------------------------- ### Get Terrain3D Camera Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3d.html Retrieves the Camera3D that the terrain is currently set to snap to. ```gdscript var camera = terrain.get_camera() ``` -------------------------------- ### Instantiate and Configure Terrain3D (C#) Source: https://terrain3d.readthedocs.io/en/stable/_sources/docs/programming_languages.md.txt Instantiate Terrain3D and Terrain3DAssets via ClassDB, set the 'assets' property, and call a method to show the region grid. ```csharp var terrain = ClassDB.Instantiate("Terrain3D"); terrain.AsGodotObject().Set("assets", ClassDB.Instantiate("Terrain3DAssets")); terrain.AsGodotObject().Call("set_show_region_grid", true); ``` -------------------------------- ### Detect Terrain3D Installation (GDScript) Source: https://terrain3d.readthedocs.io/en/stable/_sources/docs/programming_languages.md.txt Check if the Terrain3D plugin is enabled in the editor using EditorInterface.is_plugin_enabled. ```gdscript print("Terrain3D installed: ", EditorInterface.is_plugin_enabled("terrain_3d")) ``` -------------------------------- ### Get Terrain3D Editor Instance Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3d.html Returns the current Terrain3DEditor instance if it has been set. This is useful for editor-specific functionalities. ```gdscript var editor = terrain.get_editor() ``` -------------------------------- ### Initialize and Update Git Submodules Source: https://terrain3d.readthedocs.io/en/stable/docs/building_from_source.html Navigate into the cloned repository and initialize/update the git submodules, specifically godot-cpp. ```bash cd Terrain3D Terrain3D$ git submodule init Submodule 'godot-cpp' (https://github.com/godotengine/godot-cpp.git) registered for path 'godot-cpp' Terrain3D$ git submodule update Cloning into 'C:/GD/Terrain3D/godot-cpp'... Submodule path 'godot-cpp': checked out '9d1c396c54fc3bdfcc7da4f3abcb52b14f6cce8f' ``` -------------------------------- ### Material Override Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3dmeshasset.html Sets and gets a material override for the mesh. This replaces the rendered mesh material entirely. ```APIDOC ## set_material_override ### Description Sets a material override for the mesh. ### Method void ### Parameters * **value** (Material) - The material to use as an override. ## get_material_override ### Description Gets the material override applied to the mesh. ### Method Material ### Returns The material override. ``` -------------------------------- ### Instantiate Terrain3D and Assets (GDScript) Source: https://terrain3d.readthedocs.io/en/stable/_sources/docs/programming_languages.md.txt Create new instances of Terrain3D and Terrain3DAssets, then print the Terrain3D version. ```gdscript var terrain: Terrain3D = Terrain3D.new() terrain.assets = Terrain3DAssets.new() print(terrain.get_version()) ``` -------------------------------- ### start_operation Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3deditor.html Begins a sculpting or painting operation, preparing the system to create an undo/redo commit. ```APIDOC ## start_operation ### Description Begin a sculpting or painting operation. Prepares to create an undo/redo commit. ### Method void ### Parameters #### Request Body - **position** (Vector3) - Required - The starting position of the operation. ``` -------------------------------- ### Detect Terrain3D Installation (C#) Source: https://terrain3d.readthedocs.io/en/stable/_sources/docs/programming_languages.md.txt Determine if the Terrain3D plugin is active in the editor using GetEditorInterface().IsPluginEnabled. ```csharp GetEditorInterface().IsPluginEnabled("terrain_3d") ``` -------------------------------- ### View SCons Build Options Source: https://terrain3d.readthedocs.io/en/stable/_sources/docs/building_from_source.md.txt Display all available custom build options for the Terrain3D extension by running `scons --help`. To see general scons application options, use `scons -H`. ```bash # Godot custom build options scons --help # Scons application options scons -H ``` -------------------------------- ### show_grey Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3dmaterial.html Sets the albedo to 0.2 grey. ```APIDOC ## show_grey ### Description Albedo is set to 0.2 grey. ### Methods - `set_show_grey(value: bool)`: Sets the show_grey property. - `get_show_grey() -> bool`: Gets the current value of the show_grey property. ``` -------------------------------- ### Get Terrain3D Plugin Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3d.html Returns the EditorPlugin instance connected to Terrain3D. This is typically used within editor plugins. ```gdscript var plugin = terrain.get_plugin() ``` -------------------------------- ### Run Editor with Debugging Source: https://terrain3d.readthedocs.io/en/stable/_sources/docs/troubleshooting.md.txt Launch the Godot editor with DEBUG level logging for Terrain3D enabled via the command line. Ensure file paths are correct for your environment. ```bash # To run the editor with debug messages /c/gd/bin/Godot_v4.1.3-stable_win64.exe -e --terrain3d-debug=DEBUG ``` -------------------------------- ### Get Last Snapped Position Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3d.html Retrieves the last position the terrain was centered on. This is useful for maintaining context or resuming operations. ```gdscript var snapped_pos = terrain.get_snapped_position() ``` -------------------------------- ### Specify Target Platform for Build Source: https://terrain3d.readthedocs.io/en/stable/_sources/docs/building_from_source.md.txt Manually set the target platform for the build using the `platform` argument with `scons`. Supported platforms include linux, macos, windows, android, ios, and javascript. ```bash # platform: Target platform (linux|macos|windows|android|ios|javascript) scons platform=linux ``` -------------------------------- ### Check Node Type and Get Collision Mode (C#) Source: https://terrain3d.readthedocs.io/en/stable/_sources/docs/programming_languages.md.txt Verify if a Node is a 'Terrain3D' class and retrieve its collision mode. ```csharp private bool CheckTerrain3D(Node myNode) { if (myNode.IsClass("Terrain3D")) { var collisionMode = myNode.Call("get_collision_mode").AsInt32(); ``` -------------------------------- ### Specify Target Platform Source: https://terrain3d.readthedocs.io/en/stable/docs/building_from_source.html Build the extension for a specific platform by setting the `platform` argument in the `scons` command. Supported platforms include linux, macos, windows, android, ios, and javascript. ```bash # platform: Target platform (linux|macos|windows|android|ios|javascript) scons platform=linux ``` -------------------------------- ### LOD9 Range Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3dmeshasset.html Sets and gets the end visible range for LOD9. This property controls the maximum distance at which LOD9 details are rendered. ```APIDOC ## set_lod9_range ### Description Sets the end visible range for LOD9. ### Method void ### Parameters * **value** (float) - The end visible range for LOD9. ## get_lod9_range ### Description Gets the end visible range for LOD9. ### Method float ### Returns The end visible range for LOD9. ``` -------------------------------- ### save Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3dassets.html Saves the texture list resource to disk. ```APIDOC ## save ### Description Saves this texture list resource to disk, if saved as an external `.tres` or `.res` resource file. ### Method Error ### Parameters * **path** (String) - Optional - Specifies a directory and file name to use from now on. Defaults to an empty string. ``` -------------------------------- ### LOD8 Range Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3dmeshasset.html Sets and gets the end visible range for LOD8. This property controls the maximum distance at which LOD8 details are rendered. ```APIDOC ## set_lod8_range ### Description Sets the end visible range for LOD8. ### Method void ### Parameters * **value** (float) - The end visible range for LOD8. ## get_lod8_range ### Description Gets the end visible range for LOD8. ### Method float ### Returns The end visible range for LOD8. ``` -------------------------------- ### show_instancer_grid Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3dmaterial.html Overlays the instancer grid on the terrain. ```APIDOC ## show_instancer_grid ### Description Overlays the 32x32m instancer grid on the terrain, which shows how the instancer data is partitioned. Press 2 with the mouse in the viewport to toggle. ### Methods - `set_show_instancer_grid(value: bool)`: Sets the show_instancer_grid property. - `get_show_instancer_grid() -> bool`: Gets the current value of the show_instancer_grid property. ``` -------------------------------- ### LOD7 Range Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3dmeshasset.html Sets and gets the end visible range for LOD7. This property controls the maximum distance at which LOD7 details are rendered. ```APIDOC ## set_lod7_range ### Description Sets the end visible range for LOD7. ### Method void ### Parameters * **value** (float) - The end visible range for LOD7. ## get_lod7_range ### Description Gets the end visible range for LOD7. ### Method float ### Returns The end visible range for LOD7. ``` -------------------------------- ### LOD6 Range Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3dmeshasset.html Sets and gets the end visible range for LOD6. This property controls the maximum distance at which LOD6 details are rendered. ```APIDOC ## set_lod6_range ### Description Sets the end visible range for LOD6. ### Method void ### Parameters * **value** (float) - The end visible range for LOD6. ## get_lod6_range ### Description Gets the end visible range for LOD6. ### Method float ### Returns The end visible range for LOD6. ``` -------------------------------- ### create_mesh_thumbnails Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3dassets.html Generates preview thumbnails for mesh assets, stored within each mesh asset. ```APIDOC ## create_mesh_thumbnails ### Description Generates mesh asset preview thumbnails for the asset dock, stored within each mesh asset. ### Method void ### Parameters * **id** (int) - Optional - The ID of the mesh asset to generate a thumbnail for. Defaults to -1 to generate all. * **size** (Vector2i) - Optional - The desired size of the thumbnail. Defaults to Vector2i(128, 128). ``` -------------------------------- ### Retrieve Terrain Normal at a Position Source: https://terrain3d.readthedocs.io/en/stable/docs/collision.html After obtaining the height, use this to get the normal vector, which points perpendicular to the terrain face at the specified position. ```gdscript var normal: Vector3 = terrain.data.get_normal(global_position) ``` -------------------------------- ### Build iOS Library with SCons Source: https://terrain3d.readthedocs.io/en/stable/_sources/docs/platforms.md.txt Compile the iOS library for Terrain3D using SCons. Ensure you have the necessary build tools and Godot environment set up. ```bash scons platform=ios target=template_debug scons platform=ios target=template_release ``` -------------------------------- ### Build the Extension with SCons Source: https://terrain3d.readthedocs.io/en/stable/_sources/docs/building_from_source.md.txt Compile the Terrain3D extension using `scons`. By default, it builds the debug library. Use `target=template_release` to build the release version. ```bash Terrain3D/godot-cpp$ cd .. # To build the debug library Terrain3D$ scons ``` ```bash # To build both debug and release versions sequentially (bash command line) Terrain3D$ scons && scons target=template_release ``` -------------------------------- ### Get Terrain Height at a Position Source: https://terrain3d.readthedocs.io/en/stable/_sources/docs/collision.md.txt Efficiently retrieve the terrain height at a known X, Z position. Returns `NAN` for holes or areas outside defined regions. ```gdscript var height: float = terrain.data.get_height(global_position) ``` -------------------------------- ### save Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3dmaterial.html Saves the material resource to disk. ```APIDOC ## save ### Description Saves this material resource to disk, if saved as an external `.tres` or `.res` resource file. ### Method save ### Parameters #### Path Parameters - **path** (String) - Optional - Specifies a directory and file name to use for saving the material. Defaults to an empty string. ### Returns Error - An error code indicating the success or failure of the save operation. ``` -------------------------------- ### Apply Emissive Strength and Output Source: https://terrain3d.readthedocs.io/en/stable/_sources/docs/tips_technical.md.txt In the fragment function, after accumulating all material properties, normalize the emissive value and apply the emissive strength before outputting to the GPU. ```glsl // normalize accumulated values back to 0.0 - 1.0 range. float weight_inv = 1.0 / total_weight; mat.albedo_height *= weight_inv; ... mat.emissive *= weight_inv; EMISSION = mat.emissive * emissive_strength; ``` -------------------------------- ### Avoid Sub-Branches in GLSL Source: https://terrain3d.readthedocs.io/en/stable/_sources/docs/tips_technical.md.txt Replace nested if statements with a single conditional expression to potentially improve performance by avoiding expensive branches in GLSL shaders. This example shows how to conditionally assign a color. ```glsl uniform bool auto_shader; if (height > 256) { albedo = float(!auto_shader)*albedo + float(auto_shader)*snow_color; } ``` -------------------------------- ### Build Terrain3D Extension with Scons Source: https://terrain3d.readthedocs.io/en/stable/docs/building_from_source.html Use the `scons` command to build the Terrain3D extension. By default, it builds the debug library. Add `target=template_release` to build the release version. ```bash Terrain3D/godot-cpp$ cd .. # To build the debug library Terrain3D$ scons # To build both debug and release versions sequentially (bash command line) Terrain3D$ scons && scons target=template_release ``` -------------------------------- ### Apply Generated Height Map to Material Source: https://terrain3d.readthedocs.io/en/stable/docs/tips_technical.html Assign the generated height map of a Terrain3D mesh to the albedo texture slot of another material. Note that this example uses a regular sampler; for optimal results, use sampler2DArray in shaders. ```gdscript var mat: RID = $MeshInstance3D.mesh.surface_get_material(0).get_rid() RenderingServer.material_set_param(mat, "texture_albedo", get_data().get_height_maps_rid()) ``` -------------------------------- ### Instancing Terrain3DUtil Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3dutil.html Instantiate Terrain3DUtil to create a shorter alias for its static methods. This is useful for reducing verbosity when calling multiple utility functions. ```gdscript var util := Terrain3DUtil.new() var my_float: float = util.as_float(my_int) ``` -------------------------------- ### set_pixel Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3ddata.html Sets the pixel for the map type associated with the specified position. This method is fine for setting a few pixels, but if you wish to modify thousands of pixels quickly, you should get the region and use Terrain3DRegion.get_map(), then edit the images directly. After setting pixels you need to call update_maps(). ```APIDOC ## set_pixel ### Description Sets the pixel for the map type associated with the specified position. This method is fine for setting a few pixels, but if you wish to modify thousands of pixels quickly, you should get the region and use Terrain3DRegion.get_map(), then edit the images directly. After setting pixels you need to call update_maps(). You may also need to regenerate collision if you don’t have dynamic collision enabled. ### Parameters #### Path Parameters - **map_type** (`MapType`) - The type of map to set the pixel on. - **global_position** (`Vector3`) - The global position to set the pixel at. - **pixel** (`Color`) - The color value of the pixel to set. ``` -------------------------------- ### Clone Terrain3D Repository Source: https://terrain3d.readthedocs.io/en/stable/_sources/docs/building_from_source.md.txt Use this command to clone the Terrain3D project repository from GitHub. ```bash $ git clone git@github.com:TokisanGames/Terrain3D.git ``` -------------------------------- ### Get Terrain3D Intersection Point (GPU Mode) Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3d.html Casts a ray to find the intersection point with the terrain using GPU acceleration. This mode requires an editor render layer and may return a value one frame behind, requiring a second call. ```gdscript var target_point = terrain.get_intersection(camera_pos, camera_dir, true) await RenderingServer.frame_post_draw target_point = terrain.get_intersection(camera_pos, camera_dir, true) ``` -------------------------------- ### Checkout Specific Git Commit or Tag Source: https://terrain3d.readthedocs.io/en/stable/_sources/docs/building_from_source.md.txt After identifying the correct commit hash or tag, use `git checkout` to switch the godot-cpp submodule to that specific version. You can use the full commit hash or a partial one. ```bash Terrain3D$ cd godot-cpp Terrain3D/godot-cpp$ git checkout 9d1c396c54fc3bdfcc7da4f3abcb52b14f6cce8f ``` ```bash Terrain3D/godot-cpp$ git checkout godot-4.0.2-stable ``` -------------------------------- ### Fetch Latest Tags for godot-cpp Source: https://terrain3d.readthedocs.io/en/stable/_sources/docs/building_from_source.md.txt Update the local repository with the latest tags from the godot-cpp remote repository. ```bash Terrain3D/godot-cpp$ git fetch From https://github.com/godotengine/godot-cpp * [new tag] godot-4.0.1-stable -> godot-4.0.1-stable * [new tag] godot-4.0.2-stable -> godot-4.0.2-stable ``` -------------------------------- ### show_colormap Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3dmaterial.html Places the color map in the albedo channel. ```APIDOC ## show_colormap ### Description Places the color map in the albedo channel. ### Methods - `set_show_colormap(value: bool)`: Sets the show_colormap property. - `get_show_colormap() -> bool`: Gets the current value of the show_colormap property. ``` -------------------------------- ### Utility Methods Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3ddata.html Miscellaneous utility methods for terrain manipulation and querying. ```APIDOC ## change_region_size ### Description Changes the size of all terrain regions. ### Method change_region_size(region_size: `int`) ### Parameters - **region_size** (`int`) - The new size for the regions. ``` ```APIDOC ## do_for_regions ### Description Executes a callback function for all regions within a specified area. ### Method do_for_regions(area: `Rect2i`, callback: `Callable`) ### Parameters - **area** (`Rect2i`) - The rectangular area to process regions within. - **callback** (`Callable`) - The function to execute for each region. ``` ```APIDOC ## get_region_count ### Description Gets the total number of terrain regions. ### Method get_region_count() const ### Returns `int` - The number of regions. ``` ```APIDOC ## get_region_id ### Description Gets the ID of a region at a specific location. ### Method get_region_id(region_location: `Vector2i`) const ### Parameters - **region_location** (`Vector2i`) - The 2D integer coordinates of the region. ### Returns `int` - The ID of the region. ``` ```APIDOC ## get_region_idp ### Description Gets the ID of the region containing a specific global position. ### Method get_region_idp(global_position: `Vector3`) const ### Parameters - **global_position** (`Vector3`) - The global 3D position. ### Returns `int` - The ID of the region containing the position. ``` ```APIDOC ## get_region_location ### Description Gets the region location (coordinates) for a specific global position. ### Method get_region_location(global_position: `Vector3`) const ### Parameters - **global_position** (`Vector3`) - The global 3D position. ### Returns `Vector2i` - The 2D integer coordinates of the region containing the position. ``` ```APIDOC ## get_region_map ### Description Retrieves the region map data. ### Method get_region_map() const ### Returns `PackedInt32Array` - The packed integer array representing the region map. ``` ```APIDOC ## get_region_map_index ### Description Gets the index in the region map for a given region location. ### Method get_region_map_index(region_location: `Vector2i`) static ### Parameters - **region_location** (`Vector2i`) - The 2D integer coordinates of the region. ### Returns `int` - The index in the region map. ``` ```APIDOC ## is_in_slope ### Description Checks if a global position is within a specified slope range. ### Method is_in_slope(global_position: `Vector3`, slope_range: `Vector2`, invert: `bool` = false) const ### Parameters - **global_position** (`Vector3`) - The global 3D position to check. - **slope_range** (`Vector2`) - The range of slopes to check against. - **invert** (`bool`, optional) - Whether to invert the check. Defaults to false. ### Returns `bool` - True if the position is within the slope range, false otherwise. ``` -------------------------------- ### Build with Debug Symbols Source: https://terrain3d.readthedocs.io/en/stable/_sources/docs/building_from_source.md.txt Enable the creation of debug symbols during the build process by passing `dev_build=yes` to scons. ```bash scons dev_build=yes ``` -------------------------------- ### Bypass macOS Security Warnings Source: https://terrain3d.readthedocs.io/en/stable/docs/platforms.html Run these commands in the unzipped directory to resolve 'developer cannot be verified' errors on macOS. This removes quarantine attributes from the binaries. ```bash $ xattr -dr com.apple.quarantine addons/terrain_3d/bin/libterrain.macos.debug.framework/libterrain.macos.debug $ xattr -dr com.apple.quarantine addons/terrain_3d/bin/libterrain.macos.release.framework/libterrain.macos.release ``` -------------------------------- ### Scene File Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3dmeshasset.html Specifies and retrieves the PackedScene file (.tscn, .scn, .glb, .fbx, etc.) from which to load the mesh. ```APIDOC ## set_scene_file ### Description Specifies the PackedScene file to load the mesh from. ### Method void ### Parameters * **value** (PackedScene) - The PackedScene file to load. ## get_scene_file ### Description Retrieves the PackedScene file used to load the mesh. ### Method PackedScene ### Returns The PackedScene file. ``` -------------------------------- ### Terrain3DTextureAsset Methods Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3dtextureasset.html This snippet outlines the methods available for Terrain3DTextureAsset, including their return types and descriptions. ```APIDOC ## Terrain3DTextureAsset Methods ### clear() - **Return Type**: `void` - **Description**: Clears the texture files and settings. ``` -------------------------------- ### show_control_scale Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3dmaterial.html Displays the painted scale on the albedo channel. ```APIDOC ## show_control_scale ### Description Albedo shows the painted scale. Larger scales are more red, smaller scales are more blue. 0.5 middle grey is the default 100% scale. ### Methods - `set_show_control_scale(value: bool)`: Sets the show_control_scale property. - `get_show_control_scale() -> bool`: Gets the current value of the show_control_scale property. ``` -------------------------------- ### add_instances Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3dinstancer.html Adds mesh instances to the terrain at the specified global position using provided parameters. This method is recommended for general API instancing. ```APIDOC ## add_instances ### Description Adds mesh instances to the terrain at the specified global position using provided parameters. This method is recommended for general API instancing. ### Method void ### Signature add_instances(global_position: Vector3, params: Dictionary) ``` -------------------------------- ### Enable Back Lighting in Shader Source: https://terrain3d.readthedocs.io/en/stable/_sources/docs/tips_environment.md.txt Apply backlight to allow light from the front side to shine through back faces, preventing them from appearing dark. Adjust the `backlight` uniform for desired effect. ```glsl uniform vec3 backlight : source_color = vec3(.5, .5, .5); void fragment() { BACKLIGHT = backlight.rgb; } ``` -------------------------------- ### show_vertex_grid Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3dmaterial.html Toggles the overlay of the vertex grid on the terrain to visualize vertex positions. ```APIDOC ## show_vertex_grid ### Description Overlays the vertex grid on the terrain, showing where each vertex is. Press 3 with the mouse in the viewport to toggle. ### Properties - **show_vertex_grid** (bool) - Default: `false` ### Methods - void **set_show_vertex_grid**(value: `bool`) - `bool` **get_show_vertex_grid**() ``` -------------------------------- ### Check godot-cpp Version with Git Log Source: https://terrain3d.readthedocs.io/en/stable/docs/building_from_source.html View the git log within the godot-cpp submodule directory to identify the currently checked out version. ```bash Terrain3D/godot-cpp$ git log commit 631cd5fe37d4e6df6e5eb66eb4435feca12708cc (HEAD, tag: godot-4.1.3-stable, 4.1) ... ``` -------------------------------- ### Build iOS Library for Terrain3D Source: https://terrain3d.readthedocs.io/en/stable/docs/platforms.html Compile the iOS library for Terrain3D using scons. Ensure the binaries are placed correctly in your project as identified in terrain.gdextension. ```bash scons platform=ios target=template_debug scons platform=ios target=template_release ``` -------------------------------- ### show_navigation Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3dmaterial.html Controls the display of the area designated for navigation mesh generation. ```APIDOC ## show_navigation ### Description Displays the area designated for generating the navigation mesh. ### Properties - **show_navigation** (bool) - Default: `false` ### Methods - void **set_show_navigation**(value: `bool`) - `bool` **get_show_navigation**() ``` -------------------------------- ### Build Godot with Debug Symbols Source: https://terrain3d.readthedocs.io/en/stable/_sources/docs/building_from_source.md.txt Compile the Godot engine with debug symbols to enable full source code debugging. ```bash scons debug_symbols=true ``` -------------------------------- ### Clean Build Files Source: https://terrain3d.readthedocs.io/en/stable/docs/building_from_source.html Remove compiled build artifacts using `scons --clean` and manually deleting files from the output directory. Commands differ for Unix-like systems and Windows. ```bash # Linux, other Unix, Git bash on Windows scons --clean rm project/addons/terrain_3d/bin/* find . -iregex '.+\.\(a\|lib\|o\|obj\|os\)' -delete # Windows scons --clean del /q project\addons\terrain_3d\bin\*.* del /s /q *.a *.lib *.o *.obj *.os ``` -------------------------------- ### show_heightmap Source: https://terrain3d.readthedocs.io/en/stable/api/class_terrain3dmaterial.html Displays the heightmap on the albedo channel as a gradient. ```APIDOC ## show_heightmap ### Description Albedo is a white to black gradient depending on height. The gradient is scaled to a height of 300, so above that or far below 0 will be all white or black. ### Methods - `set_show_heightmap(value: bool)`: Sets the show_heightmap property. - `get_show_heightmap() -> bool`: Gets the current value of the show_heightmap property. ``` -------------------------------- ### Check Terrain3D Class Existence (C#) Source: https://terrain3d.readthedocs.io/en/stable/_sources/docs/programming_languages.md.txt Use ClassDB to check if the Terrain3D class is available and instantiable in C#. ```csharp ClassDB.ClassExists("Terrain3D"); ClassDB.CanInstantiate("Terrain3D"); ```