Skip to content

Commit e3ef7f2

Browse files
committed
Add Open Asset Import Library to Godot.
FBX support and MMD (pmx) support. Normals, Albedo, Metallic, and Roughness through Arnold 5 Materials for Maya FBX. Maya FBX Stingray PBS support. Importing FBX static meshes work. Importing FBX animations is a work in progress. Supports FBX 4 bone influence animations. Supports FBX blend shapes. MMDs do not have an associated animation import yet. Sponsored by IMVU Inc.
1 parent 793b0de commit e3ef7f2

File tree

10 files changed

+2873
-2
lines changed

10 files changed

+2873
-2
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<class name="EditorSceneImporterAssimp" inherits="EditorSceneImporter" category="Core" version="3.2">
3+
<brief_description>
4+
This is a multi-format 3d asset importer.
5+
</brief_description>
6+
<description>
7+
This is a multi-format 3d asset importer.
8+
Use these FBX export settings from Autodesk Maya.
9+
[codeblock]
10+
* Smoothing Groups
11+
* Smooth Mesh
12+
* Triangluate (For mesh with blendshapes)
13+
* Bake Animation
14+
* Resample All
15+
* Deformed Models
16+
* Skins
17+
* Blend Shapes
18+
* Curve Filters
19+
* Constant Key Reducer
20+
* Auto Tangents Only
21+
* DO NOT CHECK Constraints (Will Break File)
22+
* Can check Embed Media (Embeds textures into FBX file to import)
23+
-- Note: When importing embed media, texture and mesh will be a un-alterable file.
24+
-- Reimport of fbx with updated texture is need if texture is updated.
25+
* Units: Centimeters
26+
* Up Axis: Y
27+
* Binary format in FBX 2017
28+
[/codeblock]
29+
</description>
30+
<tutorials>
31+
</tutorials>
32+
<demos>
33+
</demos>
34+
<methods>
35+
</methods>
36+
<constants>
37+
</constants>
38+
</class>

