@@ -320,8 +320,9 @@ public class FbxRepresentation
320
320
/// <summary>
321
321
/// Children of this node.
322
322
/// The key is the name, which is assumed to be unique.
323
- /// Old fbx data, new fbx data should have FBX Object Name
324
- /// Prefab data should have FBX Object Name
323
+ /// Old fbx data should have Unity Object Name
324
+ /// new fbx data should have FBX Object Name
325
+ /// Prefab data should have Unity Object Name
325
326
/// The value is, recursively, the representation of that subtree.
326
327
/// </summary>
327
328
Dictionary < string , FbxRepresentation > m_children = new Dictionary < string , FbxRepresentation > ( ) ;
@@ -796,9 +797,9 @@ void ClassifyReparenting()
796
797
797
798
var prefabParent = m_prefabData . GetParent ( prefabNodeName ) ;
798
799
var oldParent = m_oldFbxData . GetParent ( prefabNodeName ) ;
799
- var newParent = m_newFbxData . GetParent ( prefabNodeName ) ;
800
+ var newParent = m_newFbxData . GetParent ( m_fbxPrefabUtility . getFBXObjectName ( prefabNodeName ) ) ;
800
801
801
- // If it's a nameMapping , don't add a reparenting, we'll rename it later
802
+ // If it's a name mapping , don't add a reparenting, we'll rename it later
802
803
if ( oldParent == m_fbxPrefabUtility . getUnityObjectName ( newParent ) ) {
803
804
continue ;
804
805
}
@@ -861,18 +862,21 @@ void ClassifyComponents(Transform newFbx, Transform prefab)
861
862
// about what components might be on it.
862
863
foreach ( var nodeNameInUpdatedPrefab in m_nodesInUpdatedPrefab )
863
864
{
864
- if ( ! m_newFbxData . HasNode ( nodeNameInUpdatedPrefab ) ) {
865
+ if ( ! m_newFbxData . HasNode ( m_fbxPrefabUtility . getFBXObjectName ( nodeNameInUpdatedPrefab ) ) ) {
865
866
// It's not in the FBX, so clearly we're not updating any components.
866
867
// We don't need to check if it's in m_prefab because
867
868
// we're only iterating over those.
868
869
continue ;
869
870
}
871
+ // Get the matching name for the node in the m_newFbxData
872
+ string nodeNameInFBX = m_fbxPrefabUtility . getFBXObjectName ( nodeNameInUpdatedPrefab ) ;
873
+
870
874
var allTypes = m_oldFbxData . GetComponentTypes ( nodeNameInUpdatedPrefab ) . Union (
871
- m_newFbxData . GetComponentTypes ( nodeNameInUpdatedPrefab ) ) ;
875
+ m_newFbxData . GetComponentTypes ( nodeNameInFBX ) ) ;
872
876
873
877
foreach ( var typename in allTypes ) {
874
878
var oldValues = m_oldFbxData . GetComponentValues ( nodeNameInUpdatedPrefab , typename ) ;
875
- var newValues = m_newFbxData . GetComponentValues ( nodeNameInUpdatedPrefab , typename ) ;
879
+ var newValues = m_newFbxData . GetComponentValues ( nodeNameInFBX , typename ) ;
876
880
List < string > prefabValues = null ; // get them only if we need them.
877
881
878
882
// If we have multiple identical-type components, match them up by index.
0 commit comments