[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [1139] trunk/py/scripts/addons: added to trunk/py/scripts/addons/io_coat3D

Brendon Murphy meta.androcto1 at gmail.com
Fri Nov 5 23:15:04 CET 2010


Revision: 1139
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-extensions&revision=1139
Author:   meta-androcto
Date:     2010-11-05 23:15:04 +0100 (Fri, 05 Nov 2010)

Log Message:
-----------
added to trunk/py/scripts/addons/io_coat3D
this is the App Link Script which links 3d Coat & Blender for Texture & Model interchange.
Wiki page to be written.

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

Added: trunk/py/scripts/addons/io_coat3D/__init__.py
===================================================================
--- trunk/py/scripts/addons/io_coat3D/__init__.py	                        (rev 0)
+++ trunk/py/scripts/addons/io_coat3D/__init__.py	2010-11-05 22:15:04 UTC (rev 1139)
@@ -0,0 +1,221 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+bl_addon_info = {
+    "name": "3D-Coat Applink",
+    "author": "Kalle-Samuli Riihikoski (haikalle)",
+    "version": (1,61),
+    "blender": (2, 5, 4),
+    "api": 31667,
+    "location": "Scene -> 3D-Coat Applink",
+    "description": "Transfer data between 3D-Coat/Blender",
+    "warning": "",
+    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/' \
+        'Scripts/",
+    "tracker_url": "https://projects.blender.org/tracker/?"\
+        "func=detail&atid=467&aid=24446&group_id=153",
+    "category": "Import/Export"}
+
+
+
+#if "bpy" in locals(): Don't know if this is important
+#    reload(render)
+#    reload(ui)
+
+#else:
+import bpy
+from bpy.props import *
+from io_coat3D import coat
+from io_coat3D import tex
+
+def register():
+
+	bpy.coat3D = dict()
+	bpy.coat3D['active_coat'] = ''
+	bpy.coat3D['status'] = 0
+	bpy.coat3D['kuva'] = 1
+    
+	class coat3D(bpy.types.IDPropertyGroup):
+		pass
+		
+	bpy.types.Object.coat3D= PointerProperty(
+		name= "Applink Variables",
+		type=  coat3D,
+		description= "Applink variables"
+	)
+
+	coat3D.objpath = StringProperty(
+		name="Object_Path",
+		default= ""
+	)
+
+	coat3D.coatpath = StringProperty(
+		name="Coat_Path",
+		default= ""
+	)
+
+
+	class coat3D(bpy.types.IDPropertyGroup):
+		pass
+
+	bpy.types.Scene.coat3D= PointerProperty(
+		name= "Applink Variables",
+		type=  coat3D,
+		description= "Applink variables"
+	)
+
+	coat3D.objectdir = StringProperty(
+		name="ObjectPath",
+		subtype="FILE_PATH",
+		default= ""
+	)
+
+	coat3D.exchangedir = StringProperty(
+		name="FilePath",
+		subtype="DIR_PATH",
+		default= ""
+	)
+
+	coat3D.wasactive = StringProperty(
+		name="Pass active object",
+		default= ""
+	)
+
+	coat3D.export_on = BoolProperty(
+		name="Export_On",
+		description="Add Modifiers and export.",
+		default= False
+	)
+
+	coat3D.smooth_on = BoolProperty(
+		name="Auto Smooth",
+		description="Add Modifiers and export.",
+		default= True
+	)
+
+	coat3D.exportfile = BoolProperty(
+		name="No Import File",
+		description="Add Modifiers and export.",
+		default= False
+	)
+
+	coat3D.importmod = BoolProperty(
+		name="Remove Modifiers",
+		description="Import and add modifiers.",
+		default= True
+	)
+
+	coat3D.exportmod = BoolProperty(
+		name="Modifiers",
+		description="Export modifiers.",
+		default= False
+	)
+
+	coat3D.export_pos = BoolProperty(
+		name="Remember Position",
+		description="Remember position.",
+		default= True
+	)
+
+	coat3D.importtextures = BoolProperty(
+		name="Bring Textures",
+		description="Import Textures.",
+		default= True
+	)
+
+	coat3D.exportover = BoolProperty(
+		name="Export Obj",
+		description="Import Textures.",
+		default= False
+	)
+
+	coat3D.importmesh = BoolProperty(
+		name="Mesh",
+		description="Import Mesh.",
+		default= True
+	)
+
+	#copy location
+
+	coat3D.cursor = FloatVectorProperty(
+		name="Cursor",
+		description="Location.",
+		subtype="XYZ",
+		default=(0.0, 0.0, 0.0)
+	)
+
+	coat3D.loca = FloatVectorProperty(
+		name="location",
+		description="Location.",
+		subtype="XYZ",
+		default=(0.0, 0.0, 0.0)
+	)
+
+	coat3D.rota = FloatVectorProperty(
+		name="location",
+		description="Location.",
+		subtype="EULER",
+		default=(0.0, 0.0, 0.0)
+	)
+
+	coat3D.scal = FloatVectorProperty(
+		name="location",
+		description="Location.",
+		subtype="XYZ",
+		default=(0.0, 0.0, 0.0)
+	)
+
+	coat3D.dime = FloatVectorProperty(
+		name="dimension",
+		description="Dimension.",
+		subtype="XYZ",
+		default=(0.0, 0.0, 0.0)
+	)
+
+	coat3D.type = EnumProperty( name= "Export Type",
+	description= "Diffrent Export Types.",
+	items=(
+		("ppp",   "Per-Pixel Painting", ""),
+		("mv",   "Microvertex Painting", ""),
+		("ptex",   "Ptex Painting", ""),
+		("uv",   "UV-Mapping", ""),
+		("ref",  "Reference Mesh", ""),
+		("retopo",  "Retopo mesh as new layer", ""),
+		("vox",  "Mesh As Voxel Object", ""),
+		("alpha",  "Mesh As New Pen Alpha", ""),
+		("prim",  "Mesh As Voxel Primitive", ""),
+		("autopo",  "Mesh for Auto-retopology", ""),
+	),
+	default= "ppp"
+	)
+
+
+def unregister():
+	import bpy
+
+	del bpy.types.Object.coat3D
+	del bpy.types.Scene.coat3D
+	del bpy.coat3D
+	
+
+
+if __name__ == "__main__":
+	register()
+
+
+

Added: trunk/py/scripts/addons/io_coat3D/coat.py
===================================================================
--- trunk/py/scripts/addons/io_coat3D/coat.py	                        (rev 0)
+++ trunk/py/scripts/addons/io_coat3D/coat.py	2010-11-05 22:15:04 UTC (rev 1139)
@@ -0,0 +1,500 @@
+# scene_blend_info.py Copyright (C) 2010, Mariano Hidalgo
+#
+# Show Information About the Blend.
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# ***** END GPL LICENCE BLOCK *****
+
+bl_addon_info = {
+	"name": "Coat Applink",
+	"author": "Kalle-Samuli Riihikoski (haikalle)",
+	"version": (1,6),
+	"blender": (2, 5, 4),
+	"api": 31965,
+	"location": "Properties space > Scene tab > 3D-Coat Applink",
+	"description": "Show information about the .blend",
+	"warning": "",
+	"wiki_url": 'http://wiki.blender.org/index.php/Extensions:2.5/Py/' \
+	    'Scripts/System/Blend Info',
+	"tracker_url": "https://projects.blender.org/tracker/index.php?" \
+	    "func=detail&aid=22102&group_id=153&atid=469",
+	"category": "System"}
+
+import bpy
+from bpy.props import *
+from io_coat3D import tex
+import os
+import linecache
+
+bpy.coat3D = dict()
+bpy.coat3D['active_coat'] = ''
+bpy.coat3D['status'] = 0
+bpy.coat3D['kuva'] = 1
+
+#bpy.context.user_preferences.filepaths.use_relative_paths = False
+
+class ObjectButtonsPanel():
+	bl_space_type = 'PROPERTIES'
+	bl_region_type = 'WINDOW'
+	bl_context = "object"
+
+class SCENE_PT_Borgleader(ObjectButtonsPanel,bpy.types.Panel):
+	bl_label = "3D-Coat Applink"
+	bl_space_type = "PROPERTIES"
+	bl_region_type = "WINDOW"
+	bl_context = "scene"
+
+	def draw(self, context):
+		layout = self.layout
+		scene = context.scene
+		me = context.scene.objects
+		mat_list = []
+		import_no = 0
+		coat = bpy.coat3D
+		coat3D = bpy.context.scene.coat3D
+
+		if(coat['kuva'] == 1):
+                        bpy.context.scene.game_settings.material_mode = 'GLSL'
+                        coat['kuva'] = 0
+                
+		
+		if(os.path.isdir(coat3D.exchangedir)):
+			foldder = coat3D.exchangedir
+			if(foldder.rfind('Exchange') >= 0):
+				coat3D.exchangedir = foldder
+				coat['status'] = 1
+			else:
+				coat['status'] = 0
+		else:
+			coat['status'] = 0
+		#Here you add your GUI 
+		row = layout.row()
+		row.prop(coat3D,"type",text = "")
+		row = layout.row()
+		colL = row.column()
+		colR = row.column()
+		if(context.selected_objects):
+			if(context.selected_objects[0].type == 'MESH'):
+				colL.active = True
+			else:
+				colL.active = False
+		else:
+			colL.active = False
+		colL.operator("exportbutton", text="Export")
+		colL.label(text="Export Settings:")
+
+		colL.prop(coat3D,"exportover")
+		if(coat3D.exportover):
+			colL.prop(coat3D,"exportmod")
+		colL.prop(coat3D,"exportfile")
+		colL.prop(coat3D,"export_pos")
+		
+		
+		if(bpy.context.active_object):
+			colR.active = True
+		else:
+			colR.active = False
+		    
+		colR.operator("importbutton", text="Import")
+		colR.label(text="Import Settings:")
+		colR.prop(coat3D,"importmesh")
+		colR.prop(coat3D,"importmod")
+		colR.prop(coat3D,"smooth_on")
+		colR.prop(coat3D,"importtextures")
+		row = layout.row()
+		colL = row.column()
+		colM = row.column()
+		colR = row.column()
+		colL.operator("deltex",text="Del Tex")
+		if(bpy.context.active_object):
+			colM.active = True
+			if(bpy.context.active_object.coat3D.coatpath and os.path.isfile(bpy.context.active_object.coat3D.coatpath)):
+				colR.active = True
+				if(coat['active_coat'] == bpy.context.active_object.coat3D.coatpath):
+					colR.operator("load3b", text="Active 3b")
+				else:
+					colR.operator("load3b", text="Load 3b")
+			else:
+				colR.active = False
+				colR.operator("no3b",text="No 3b")
+		else:
+			colM.active = False
+			colR.active = False
+			colR.operator("no3b",text="")
+		colM.operator("pickname",text="Object name")
+		row = layout.row()
+		row.label(text="Object Path:")
+		row = layout.row()
+		row.prop(coat3D,"objectdir",text="")
+		if(bpy.context.active_object):
+			if(bpy.context.active_object.name != coat3D.wasactive):
+				coat3D.wasactive = bpy.context.active_object.name
+				if(bpy.context.active_object.coat3D.objpath):
+					coat3D.objectdir = bpy.context.active_object.coat3D.objpath
+			else:
+				bpy.context.active_object.coat3D.objpath = coat3D.objectdir
+					
+		row = layout.row()
+		
+		if(coat['status'] == 1):
+			row.label(text="Exchange Folder: connected")
+			Blender_folder = ("%s%sBlender"%(coat3D.exchangedir,os.sep))
+			Blender_export = Blender_folder
+			Blender_export += ('%sexport.txt'%(os.sep))
+

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list