@@ -102,15 +102,14 @@ bool SrcScene::load( const ImportSettings& asettings ) {
102102}
103103
104104unsigned int SrcScene::initImportProperties (int assimpOptimizeFlags, const ImportSettings& asettings ) {
105- // store.reset(aiCreatePropertyStore(), aiReleasePropertyStore);
106-
107- // only ever give us triangles.
108- // aiSetImportPropertyInteger(store.get(), AI_CONFIG_PP_SBP_REMOVE, aiPrimitiveType_LINE | aiPrimitiveType_POINT );
109- // aiSetImportPropertyInteger(store.get(), AI_CONFIG_PP_PTV_NORMALIZE, true);
110-
111105 // only ever give us triangles; newer c++ api
112106 importer.SetPropertyInteger (AI_CONFIG_PP_SBP_REMOVE, aiPrimitiveType_LINE | aiPrimitiveType_POINT );
113107 importer.SetPropertyBool (AI_CONFIG_PP_PTV_NORMALIZE, true );
108+ // when preserve fbx pivots is true, assimp splits pivots out into multiple, one for transform, rotation, etc.
109+ // this causes incorrect parsing and transforms.
110+ // we just want a single bone without extra added nodes.
111+ // this is apparent in FBX Mixamo models, among others.
112+ importer.SetPropertyBool (AI_CONFIG_IMPORT_FBX_PRESERVE_PIVOTS, false );
114113
115114 unsigned int flags = assimpOptimizeFlags;
116115
@@ -161,9 +160,6 @@ unsigned int SrcScene::initImportProperties(int assimpOptimizeFlags, const Impor
161160// -------------------------------------------
162161void SrcScene::optimizeScene (){
163162 if ( scene ) {
164- // aiApplyPostProcessing(scene.get(),aiProcess_ImproveCacheLocality | aiProcess_OptimizeGraph |
165- // aiProcess_OptimizeMeshes | aiProcess_JoinIdenticalVertices |
166- // aiProcess_RemoveRedundantMaterials);
167163 importer.ApplyPostProcessing (aiProcess_ImproveCacheLocality | aiProcess_OptimizeGraph |
168164 aiProcess_OptimizeMeshes | aiProcess_JoinIdenticalVertices |
169165 aiProcess_RemoveRedundantMaterials);
@@ -191,10 +187,6 @@ void SrcScene::clear(){
191187bool SrcScene::processScene (const ImportSettings& asettings) {
192188 mSettings = asettings;
193189
194- // ofLogNotice( "PRINTING ALL SCENE NODES" );
195- // printAllNodeNames( scene->mRootNode, 0 );
196- // ofLogNotice( "DONE PRINTING ALL SCENE NODES" ) << std::endl << std::endl;
197-
198190 if (scene){
199191 processNodes ();
200192 processAnimations ();
0 commit comments