private void UpdateMeshInfoRecursively(FbxSDK.Node node, ref Matrix4 parentMatrix) { int childCount = node.GetChildCount(); Matrix4 globalTransform = GetGlobalTransform(node, parentMatrix); FbxSDK.Mesh mesh = node.GetAttribute() as FbxSDK.Mesh; if (mesh != null) { Matrix4 meshTransform = GetGeometry(node) * globalTransform; MeshInfo meshInfo = FindMeshInfo(mesh); if (meshInfo == null) { meshInfo = LoadMesh(mesh); } meshInfo.geometryToWorld = meshTransform; } for (int i = 0; i < childCount; ++i) { UpdateMeshInfoRecursively(node.GetChild(i), ref globalTransform); } }
public void AddNode(ItemCollection collection, FbxSDK.Node node) { TreeViewItem viewItem = new TreeViewItem(); string name = node.GetName(); var attribute = node.GetAttribute(); if (attribute != null) { var attributeType = attribute.GetAttributeType(); name += string.Format(" ({0})", attributeType); } viewItem.Header = name; viewItem.Tag = node; for (int i = 0; i < node.GetChildCount(); ++i) { var child = node.GetChild(i); AddNode(viewItem.Items, child); } collection.Add(viewItem); }