‎drivers/gles3/rasterizer_storage_gles3.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4131,7 +4131,7 @@ void RasterizerStorageGLES3::mesh_render_blend_shapes(Surface *s, const float *p
41314131
for (int ti = 0; ti < mtc; ti++) {
41324132
float weight = p_weights[ti];
41334133

4134-
if (weight < 0.001) //not bother with this one
4134+
if (weight < 0.00001) //not bother with this one
41354135
continue;
41364136

41374137
glBindVertexArray(s->blend_shapes[ti].array_id);

‎modules/assimp/SCsub‎

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
#!/usr/bin/env python
2+
3+
Import('env')
4+
Import('env_modules')
5+
6+
env_assimp = env_modules.Clone()
7+
env_assimp.Append(CPPPATH=['#thirdparty/assimp'])
8+
env_assimp.Append(CPPPATH=['#thirdparty/assimp/include'])
9+
env_assimp.Append(CPPPATH=['#thirdparty/assimp/code/Importer/IFC'])
10+
env_assimp.Append(CPPPATH=['#thirdparty/misc'])
11+
env_assimp.Append(CPPPATH=['#thirdparty/assimp/code'])
12+
env_assimp.Append(CPPPATH=['#thirdparty/assimp/contrib/irrXML/'])
13+
env_assimp.Append(CPPPATH=['#thirdparty/assimp/contrib/unzip/'])
14+
env_assimp.Append(CPPPATH=['#thirdparty/assimp/code/Importer/STEPParser'])
15+
env_assimp.Append(CPPPATH=['#thirdparty/assimp/'])
16+
env_assimp.Append(CPPPATH=['#thirdparty/zlib/'])
17+
env_assimp.Append(CPPPATH=['#thirdparty/assimp/contrib/openddlparser/include'])
18+
env_assimp.Append(CPPPATH=['#thirdparty/assimp/contrib/rapidjson/include'])
19+
env_assimp.Append(CPPPATH=['.'])
20+
#env_assimp.Append(CPPFLAGS=['-DASSIMP_DOUBLE_PRECISION']) # TODO default to what godot is compiled with for future double support
21+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_BOOST_WORKAROUND'])
22+
env_assimp.Append(CPPFLAGS=['-DOPENDDLPARSER_BUILD'])
23+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_OWN_ZLIB'])
24+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_EXPORT'])
25+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_X_IMPORTER'])
26+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_AMF_IMPORTER'])
27+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_3DS_IMPORTER'])
28+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_MD3_IMPORTER'])
29+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_MD5_IMPORTER'])
30+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_MDL_IMPORTER'])
31+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_MD2_IMPORTER'])
32+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_PLY_IMPORTER'])
33+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_ASE_IMPORTER'])
34+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_OBJ_IMPORTER'])
35+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_HMP_IMPORTER'])
36+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_SMD_IMPORTER'])
37+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_MDC_IMPORTER'])
38+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_MD5_IMPORTER'])
39+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_STL_IMPORTER'])
40+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_LWO_IMPORTER'])
41+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_DXF_IMPORTER'])
42+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_NFF_IMPORTER'])
43+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_RAW_IMPORTER'])
44+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_SIB_IMPORTER'])
45+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_OFF_IMPORTER'])
46+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_AC_IMPORTER'])
47+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_BVH_IMPORTER'])
48+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_IRRMESH_IMPORTER'])
49+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_IRR_IMPORTER'])
50+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_Q3D_IMPORTER'])
51+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_B3D_IMPORTER'])
52+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_COLLADA_IMPORTER'])
53+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_TERRAGEN_IMPORTER'])
54+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_CSM_IMPORTER'])
55+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_3D_IMPORTER'])
56+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_LWS_IMPORTER'])
57+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_OGRE_IMPORTER'])
58+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_OPENGEX_IMPORTER'])
59+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_MS3D_IMPORTER'])
60+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_COB_IMPORTER'])
61+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_BLEND_IMPORTER'])
62+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_Q3BSP_IMPORTER'])
63+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_NDO_IMPORTER'])
64+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_STEP_IMPORTER'])
65+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_IFC_IMPORTER'])
66+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_XGL_IMPORTER'])
67+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_ASSBIN_IMPORTER'])
68+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_GLTF_IMPORTER'])
69+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_C4D_IMPORTER'])
70+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_3MF_IMPORTER'])
71+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_NO_X3D_IMPORTER'])
72+
73+
env_assimp.Append(CPPFLAGS=['-DASSIMP_BUILD_SINGLETHREADED'])
74+
75+
if (not env.msvc):
76+
env_assimp.Append(CXXFLAGS=['-std=c++11'])
77+
elif (env.msvc == False and env['platform'] == 'windows'):
78+
env_assimp.Append(LDFLAGS=['-pthread'])
79+
80+
if(env['platform'] == 'windows'):
81+
env_assimp.Append(CPPFLAGS=['-DPLATFORM_WINDOWS'])
82+
env_assimp.Append(CPPFLAGS=['-DPLATFORM=WINDOWS'])
83+
elif(env['platform'] == 'x11'):
84+
env_assimp.Append(CPPFLAGS=['-DPLATFORM_LINUX'])
85+
env_assimp.Append(CPPFLAGS=['-DPLATFORM=LINUX'])
86+
elif(env['platform'] == 'osx'):
87+
env_assimp.Append(CPPFLAGS=['-DPLATFORM_DARWIN'])
88+
env_assimp.Append(CPPFLAGS=['-DPLATFORM=DARWIN'])
89+
90+
env_thirdparty = env_assimp.Clone()
91+
env_thirdparty.disable_warnings()
92+
env_thirdparty.add_source_files(env.modules_sources, Glob('#thirdparty/assimp/code/*.cpp'))
93+
94+
# Godot's own source files
95+
env_assimp.add_source_files(env.modules_sources, "*.cpp")

‎modules/assimp/config.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
def can_build(env, platform):
2+
return env['tools']
3+
4+
def configure(env):
5+
pass

0 commit comments

Comments
 (0)