[Bf-extensions-cvs] [ffa32e50] master: autopo option works now

Kalle-Samuli Riihikoski noreply at git.blender.org
Thu Dec 27 13:24:56 CET 2018


Commit: ffa32e50eaf5c34f97dd88c787ee28e97276346e
Author: Kalle-Samuli Riihikoski
Date:   Thu Dec 27 14:21:14 2018 +0200
Branches: master
https://developer.blender.org/rBAffa32e50eaf5c34f97dd88c787ee28e97276346e

autopo option works now

===================================================================

M	io_coat3D/__init__.py

===================================================================

diff --git a/io_coat3D/__init__.py b/io_coat3D/__init__.py
index 617fa5fc..064568d0 100644
--- a/io_coat3D/__init__.py
+++ b/io_coat3D/__init__.py
@@ -378,15 +378,20 @@ class SCENE_OT_export(bpy.types.Operator):
         looking = True
         object_index = 0
 
-        while(looking == True):
-            checkname = folder_objects + os.sep + "3DC"
-            checkname = ("%s%.3d.fbx"%(checkname,object_index))
-            if(os.path.isfile(checkname)):
-                object_index += 1
-            else:
-                looking = False
-                coa.applink_name = ("%s%.2d"%(activeobj,object_index))
-                coa.applink_address = checkname
+        if(coat3D.type == 'autopo'):
+            checkname = folder_objects + os.sep
+            checkname = ("%sretopo.fbx" % (checkname))
+
+        else:
+            while(looking == True):
+                checkname = folder_objects + os.sep + "3DC"
+                checkname = ("%s%.3d.fbx"%(checkname,object_index))
+                if(os.path.isfile(checkname)):
+                    object_index += 1
+                else:
+                    looking = False
+                    coa.applink_name = ("%s%.2d"%(activeobj,object_index))
+                    coa.applink_address = checkname
 
         matindex = 0
 
@@ -435,8 +440,13 @@ class SCENE_OT_export(bpy.types.Operator):
         if(len(bpy.context.selected_objects) > 1 and coat3D.type != 'vox'):
             bpy.ops.object.transforms_to_deltas(mode='ROT')
 
-
-        bpy.ops.export_scene.fbx(filepath=coa.applink_address, use_selection=True, use_mesh_modifiers=coat3D.exportmod, axis_forward='-Z', axis_up='Y')
+        if(coat3D.type == 'autopo'):
+            coat3D.bring_retopo = True
+            coat3D.bring_retopo_path = checkname
+            bpy.ops.export_scene.fbx(filepath=checkname, use_selection=True, use_mesh_modifiers=coat3D.exportmod, axis_forward='-Z', axis_up='Y')
+        else:
+            coat3D.bring_retopo = False
+            bpy.ops.export_scene.fbx(filepath=coa.applink_address, use_selection=True, use_mesh_modifiers=coat3D.exportmod, axis_forward='-Z', axis_up='Y')
 
         file = open(importfile, "w")
         file.write("%s"%(checkname))
@@ -753,6 +763,12 @@ class SCENE_OT_import(bpy.types.Operator):
                         bpy.context.collection.all_objects[del_obj].select_set(True)
                         bpy.ops.object.delete()
 
+            if (coat3D.bring_retopo or coat3D.bring_retopo_path):
+                if(os.path.isfile(coat3D.bring_retopo_path)):
+                    bpy.ops.import_scene.fbx(filepath=coat3D.bring_retopo_path, global_scale=1, axis_forward='X', use_custom_normals=False)
+                    os.remove(coat3D.bring_retopo_path)
+
+
         else:
 
             '''
@@ -1098,6 +1114,15 @@ class SceneCoat3D(PropertyGroup):
         description="Allows to skip import dialog",
         default=True
     )
+    bring_retopo: BoolProperty(
+        name="Import window",
+        description="Allows to skip import dialog",
+        default=False
+    )
+    bring_retopo_path: StringProperty(
+        name="FilePath",
+        subtype="DIR_PATH",
+    )
     remove_path: BoolProperty(
         name="Import window",
         description="Allows to skip import dialog",



More information about the Bf-extensions-cvs mailing list