@@ -1064,7 +1064,7 @@ void BaseContext::insertAssetScenegraph(const raco::core::MeshScenegraph& sceneg
10641064 auto meshWithSameProperties = propertiesToMeshMap.find ({false , static_cast <int >(i), relativeFilePath.string ()});
10651065 if (meshWithSameProperties == propertiesToMeshMap.end ()) {
10661066 LOG_DEBUG (log_system::CONTEXT, " Did not find existing local Mesh with same properties as asset mesh, creating one instead..." );
1067- auto & currentSubmesh = meshScenegraphMeshes.emplace_back (createObject (raco::user_types::Mesh::typeDescription.typeName , *scenegraph.meshes [i]));
1067+ auto & currentSubmesh = meshScenegraphMeshes.emplace_back (createObject (raco::user_types::Mesh::typeDescription.typeName , *scenegraph.meshes [i]));
10681068 auto currentSubmeshHandle = ValueHandle{currentSubmesh};
10691069
10701070 set (currentSubmeshHandle.get (" bakeMeshes" ), false );
@@ -1184,10 +1184,9 @@ void BaseContext::insertAssetScenegraph(const raco::core::MeshScenegraph& sceneg
11841184 }
11851185 LOG_INFO (log_system::CONTEXT, " Scenegraph structure restored." );
11861186
1187-
11881187 LOG_INFO (log_system::CONTEXT, " Importing animation samplers..." );
11891188 std::map<int , std::vector<SEditorObject>> sceneChannels;
1190- for (auto animIndex = 0 ; animIndex < scenegraph.animationSamplers .size (); ++animIndex) {
1189+ for (auto animIndex = 0 ; animIndex < scenegraph.animationSamplers .size (); ++animIndex) {
11911190 auto & samplers = scenegraph.animationSamplers [animIndex];
11921191 for (auto samplerIndex = 0 ; samplerIndex < samplers.size (); ++samplerIndex) {
11931192 auto & meshAnimSampler = scenegraph.animationSamplers .at (animIndex)[samplerIndex];
@@ -1208,7 +1207,6 @@ void BaseContext::insertAssetScenegraph(const raco::core::MeshScenegraph& sceneg
12081207 LOG_DEBUG (log_system::CONTEXT, " Found existing local AnimationChannel '{}' with same properties as asset animation sampler, using this AnimationChannel..." , *meshAnimSampler);
12091208 sceneChannels[animIndex].emplace_back (samplerWithSameProperties->second );
12101209 }
1211-
12121210 }
12131211 }
12141212 LOG_INFO (log_system::CONTEXT, " Animation samplers imported." );
@@ -1247,7 +1245,7 @@ void BaseContext::insertAssetScenegraph(const raco::core::MeshScenegraph& sceneg
12471245 continue ;
12481246 }
12491247
1250- auto & linkEndNode = meshScenegraphNodes[channel.nodeIndex ];
1248+ auto & linkEndNode = meshScenegraphNodes[channel.nodeIndex ];
12511249 ValueHandle linkEndProp;
12521250 auto & animTargetProp = channel.targetPath ;
12531251
@@ -1287,16 +1285,18 @@ void BaseContext::insertAssetScenegraph(const raco::core::MeshScenegraph& sceneg
12871285 }
12881286
12891287 std::vector<SEditorObject> targetMeshNodes;
1290- auto targetMeshNode = meshScenegraphNodes[sceneSkin->meshNodeIndex ];
1291- if (targetMeshNode->isType <user_types::MeshNode>()) {
1292- targetMeshNodes.emplace_back (targetMeshNode);
1293- } else {
1294- auto submeshRootNode = targetMeshNode->children_ ->get (0 )->asRef ()->as <user_types::Node>();
1295- for (auto child : submeshRootNode->children_ ->asVector <SEditorObject>()) {
1296- if (child->isType <user_types::MeshNode>()) {
1297- targetMeshNodes.emplace_back (child);
1298- } else {
1299- LOG_ERROR (log_system::CONTEXT, " Target child node is not a MeshNode '{}'" , child->objectName ());
1288+ for (const auto & targetIndex : sceneSkin->meshNodeIndices ) {
1289+ auto targetMeshNode = meshScenegraphNodes[targetIndex];
1290+ if (targetMeshNode->isType <user_types::MeshNode>()) {
1291+ targetMeshNodes.emplace_back (targetMeshNode);
1292+ } else {
1293+ auto submeshRootNode = targetMeshNode->children_ ->get (0 )->asRef ()->as <user_types::Node>();
1294+ for (auto child : submeshRootNode->children_ ->asVector <SEditorObject>()) {
1295+ if (child->isType <user_types::MeshNode>()) {
1296+ targetMeshNodes.emplace_back (child);
1297+ } else {
1298+ LOG_ERROR (log_system::CONTEXT, " Target child node is not a MeshNode '{}'" , child->objectName ());
1299+ }
13001300 }
13011301 }
13021302 }
0 commit comments