Skip to content

Commit

Permalink
glTF Scene Export
Browse files Browse the repository at this point in the history
* Update fetch script
* Add gltf2
Don't include extra file for assimp.


Add Assimp GLTF2 exporter.

Convert Scene to GLTF2.

Use Assimp to export MeshInstances, CSGShape and GridMaps to GLTF2.

The is no material or animation support.

Implement both exporting and merging scenes.

The Scene Convert to GLTF2 is put into the tools menu.
Rename to GLTF2 export.


Able to build gltf2 exports again.


Remove scaling code in glTF2 export.


Update assimp.


Attempt at saving skeletons.


Update assimp.
  • Loading branch information
fire committed Nov 19, 2019
1 parent 95f1f4e commit aa65a00
Show file tree
Hide file tree
Showing 69 changed files with 28,940 additions and 266 deletions.
39 changes: 25 additions & 14 deletions modules/assimp/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,20 @@ Import('env_modules')
env_assimp = env_modules.Clone()
env_assimp.Prepend(CPPPATH=['#thirdparty/assimp'])
env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/include'])
env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/code/Importer/IFC'])
env_assimp.Prepend(CPPPATH=['#thirdparty/misc'])
env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/code'])
env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/common'])
env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/contrib/irrXML/'])
env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/contrib/unzip/'])
env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/code/Importer/STEPParser'])
env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/'])
env_assimp.Prepend(CPPPATH=['#thirdparty/zlib/'])
env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/contrib/openddlparser/include'])
env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/contrib/irrXML'])
env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/contrib/unzip'])
env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/contrib'])
env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/contrib/rapidjson/include'])
env_assimp.Prepend(CPPPATH=['#thirdparty/assimp'])
env_assimp.Prepend(CPPPATH=['#thirdparty/zlib'])
env_assimp.Prepend(CPPPATH=['.'])
#env_assimp.Append(CPPDEFINES=['ASSIMP_DOUBLE_PRECISION']) # TODO default to what godot is compiled with for future double support
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_BOOST_WORKAROUND'])
env_assimp.Append(CPPDEFINES=['OPENDDLPARSER_BUILD'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_OWN_ZLIB'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_EXPORT'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_X_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_AMF_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_3DS_IMPORTER'])
Expand Down Expand Up @@ -69,12 +66,26 @@ env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_ASSBIN_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_C4D_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_3MF_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_X3D_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_GLTF_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_GLTF2_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_SINGLETHREADED'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_M3D_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_MMD_IMPORTER'])

env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_SINGLETHREADED'])
#env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_GLTF_IMPORTER'])
#env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_GLTF2_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_COLLADA_EXPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_X_EXPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_STEP_EXPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_OBJ_EXPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_STL_EXPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_PLY_EXPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_3DS_EXPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_M3D_EXPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_ASSBIN_EXPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_ASSXML_EXPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_X3D_EXPORTER'])
#env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_GLTF_EXPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_FBX_EXPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_3MF_EXPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_ASSJSON_EXPORTER'])

if(env['platform'] == 'windows'):
env_assimp.Append(CPPDEFINES=['PLATFORM_WINDOWS'])
Expand All @@ -85,16 +96,16 @@ elif(env['platform'] == 'x11'):
elif(env['platform'] == 'osx'):
env_assimp.Append(CPPDEFINES=['PLATFORM_DARWIN'])
env_assimp.Append(CPPDEFINES=[('PLATFORM', 'DARWIN')])

env_thirdparty = env_assimp.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, Glob('#thirdparty/assimp/code/Common/*.cpp'))
env_thirdparty.add_source_files(env.modules_sources, Glob('#thirdparty/assimp/code/PostProcessing/*.cpp'))
env_thirdparty.add_source_files(env.modules_sources, Glob('#thirdparty/assimp/code/Material/*.cpp'))
env_thirdparty.add_source_files(env.modules_sources, Glob('#thirdparty/assimp/code/FBX/*.cpp'))
env_thirdparty.add_source_files(env.modules_sources, Glob('#thirdparty/assimp/code/MMD/*.cpp'))
env_thirdparty.add_source_files(env.modules_sources, Glob('#thirdparty/assimp/code/glTF/*.cpp'))
env_thirdparty.add_source_files(env.modules_sources, Glob('#thirdparty/assimp/code/glTF2/*.cpp'))
env_thirdparty.add_source_files(env.modules_sources, Glob('#thirdparty/assimp/code/MMD/*.cpp'))

# Godot's own source files
env_assimp.add_source_files(env.modules_sources, "*.cpp")
Loading

0 comments on commit aa65a00

Please sign in to comment.