[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2428] trunk/py/scripts/addons/ io_coat3D: 3D-Coat Applink version 2 released :)

Kalle-Samuli Riihikoski haikalle at gmail.com
Thu Oct 13 09:45:35 CEST 2011


Revision: 2428
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2428
Author:   haikalle
Date:     2011-10-13 07:45:35 +0000 (Thu, 13 Oct 2011)
Log Message:
-----------
3D-Coat Applink version 2 released :)

Modified Paths:
--------------
    trunk/py/scripts/addons/io_coat3D/__init__.py
    trunk/py/scripts/addons/io_coat3D/coat.py
    trunk/py/scripts/addons/io_coat3D/tex.py

Modified: trunk/py/scripts/addons/io_coat3D/__init__.py
===================================================================
--- trunk/py/scripts/addons/io_coat3D/__init__.py	2011-10-13 05:43:45 UTC (rev 2427)
+++ trunk/py/scripts/addons/io_coat3D/__init__.py	2011-10-13 07:45:35 UTC (rev 2428)
@@ -53,13 +53,18 @@
     
     class ObjectCoat3D(bpy.types.PropertyGroup):
         objpath = StringProperty(name="Object_Path")
+        applink_name = StringProperty(name="Object_Applink_name")
         coatpath = StringProperty(name="Coat_Path")
         objectdir = StringProperty(name="ObjectPath", subtype="FILE_PATH")
+        objecttime = StringProperty(name="ObjectTime", subtype="FILE_PATH")
         texturefolder = StringProperty(name="Texture folder:", subtype="DIR_PATH")
         path3b = StringProperty(name="3B Path", subtype="FILE_PATH")
         export_on = BoolProperty(name="Export_On", description="Add Modifiers and export",default= False)
+        dime = FloatVectorProperty(name="dime",description="Dimension")
+        loc = FloatVectorProperty(name="Location",description="Location")
+        rot = FloatVectorProperty(name="Rotation",description="Rotation",subtype='EULER')
+        sca = FloatVectorProperty(name="Scale",description="Scale")
 
-
     class SceneCoat3D(bpy.types.PropertyGroup):
 
         defaultfolder = StringProperty(
@@ -70,7 +75,12 @@
             name="FilePath",
             subtype="DIR_PATH"
         )
+        exchangefolder = StringProperty(
+            name="FilePath",
+            subtype="DIR_PATH"
+        )
 
+
     
         
         wasactive = StringProperty(
@@ -81,6 +91,11 @@
             description="Allows to skip import dialog",
             default= True
         )
