Explorar o código

fix TriangulateInPlace to work with latest FBX Python SDK 2015.1 (#9379)

TriangulateInPlace is deprecated and throws an error with FBX Python SDK:
http://usa.autodesk.com/adsk/servlet/pc/item?siteID=123112&id=10775847

Need to use `bool Triangulate(FbxNodeAttribute pNodeAttribute, bool pReplace)`
instead:
http://docs.autodesk.com/FBX/2014/ENU/FBX-SDK-Documentation/index.html?url=cpp_ref/class_fbx_geometry_converter.html,topicNumber=cpp_ref_class_fbx_geometry_converter_html6a8228a3-73ce-4649-8c11-aa5335c92203
Anup Bishnoi %!s(int64=9) %!d(string=hai) anos
pai
achega
14ae73a84f
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      utils/converters/fbx/convert_to_threejs.py

+ 3 - 3
utils/converters/fbx/convert_to_threejs.py

@@ -258,7 +258,7 @@ def triangulate_node_hierarchy(node):
            node_attribute.GetAttributeType() == FbxNodeAttribute.eNurbs or \
            node_attribute.GetAttributeType() == FbxNodeAttribute.eNurbsSurface or \
            node_attribute.GetAttributeType() == FbxNodeAttribute.ePatch:
-            converter.TriangulateInPlace(node);
+            converter.Triangulate(node.GetNodeAttribute(), True);
 
         child_count = node.GetChildCount()
         for i in range(child_count):
@@ -1526,7 +1526,7 @@ def generate_mesh_list_from_hierarchy(node, mesh_list):
            attribute_type == FbxNodeAttribute.ePatch:
 
             if attribute_type != FbxNodeAttribute.eMesh:
-                converter.TriangulateInPlace(node);
+                converter.Triangulate(node.GetNodeAttribute(), True);
 
             mesh_list.append(node.GetNodeAttribute())
 
@@ -1555,7 +1555,7 @@ def generate_embed_dict_from_hierarchy(node, embed_dict):
            attribute_type == FbxNodeAttribute.ePatch:
 
             if attribute_type != FbxNodeAttribute.eMesh:
-                converter.TriangulateInPlace(node);
+                converter.Triangulate(node.GetNodeAttribute(), True);
 
             embed_object = generate_scene_output(node)
             embed_name = getPrefixedName(node, 'Embed')