diff options
author | Brendon Murphy <meta.androcto1@gmail.com> | 2010-11-06 01:15:04 +0300 |
---|---|---|
committer | Brendon Murphy <meta.androcto1@gmail.com> | 2010-11-06 01:15:04 +0300 |
commit | 3a2267df7f14641667ce498bd73fbffb6d5a8512 (patch) | |
tree | 8d2867373d9fc12dcbf67248ac55737316ca3221 /io_coat3D/__init__.py | |
parent | 0d6f4cf43a8ce9570e2aa9a95c5a5002c3c447e6 (diff) |
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.
Diffstat (limited to 'io_coat3D/__init__.py')
-rw-r--r-- | io_coat3D/__init__.py | 221 |
1 files changed, 221 insertions, 0 deletions
diff --git a/io_coat3D/__init__.py b/io_coat3D/__init__.py new file mode 100644 index 00000000..c99f47c7 --- /dev/null +++ b/io_coat3D/__init__.py @@ -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() + + + |