+        exchange_found = BoolProperty(
+            name="Exchange Found",
+            description="Alert if Exchange folder is not found",
+            default= True
+        )
         export_box = BoolProperty(
             name="Export window",
             description="Allows to skip export dialog",

Modified: trunk/py/scripts/addons/io_coat3D/coat.py
===================================================================
--- trunk/py/scripts/addons/io_coat3D/coat.py	2011-10-13 05:43:45 UTC (rev 2427)
+++ trunk/py/scripts/addons/io_coat3D/coat.py	2011-10-13 07:45:35 UTC (rev 2428)
@@ -27,6 +27,53 @@
 bpy.coat3D['active_coat'] = ''
 bpy.coat3D['status'] = 0
 
+def set_folders():
+    platform = os.sys.platform
+    coat3D = bpy.context.scene.coat3D
+    if(platform == 'win32'):
+        folder_objects = os.path.expanduser("~") + os.sep + 'Documents' + os.sep + '3DC2Blender' + os.sep + 'Objects'
+        folder_textures = os.path.expanduser("~") + os.sep + 'Documents' + os.sep + '3DC2Blender' + os.sep + 'Textures' + os.sep
+        if(not(os.path.isdir(folder_objects))):
+            os.makedirs(folder_objects)
+        if(not(os.path.isdir(folder_textures))):
+            os.makedirs(folder_textures)
+        exchange = os.path.expanduser("~") + os.sep + 'Documents' + os.sep + '3D-CoatV3' + os.sep +'Exchange'
+       
+    else:
+        folder_objects = os.path.expanduser("~") + os.sep + '3DC2Blender' + os.sep + 'Objects'
+        folder_textures = os.path.expanduser("~") + os.sep + '3DC2Blender' + os.sep + 'Textures' + os.sep
+        if(not(os.path.isdir(folder_objects))):
+            os.makedirs(folder_objects)
+        if(not(os.path.isdir(folder_textures))):
+            os.makedirs(folder_textures)
+        exchange = os.path.expanduser("~") + os.sep + '3D-CoatV3' + os.sep +'Exchange'
+    if(os.path.isdir(exchange)):
+        coat3D.exchange_found = True
+    else:
+        if(platform == 'win32'):
+            exchange_path = os.path.expanduser("~") + os.sep + 'Documents' + os.sep + '3DC2Blender' + os.sep + 'Exchange_folder.txt'
+        else:
+            exchange_path = os.path.expanduser("~") + os.sep + '3DC2Blender' + os.sep + 'Exchange_folder.txt'
+        if(os.path.isfile(exchange_path)):
+            ex_path =''
+
+            ex_pathh = open(exchange_path)
+            for line in ex_pathh:
+                ex_path = line
+                break
+            ex_pathh.close()
+
+            if(os.path.isdir(ex_path) and ex_path.rfind('Exchange') >= 0):
+                exchange = ex_path
+                coat3D.exchange_found = True
+            else:
+                coat3D.exchange_found = False
+        else:
+            coat3D.exchange_found = False
+            
+                
+    return exchange,folder_objects,folder_textures
+
 class ObjectButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
@@ -76,124 +123,45 @@
         row = layout.row()
         row.prop(coat3D,"type",text = "")
         row = layout.row()
-        if(context.selected_objects and bpy.context.mode == 'OBJECT'):
-            if(context.selected_objects[0].type == 'MESH'):
-                row.active = True
-            else:
-                row.active = False
+        if(context.selected_objects):
+            for selected in context.selected_objects:
+                if(selected.type == 'MESH'):
+                    row.active = True
+                    break
+                else:
+                    row.active = False
         else:
             row.active = False
 
-        if(not(bpy.context.selected_objects) and os.path.isfile(Blender_export)):
-            row.active = True
-            row.operator("import3b_applink.pilgway_3d_coat", text="Bring from 3D-Coat")
+      
 
-        else:
-            colL = row.column()
-            colR = row.column()
         
-            colL.operator("export_applink.pilgway_3d_coat", text="Export")
-            colL.label(text="Export Settings:")
+        colL = row.column()
+        colR = row.column()
+    
+        colR.operator("export_applink.pilgway_3d_coat", text="Transfer")
+           
+        colL.operator("import_applink.pilgway_3d_coat", text="Update")
 
-            colL.prop(coat3D,"exportover")
-            if(coat3D.exportover):
-                colL.prop(coat3D,"exportmod")
-            colL.prop(coat3D,"exportfile")
-            colL.prop(coat3D,"export_pos")
-               
-            colR.operator("import_applink.pilgway_3d_coat", text="Import")
-            colR.label(text="Import Settings:")
-            colR.prop(coat3D,"importmesh")
-            colR.prop(coat3D,"importmod")
-            colR.prop(coat3D,"importtextures")
-            
-            # This is Disabled, because of the blender bug. 
-            #colR.prop(coat3D,"importlevel")
+        if(os.path.isfile(Blender_export)):
             row = layout.row()
-        
-        if(bpy.context.selected_objects):
-            if(context.selected_objects[0].type == 'MESH'):
-                coa = context.selected_objects[0].coat3D
-                colL = row.column()
-                colR = row.column()
-                colL.label(text="Object Path:")
-                if(coa.path3b):
-                    colR.active = True
-                else:
-                    colR.active = False
-                    
-                colR.operator("import_applink.pilgway_3d_coat_3b", text="Load 3b")
-                row = layout.row()
-                row.prop(coa,"objectdir",text="")
-                    
-        row = layout.row()
-                
-        if(context.selected_objects):
-            if(context.selected_objects[0].type == 'MESH'):
-                coa = bpy.context.selected_objects[0].coat3D
-                row = layout.row()
-                row.label(text="Texture output folder:")
-                row = layout.row()
-                row.prop(coa,"texturefolder",text="")
-        row = layout.row()
-        if(coat['status'] == 0):
-            row.label(text="Exchange Folder: not connected")
-        else:
-            row.label(text="Exchange Folder: connected")        
+            row.operator("import3b_applink.pilgway_3d_coat", text="Bring from 3D-Coat")
 
-class SCENE_PT_Settings(ObjectButtonsPanel,bpy.types.Panel):
-    bl_label = "Applink Settings"
-    bl_space_type = "PROPERTIES"
-    bl_region_type = "WINDOW"
-    bl_context = "scene"
-
-    def draw(self, context):
-        layout = self.layout
-        coat3D = bpy.context.scene.coat3D
-        
-        row = layout.row()
-        if(bpy.context.selected_objects):
-            if(context.selected_objects[0].type == 'MESH'):
-                row.active = True
-        else:
-            row.active = False
-        row.operator("import_applink.pilgway_3d_deltex",text="Delete Textures")
-        row = layout.row()
-        row.label(text="Exchange Folder:")
-        row = layout.row()
-        row.prop(coat3D,"exchangedir",text="")
-        if(bpy.context.scene.objects.active):
-            coa = bpy.context.scene.objects.active.coat3D
+        if(coat3D.exchange_found == False):
             row = layout.row()
-            row.label(text="3b path:")
+            row.label(text="Applink didn't find your 3d-Coat/Excahnge folder.")
             row = layout.row()
-            row.prop(coa,"path3b",text="")
+            row.label("Please select it and press Transfer button again")
             row = layout.row()
-            row.label(text="Default Folder:")
-            row = layout.row()
-            row.prop(coat3D,"defaultfolder",text="")
+            row.prop(coat3D,"exchangefolder",text="")
+
+                    
             
-        #colL = row.column()
-        #colR = row.column()
-        #colL.prop(coat3D,"export_box")
-        #colR.prop(coat3D,"import_box")
-        #if(not(coat3D.export_box)):
-        #    row = layout.row()
-        #    colL.label(text="Export settings:")
-        #    row = layout.row()
-        #    colL = row.column()
-        #    colR = row.column()
-        #    colL.prop(coat3D,"export_color")
-        #    colL.prop(coat3D,"export_spec")
-        #    colL.prop(coat3D,"export_normal")
-        #    colL.prop(coat3D,"export_disp")
-        #    colR.prop(coat3D,"export_position")
-        #    colR.prop(coat3D,"export_export_zero_layer")
-        #    colR.prop(coat3D,"export_coarse")
-        #row = layout.row()
-        #colL = row.column()
-        #colR = row.column()
+            
+              
 
+
+
 class SCENE_OT_export(bpy.types.Operator):
     bl_idname = "export_applink.pilgway_3d_coat"
     bl_label = "Export your custom property"
@@ -204,66 +172,66 @@
         checkname = ''

@@ Diff output truncated at 10240 characters. @@


More information about the Bf-extensions-cvs mailing list