04d43947bf
This update introduces a new import method for FBX files using ufbx. If the fbx2gltf import fails, it will use the most recently cached scene from the ufbx import. The process is sped up by introducing threads to load the ufbx portion. Key changes include: - Support for importing geometry helper nodes in FBX files. - Addition of cameras and lights with updated names. - Removal of the fbx importer manager. - Introduction of ModelDocument3D and updates to its methods. - Changes to FBX import options and visibility. - Updating the documentation and handling some errors. - Store the original non-unique node, mesh and animation names in FBX and glTF. Co-Authored-By: bqqbarbhg <bqqbarbhg@gmail.com>
48 lines
1.1 KiB
Python
48 lines
1.1 KiB
Python
#!/usr/bin/env python
|
|
|
|
Import("env")
|
|
Import("env_modules")
|
|
|
|
env_fbx = env_modules.Clone()
|
|
|
|
# Thirdparty source files
|
|
|
|
thirdparty_obj = []
|
|
|
|
thirdparty_dir = "#thirdparty/ufbx/"
|
|
thirdparty_sources = [thirdparty_dir + "ufbx.c"]
|
|
|
|
env_fbx.Prepend(CPPPATH=[thirdparty_dir])
|
|
|
|
env_thirdparty = env_fbx.Clone()
|
|
env_thirdparty.disable_warnings()
|
|
|
|
env_thirdparty.Append(
|
|
CPPDEFINES=[
|
|
"UFBX_NO_SUBDIVISION",
|
|
"UFBX_NO_TESSELLATION",
|
|
"UFBX_NO_GEOMETRY_CACHE",
|
|
"UFBX_NO_SCENE_EVALUATION",
|
|
"UFBX_NO_INDEX_GENERATION",
|
|
"UFBX_NO_SKINNING_EVALUATION",
|
|
"UFBX_NO_FORMAT_OBJ",
|
|
]
|
|
)
|
|
|
|
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
|
|
env.modules_sources += thirdparty_obj
|
|
|
|
# Godot source files
|
|
|
|
module_obj = []
|
|
|
|
env_fbx.add_source_files(module_obj, "*.cpp")
|
|
env_fbx.add_source_files(module_obj, "structures/*.cpp")
|
|
|
|
if env.editor_build:
|
|
env_fbx.add_source_files(module_obj, "editor/*.cpp")
|
|
|
|
env.modules_sources += module_obj
|
|
|
|
# Needed to force rebuilding the module files when the thirdparty library is updated.
|
|
env.Depends(module_obj, thirdparty_obj)
|