Maintainers
Pricing
Enterprise
More
More
Documentation
Try Live
Rankings
Install
Blog
Docs7
Ask
New
Add Docs
Godot Voxel
https://github.com/zylann/godot_voxel
Admin
Voxel module for Godot Engine
Tokens:
191,868
Snippets:
1,507
Trust Score:
9.3
License:
MIT
Update:
3 weeks ago
Context
Chat
Benchmark
79.81
Latest
Show doc for...
Code
Info
Show Results
Tokens:
Raw
Copy
Link
Tokens:
Raw
Copy
Link
### Install configuration and package files Source: https://github.com/zylann/godot_voxel/blob/master/thirdparty/fast_noise_2/CMakeLists.txt Sets up install directories and generates ConfigVersion.cmake and Config.cmake using CMakePackageConfigHelpers. Installs targets, headers, and config files to the appropriate locations. ```cmake #Install ----------------------------------------------------------- # Layout. This works for all platforms: # * <prefix>/lib*/cmake/<PROJECT-NAME> # * <prefix>/lib*/ # * <prefix>/include/ set(config_install_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated") # Configuration set(version_config "${generated_dir}/${PROJECT_NAME}ConfigVersion.cmake") set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake") set(targets_export_name "${PROJECT_NAME}Targets") set(namespace "${PROJECT_NAME}::") # Include module with fuction 'write_basic_package_version_file' include(CMakePackageConfigHelpers) # Configure '<PROJECT-NAME>ConfigVersion.cmake' # Use: # * PROJECT_VERSION write_basic_package_version_file( "${version_config}" COMPATIBILITY SameMajorVersion ) # Configure '<PROJECT-NAME>Config.cmake' # Use variables: # * TARGETS_EXPORT_NAME # * PROJECT_NAME configure_package_config_file( "cmake/Config.cmake.in" "${project_config}" INSTALL_DESTINATION "${config_install_dir}" ) # Targets: # * <prefix>/lib/libname.a # * header location after install: <prefix>/include/${PROJECT_NAME}/include.hpp # * headers can be included by C++ code `#include <${PROJECT_NAME}/include.hpp>` install( TARGETS ${install_targets} EXPORT "${targets_export_name}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" ) # Headers: install( FILES ${install_fastsimd_headers} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/FastSIMD" ) install( FILES ${install_fastnoise_headers} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/FastNoise" ) install( FILES ${install_fastnoise_generators_headers} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/FastNoise/Generators" ) # Config # * <prefix>/lib/cmake/${PROJECT_NAME}/${PROJECT_NAME}Config.cmake # * <prefix>/lib/cmake/${PROJECT_NAME}/${PROJECT_NAME}ConfigVersion.cmake install( FILES "${project_config}" "${version_config}" DESTINATION "${config_install_dir}" ) # Config # * <prefix>/lib/cmake/${PROJECT_NAME}/${PROJECT_NAME}Targets.cmake install( EXPORT "${targets_export_name}" NAMESPACE "${namespace}" DESTINATION "${config_install_dir}" ) ``` -------------------------------- ### MSVC PDB installation Source: https://github.com/zylann/godot_voxel/blob/master/thirdparty/fast_noise_2/CMakeLists.txt Installs PDB files for MSVC builds, handling multi-config generators and choosing the destination based on BUILD_SHARED_LIBS. ```cmake if(MSVC) #install pdbs get_cmake_property(is_multi GENERATOR_IS_MULTI_CONFIG) if(is_multi) set(config_suffix "$<CONFIG>") else() set(config_suffix "") endif() if(BUILD_SHARED_LIBS) set(pdb_dst ${CMAKE_INSTALL_BINDIR}) else() set(pdb_dst ${CMAKE_INSTALL_LIBDIR}) endif() install( DIRECTORY "${pdb_output_dir}/${config_suffix}/" DESTINATION ${pdb_dst} ) endif() ``` -------------------------------- ### get_main_function() Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/VoxelGeneratorGraph.md Gets the graph used for generation. ```APIDOC ## get_main_function() ### Description Gets the graph used for generation. ### Returns VoxelGraphFunction ``` -------------------------------- ### Include GNUInstallDirs and add subdirectories Source: https://github.com/zylann/godot_voxel/blob/master/thirdparty/fast_noise_2/CMakeLists.txt Includes GNUInstallDirs to define install directories, initializes install_targets, and conditionally adds src, NoiseTool, and tests subdirectories based on options. ```cmake # Introduce variables: # * CMAKE_INSTALL_LIBDIR # * CMAKE_INSTALL_BINDIR include(GNUInstallDirs) set(install_targets "") add_subdirectory(src) if(FASTNOISE2_NOISETOOL) include(cmake/CPM.cmake) add_subdirectory(NoiseTool) endif() if(FASTNOISE2_TESTS) include(cmake/CPM.cmake) add_subdirectory(tests) endif() ``` -------------------------------- ### VSCode launch.json: Use voxel.natvis instead of godot.natvis Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/development.md Replace the previous visualizerFile with this path to get pretty printing for voxel module structures. This overrides the Godot types visualizer. ```json "visualizerFile": "${workspaceFolder}/modules/voxel/misc/voxel.natvis" ``` -------------------------------- ### Channel layout Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/specs/block_format_v1.md Each channel starts with a compression byte (VoxelBuffer::Compression enum) followed by data. Compression values: 0 for none, 1 for uniform; other values are invalid. ```text Channel - compression: uint8_t - data ``` -------------------------------- ### setup_from_template Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/VoxelInstanceLibraryMultiMeshItem.md Configures the item using a template node. ```APIDOC ## setup_from_template(node) ### Description Sets up the item from a template node. (No documentation provided in source.) ### Method setup_from_template ### Parameters - **node** (Node) - Required - The template node to use for setup. ``` -------------------------------- ### Get default model ID using get_model_index_default Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/blocky_terrain.md Use this to get the model ID for a type with no attributes, or when you want its default state. The type name is passed as a StringName. ```gdscript var model_id := library.get_model_index_default(&"leaves") ``` -------------------------------- ### setup_from_template Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/VoxelInstanceLibraryMultiMeshItem.md Sets up the item from a template node. ```APIDOC ## setup_from_template ### Description Sets up the item from a template node. ### Method `setup_from_template` ### Signature `void setup_from_template(Node node)` ### Parameters - **node** (Node) - The template node to use for setup. ``` -------------------------------- ### debug_load_waves_preset() Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/VoxelGeneratorGraph.md This method has no documentation. ```APIDOC ## debug_load_waves_preset() ### Description This method has no documentation. ### Returns void ``` -------------------------------- ### get_voxels() Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/VoxelDataBlockEnterInfo.md Gets access to the voxels in the block. ```APIDOC ## get_voxels() ### Description Gets access to the voxels in the block. ### Method get_voxels ### Signature VoxelBuffer get_voxels() const ### Parameters None ### Returns - **VoxelBuffer** - The voxel buffer containing the voxels in the block. ``` -------------------------------- ### get_color(index) Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/VoxelColorPalette.md Gets the color at the given index. ```APIDOC ## get_color(index) ### Description Gets the color at the given index. ### Method get_color ### Parameters - **index** (int) - The index of the color to retrieve. ### Returns - **Color** - The color at the given index. ``` -------------------------------- ### Generate API documentation Markdown Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/development.md Run this command from `doc/tools` to convert XML class reference files into Markdown counterparts. ```bash python build.py -a ``` -------------------------------- ### C# interaction with extension classes using ClassDB and Call/Set Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/getting_the_module.md Shows how to interact with extension classes from C# using Godot's reflection methods, since the C# glue only contains core vanilla classes. This pseudo-code is untested and carries overhead and performance impact. ```cs // /!\ Pseudo-code, untested GodotObject model = Godot.ClassDB.Instantiate("VoxelBlockyModelCube"); model.Call("set_tile", Godot.ClassDB.ClassGetIntegerConstant("VoxelBlockyModel", "SIDE_NEGATIVE_X"), new Vector2I(1, 1)) model.Set("atlas_size_in_tiles", new Vector2I(8, 8)); ``` -------------------------------- ### get_max_step_height() Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/VoxelBoxMover.md Gets the maximum step height for climbing. ```APIDOC ## get_max_step_height() ### Description Gets the maximum step height for climbing. ### Method GET ### Endpoint N/A ### Parameters None ### Request Example N/A ### Response #### Success Response (200) - **float** - The maximum step height. #### Response Example N/A ``` -------------------------------- ### get_channel_depth(channel_index) Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/VoxelFormat.md Gets the depth of a specific channel. ```APIDOC ## get_channel_depth(channel_index) ### Description Gets the depth of a specific channel. See Depth for more information. ### Method get_channel_depth ### Parameters - **channel_index** (ChannelId) - Required - The channel index. ### Returns Depth ``` -------------------------------- ### Build GDExtension on Windows (debug) Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/development.md Run this SCons command in the voxel root directory to build a debug GDExtension library for Windows. The output is placed in `project/addons/zylann.voxel/bin/`. ```bash scons platform=windows target=debug -j4 ``` -------------------------------- ### Build GDExtension for Web Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/development.md Use this SCons command to build the GDExtension for web platforms. Requires Emscripten and matching Godot export template version. ```bash scons platform=web [etc...] ``` -------------------------------- ### get_lod_index() Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/VoxelDataBlockEnterInfo.md Gets which LOD index the data block is in. ```APIDOC ## get_lod_index() ### Description Gets which LOD index the data block is in. ### Method get_lod_index ### Signature int get_lod_index() const ### Parameters None ### Returns - **int** - The LOD index of the data block. ``` -------------------------------- ### CMake project setup and architecture detection Source: https://github.com/zylann/godot_voxel/blob/master/thirdparty/fast_noise_2/CMakeLists.txt Sets the minimum CMake version, project name and version, C++ standard, and prints the architecture. Defines FastSIMD compile flags based on the system processor (armv7, aarch64, arm64, arm). ```cmake cmake_minimum_required(VERSION 3.7.1) project(FastNoise2 VERSION 0.10.0) set(CMAKE_CXX_STANDARD 17) message("FastNoise2 Arch: ${CMAKE_SYSTEM_PROCESSOR}") if(CMAKE_SYSTEM_PROCESSOR MATCHES armv7) set(FASTSIMD_COMPILE_ARMV7 true) set(FASTSIMD_COMPILE_ARM true) set(FASTSIMD_COMPILE_HAVE_NEON true) elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64) set(FASTSIMD_COMPILE_AARCH64 true) set(FASTSIMD_COMPILE_ARM true) set(FASTSIMD_COMPILE_HAVE_NEON true) elseif(CMAKE_SYSTEM_PROCESSOR MATCHES arm64) set(FASTSIMD_COMPILE_ARM true) set(FASTSIMD_COMPILE_HAVE_NEON true) elseif(CMAKE_SYSTEM_PROCESSOR MATCHES arm) set(FASTSIMD_COMPILE_ARM true) endif() ``` -------------------------------- ### is_baking() Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/VoxelMeshSDF.md Gets whether an asynchronous baking operation is pending. ```APIDOC ## is_baking() ### Description Gets whether a asynchronous baking operation is pending. ### Method bool ### Parameters None ### Returns bool - true if an asynchronous baking operation is pending, false otherwise. ``` -------------------------------- ### mesh_block_exited Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/VoxelTerrain.md Signal emitted when a mesh block gets unloaded. ```APIDOC ## [SIGNAL] mesh_block_exited ### Description Emitted when a mesh block gets unloaded. It is the counterpart of [VoxelTerrain.mesh_block_entered](VoxelTerrain.md#signals). ### Signal mesh_block_exited ### Parameters - **position** ([Vector3i](https://docs.godotengine.org/en/stable/classes/class_vector3i.html)) - The position of the mesh block that exited. ``` -------------------------------- ### get_simd_level() -> SIMDLevel Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/FastNoise2.md Gets which SIMD level was detected by the library. ```APIDOC ## get_simd_level() -> SIMDLevel ### Description Gets which SIMD level was detected by the library. This gives an indication of performance on the current CPU, as different models can have different SIMD instructions available. ### Method SIMDLevel get_simd_level() ### Parameters None ### Returns SIMDLevel - The detected SIMD level. ``` -------------------------------- ### VSCode launch.json: Add Godot Natvis visualizerFile Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/development.md Add this line to your launch.json to enable pretty printing for Godot types in VSCode. Only one visualizerFile can be specified at a time. ```json "visualizerFile": "${workspaceFolder}/platform/windows/godot.natvis" ``` -------------------------------- ### get_version_status() Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/VoxelEngine.md Gets the version status, which may be `dev` or `release`. ```APIDOC ## get_version_status() ### Description Gets the version status, which may be one of the following: `dev`, `release`. ### Method Function ### Signature `String get_version_status()` ### Returns - **String** - The version status: `dev` or `release`. ``` -------------------------------- ### VSCode launch.json configuration for debugging Godot Voxel Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/development.md Example VSCode launch configuration for debugging the Godot Voxel module on Windows. It sets up a C++ debugger (MSVC or GDB) with the Godot editor binary, includes commented-out options for editor mode, collision debug, and specific test scenes, and sets the working directory to the project path. Use this to launch Godot directly from VSCode for debugging. ```json { "version": "0.2.0", "configurations": [ { "name": "(Windows) Launch", "type": "cppvsdbg", // For MSVC //"type": "cppdbg", // For GDB "request": "launch", "program": "${workspaceFolder}/bin/godot.windows.editor.dev.x86_64.exe", // Dev build (old target=debug) //"program": "${workspaceFolder}/bin/godot.windows.editor.x86_64.exe", // Non-dev build (old target=release_debug) "args": [ "-v", // Verbose output //"-e", // Editor mode //"--debug-collisions", // Run a specific scene //"local_tests/sqlite/test_sqlite.tscn", //"local_tests/texturing/test_textured_terrain.tscn" //"local_tests/texturing/test_texturing.tscn" ], "stopAtEntry": false, "cwd": "D:/PROJETS/INFO/GODOT/Games/SolarSystem/Project", "environment": [], "visualizerFile": "${workspaceFolder}/modules/voxel/misc/voxel.natvis" } ] } ``` -------------------------------- ### get_version_patch() Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/VoxelEngine.md Gets the patch version number of the voxel engine. ```APIDOC ## get_version_patch() ### Description Gets the patch version number of the voxel engine. For example, in `1.2.0`, `0` is the patch version. ### Method Function ### Signature `int get_version_patch()` ### Returns - **int** - The patch version number. ``` -------------------------------- ### Minimal saving setup with VoxelStreamSQLite Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/streams.md Attach this script to a VoxelTerrain node to set up a SQLite stream and save modified blocks when the node exits the tree. The database directory must exist before setting the path. Saving is asynchronous, so the file may not contain changes immediately after the node is destroyed. ```gdscript extends VoxelTerrain func _ready(): stream = VoxelStreamSQLite.new() stream.database_path = "path/to/save.file" # Note, the directory must exist func _on_tree_exited(): save_modified_blocks() ``` -------------------------------- ### get_version_minor() Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/VoxelEngine.md Gets the minor version number of the voxel engine. ```APIDOC ## get_version_minor() ### Description Gets the minor version number of the voxel engine. For example, in `1.2.0`, `2` is the minor version. ### Method Function ### Signature `int get_version_minor()` ### Returns - **int** - The minor version number. ``` -------------------------------- ### get_version_major() Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/VoxelEngine.md Gets the major version number of the voxel engine. ```APIDOC ## get_version_major() ### Description Gets the major version number of the voxel engine. For example, in `1.2.0`, `1` is the major version. ### Method Function ### Signature `int get_version_major()` ### Returns - **int** - The major version number. ``` -------------------------------- ### run_tests(options) Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/VoxelEngine.md Runs tests with the given options. ```APIDOC ## run_tests(options) ### Description Runs tests with the given options. ### Method run_tests ### Signature void run_tests(Dictionary options) ### Parameters - **options** (Dictionary) - Required - Options for the test run. ### Returns - **void** - No return value. ``` -------------------------------- ### generate_image(image: Image, tileable: bool) -> void Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/FastNoise2.md Fills a greyscale image with noise values. ```APIDOC ## generate_image(image: Image, tileable: bool) -> void ### Description Fills a greyscale image with noise values. ### Method void generate_image(Image image, bool tileable) ### Parameters - **image** (Image) - Required - The image to fill with noise values. - **tileable** (bool) - Required - Whether the noise should be tileable. ### Returns void ``` -------------------------------- ### get_model(index: int) -> VoxelBlockyModel Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/VoxelBlockyLibrary.md Gets a model from its index. ```APIDOC ## get_model(index: int) -> VoxelBlockyModel ### Description Gets a model from its index. ### Method get_model ### Signature get_model(index: int) -> VoxelBlockyModel ### Parameters - **index** (int) - Required - The index of the model to retrieve. ### Returns - **VoxelBlockyModel** - The model at the specified index. ``` -------------------------------- ### get_voxel_f Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/VoxelTool.md Gets the floating-point SDF value of a voxel at a given position. ```APIDOC ## get_voxel_f(pos) ### Description Gets data from voxel at `pos` coordinates, interpreting it as a floating-point SDF value. This is recommended to query the VoxelBuffer.CHANNEL_SDF channel for smooth voxels. ### Method Function ### Signature `float get_voxel_f(Vector3i pos)` ### Parameters - **pos** (Vector3i) - Required - Position of the voxel to query. ### Returns - **float** - Floating-point SDF value of the voxel. ``` -------------------------------- ### VoxelAStarGrid3D Methods Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/VoxelAStarGrid3D.md Methods of VoxelAStarGrid3D for grid-based A* pathfinding on blocky voxel terrain. ```APIDOC ## debug_get_visited_positions ### Description Returns the list of voxel positions visited during the last pathfinding search. Useful for debugging and visualization. ### Method `debug_get_visited_positions` ( ) const ### Returns - **Vector3i[]** - Array of visited voxel positions. ``` ```APIDOC ## find_path ### Description Finds a path between two voxel positions on blocky terrain. Returns an array of voxel positions representing the path. ### Method `find_path` ( Vector3i from_position, Vector3i to_position ) ### Parameters - **from_position** (Vector3i) - Required - Starting voxel position. - **to_position** (Vector3i) - Required - Target voxel position. ### Returns - **Vector3i[]** - Array of voxel positions forming the path. ``` ```APIDOC ## find_path_async ### Description Starts an asynchronous pathfinding search. The result is not returned directly; use `is_running_async` to check completion and `debug_get_visited_positions` for debugging. ### Method `find_path_async` ( Vector3i from_position, Vector3i to_position ) ### Parameters - **from_position** (Vector3i) - Required - Starting voxel position. - **to_position** (Vector3i) - Required - Target voxel position. ``` ```APIDOC ## get_region ### Description Returns the region (AABB) in which the pathfinder operates. The search is limited to this area. ### Method `get_region` ( ) ### Returns - **AABB** - The region box. ``` ```APIDOC ## is_running_async ### Description Returns whether an asynchronous pathfinding search is currently in progress. ### Method `is_running_async` ( ) const ### Returns - **bool** - `true` if an async search is running, `false` otherwise. ``` ```APIDOC ## set_region ### Description Sets the region (AABB) in which the pathfinder operates. The search is limited to this area. ### Method `set_region` ( AABB box ) ### Parameters - **box** (AABB) - Required - The region box. ``` ```APIDOC ## set_terrain ### Description Sets the terrain to use for pathfinding. The terrain provides the voxel data. ### Method `set_terrain` ( VoxelTerrain terrain ) ### Parameters - **terrain** (VoxelTerrain) - Required - The terrain object. ``` -------------------------------- ### get_voxel Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/VoxelTool.md Gets the raw integer value of a voxel at a given position. ```APIDOC ## get_voxel(pos) ### Description Gets data from voxel at `pos` coordinates. The returned value will be an unsigned integer. The meaning of the value depends on the channel the tool is set to. ### Method Function ### Signature `int get_voxel(Vector3i pos)` ### Parameters - **pos** (Vector3i) - Required - Position of the voxel to query. ### Returns - **int** - Unsigned integer value of the voxel data. For smooth voxels, use `get_voxel_f` to get a float value. ``` -------------------------------- ### Non-Godot debug print with println and format Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/development.md Print a formatted message outside Godot using the project's utility functions. Include the headers <util/io/log.h> and <util/string/format.h> and use println with format. This is for non-Godot contexts, such as standalone tests or tools. ```cpp #include "util/io/log.h" #include "util/string/format.h" println(format("Hello {}, my age is {}", name, age)); ``` -------------------------------- ### is_baked() Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/VoxelMeshSDF.md Gets whether the resource contains baked SDF data. ```APIDOC ## is_baked() ### Description Gets whether the resource contains baked SDF data. ### Method bool ### Parameters None ### Returns bool - true if the resource contains baked SDF data, false otherwise. ``` -------------------------------- ### add_connection Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/VoxelGraphFunction.md Connects the output of a source node to the input of a destination node. Cycles are not supported. ```APIDOC ## add_connection ### Description Connects the outputs of a node to the input of another node. Connecting a node to itself, or in a way that can lead it back to itself, is not supported. ### Method add_connection ### Parameters - **src_node_id** (int) - Required - ID of the source node. - **src_port_index** (int) - Required - Index of the output port on the source node. - **dst_node_id** (int) - Required - ID of the destination node. - **dst_port_index** (int) - Required - Index of the input port on the destination node. ### Returns void ``` -------------------------------- ### get_simd_level_name(level: SIMDLevel) -> String Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/FastNoise2.md Gets the name of SIMD level. ```APIDOC ## get_simd_level_name(level: SIMDLevel) -> String ### Description Gets the name of SIMD level. ### Method String get_simd_level_name(SIMDLevel level) ### Parameters - **level** (SIMDLevel) - Required - The SIMD level to get the name for. ### Returns String - The name of the SIMD level. ``` -------------------------------- ### load_from_file Source: https://github.com/zylann/godot_voxel/blob/master/doc/source/api/VoxelVoxLoader.md Static method to load voxel data from a MagicaVoxel .vox file into a VoxelBuffer, optionally loading the color palette. ```APIDOC ## [STATIC] load_from_file ### Description Loads voxels from the first model found in a .vox file and stores them in a single VoxelBuffer. Other models in the file are not loaded, and the model's transform is not considered. Data is stored in one channel of the provided buffer; 64-bit depth channels are not supported. ### Method Static function ### Signature int load_from_file(String fpath, VoxelBuffer voxels, VoxelColorPalette palette, ChannelId dst_channel = CHANNEL_COLOR) ### Parameters - **fpath** (String) - Required - Path to the .vox file to load. - **voxels** (VoxelBuffer) - Required - The buffer where voxel data will be stored. - **palette** (VoxelColorPalette) - Required - If provided, the color palette is loaded from the file and voxels store indices into it. If null, colors are bit-packed directly into voxels based on buffer depth (2-bit per component for 8-bit, 4-bit for 16-bit, 8-bit for 32-bit). - **dst_channel** (ChannelId) - Optional - The channel in the buffer where data will be stored. Defaults to CHANNEL_COLOR. ### Returns - **int** - An Error enum code indicating success or failure. ### Notes - MagicaVoxel uses a different axis convention than Godot: X is right, Y is forwards, Z is up. Voxel coordinates are the same when looked up in the buffer, but they represent different locations in space. ```