[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2692] contrib/py/scripts/addons: initial commit, moved from upload to contrib
Alexander N
alpha-beta-release at gmx.net
Thu Dec 1 11:56:22 CET 2011
Revision: 2692
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2692
Author: beta-tester
Date: 2011-12-01 10:56:15 +0000 (Thu, 01 Dec 2011)
Log Message:
-----------
initial commit, moved from upload to contrib
[#29404] Import / Export MilkShape3D MS3D files (conform with v1.8.4)
changelog:
changed: (0, 3, 3, "beta (2011-12-01 00:00)")
mod: (comment by campbellbarton)
if "name" in somedict:
result = somedict["name"]
to
result = somedict.get("name")
if result is not None:
...
Added Paths:
-----------
contrib/py/scripts/addons/io_ms3d/
contrib/py/scripts/addons/io_ms3d/__README__.txt
contrib/py/scripts/addons/io_ms3d/__init__.py
contrib/py/scripts/addons/io_ms3d/ms3d_export.py
contrib/py/scripts/addons/io_ms3d/ms3d_import.py
contrib/py/scripts/addons/io_ms3d/ms3d_spec.py
contrib/py/scripts/addons/io_ms3d/ms3d_utils.py
Added: contrib/py/scripts/addons/io_ms3d/__README__.txt
===================================================================
--- contrib/py/scripts/addons/io_ms3d/__README__.txt (rev 0)
+++ contrib/py/scripts/addons/io_ms3d/__README__.txt 2011-12-01 10:56:15 UTC (rev 2692)
@@ -0,0 +1,147 @@
+# ##### 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 #####
+
+
+###############################################################################
+#234567890123456789012345678901234567890123456789012345678901234567890123456789
+#--------1---------2---------3---------4---------5---------6---------7---------
+# <pep8 compliant>
+
+
+# ##### BEGIN COPYRIGHT BLOCK #####
+#
+# initial script copyright (c)2011 Alexander Nussbaumer
+#
+# ##### END COPYRIGHT BLOCK #####
+
+
+files:
+__README__.txt
+__init__.py
+ms3d_export.py
+ms3d_import.py
+ms3d_spec.py
+ms3d_utils.py
+
+
+description:
+__README__.txt : this file
+ \xA7 Blender maintenance
+
+__init__.py : entry point for blender plugins
+ initialize and registers/unregisters plugin functions
+ \xA7 Blender maintenance
+
+ms3d_export.py : entry point for exporter
+ functions to bring Blender content in a correct way to MilkShape
+ \xA7 Blender maintenance
+ \xA7 Blender -> MilkShape3D maintenance
+
+ms3d_import.py : entry point for importer
+ functions to bring MilkShape content in a correct way to Blender
+ \xA7 Blender maintenance
+ \xA7 MilkShape3D -> Blender maintenance
+
+ms3d_spec.py : objects and structures that specified a MilkShape3D file
+ base functions to write/read its objects itself
+ \xA7 MilkShape maintenance
+
+ms3d_utils.py : most of the strings used in the addon to have a central point for optional internationalization
+ functions that are used by importer and exporter
+ \xA7 Blender maintenance
+ \xA7 Blender -> MilkShape3D maintenance
+ \xA7 MilkShape3D -> Blender maintenance
+
+
+known issues:
+ importer issues:
+ - does not import bones
+ - does not import joints
+ - does not import keyframes
+ - does not import comments (will never be supported - blender doesn't have similar stuff)
+
+ exporter issues:
+ - does only export the first existing material, if more than one material is used per mesh
+ - does only export the first existing UV texture coordinates, if more than one UV texture is used per mesh
+ - does not export bones
+ - does not export joints
+ - does not export keyframes
+ - does not export comments (will never be supported - blender doesn't have similar stuff)
+
+
+todo:
+- change internal data structure for more performance on searching vertex indices and double vertices
+- add support for bones and joints
+- add support for keyframes
+
+
+
+changelog:
+changed: (0, 3, 3, "beta (2011-12-01 00:00)")
+mod: if "name" in somedict: result = somedict["name"] to result = somedict.get("name") if result is not None: (comment by campbellbarton)
+
+
+changed: (0, 3, 3, "beta (2011-11-29 00:00)")
+mod: reuse existing data (now optional)
+fix: reuse existing data (now ignores data if library is not none)
+add: import process adds custom_properties with raw data (naming and some others, if expecting lost in translation)
+
+
+changed: (0, 3, 2, "beta (2011-11-27 00:00)")
+mod: mered ms3d_base.py to ms3d_utils.py (and droped ms3d_base.py)
+mod: moved exclusive importer stuff to ms3d_import.py (renamed BlenderFromMs3d... to ...)
+mod: moved exclusive exporter stuff to ms3d_export.py (renamed Ms3dFromBlender... to ...)
+fix: import object namings (keep track possible name collisions of ms3d and blender objects on non empty blender scenes - may have same names, but different content)
+add: import to group option
+
+changed: (0, 3, 1, "beta (2011-11-25 00:00)")
+dev: import bones (not finished yet)
+fix: import a material only once, if it is used many times
+fix: export materials (all meshes got the same material)
+fix: exception in verbose mode (on older ms3d versions with no extended datablocks)
+
+changed: (0, 3, 0, "beta 3b (2011-11-19 00:00)").
+mod: exception raise to pass the exception to the GUI
+fix: exception if mesh has no material
+add: import diffuse / alpha texture file to material (to material and uv texture)
+add: export diffuse / alpha texture file name from material (or diffuse from uv texture, if material does not have one)
+mod: metric setup on import (bigger clip end value)
+
+changed: (0, 2, 3, "beta_2a (2011-11-15 00:00)").
+add: viewport adjustment for import to metric
+mod: import / export scale; (reported by AtmanActive, Sun Nov 13, 2011 9:41 pm)
+fix: layer handling; bug (reported by AtmanActive, Sun Nov 13, 2011 9:41 pm)
+fix: all faces/vertices are now selected again after import
+
+changed: (0, 2, 201111112130, "beta_2").
+add: export smoothing groups (from linked faces)
+add: import smoothing groups (as linked faces)
+add: import groups (as meshes)
+fix: export ms3d_triangle_t.groupIndex
+add: mark optional part if not available (all value to "None")
+add: draw() for option makeup
+
+20111101
+changed: (0, 1, 201111011600).
+
+
+installation instruction:
+ - copy the "io_ms3d" folder to <Blender>/2.60/scripts/addons
+ - open blender
+ - File | User Preferences | Addons | Import-Export
+ - enable "Import-Export: MilkShape3D MS3D format (.ms3d)"
Added: contrib/py/scripts/addons/io_ms3d/__init__.py
===================================================================
--- contrib/py/scripts/addons/io_ms3d/__init__.py (rev 0)
+++ contrib/py/scripts/addons/io_ms3d/__init__.py 2011-12-01 10:56:15 UTC (rev 2692)
@@ -0,0 +1,129 @@
+# ##### 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 #####
+
+
+###############################################################################
+#234567890123456789012345678901234567890123456789012345678901234567890123456789
+#--------1---------2---------3---------4---------5---------6---------7---------
+# <pep8 compliant>
+
+
+# ##### BEGIN COPYRIGHT BLOCK #####
+#
+# initial script copyright (c)2011 Alexander Nussbaumer
+#
+# ##### END COPYRIGHT BLOCK #####
+
+
+# To support reload properly, try to access a package var, if it's there, reload everything
+if ("bpy" in locals()):
+ import imp
+ if "ms3d_export" in locals():
+ imp.reload(ms3d_export)
+ if "ms3d_import" in locals():
+ imp.reload(ms3d_import)
+ #if "ms3d_spec" in locals():
+ # imp.reload(ms3d_spec)
+ #if "ms3d_utils" in locals():
+ # imp.reload(ms3d_utils)
+ #print("MS3D-add-on Reloaded")
+ pass
+
+else:
+ from . import ms3d_export
+ from . import ms3d_import
+ #from . import ms3d_spec
+ #from . import ms3d_utils
+ #print("MS3D-add-on Imported")
+ pass
+
+
+#import blender stuff
+import bpy
+import bpy_extras
+
+
+bl_info = { \
+ "name": "MilkShape3D MS3D format (.ms3d)",
+ "description": "Import / Export MilkShape3D MS3D files (conform with v1.8.4)",
+ "author": "Alexander Nussbaumer",
+ "version": (0, 3, 3, "beta (2011-12-01 00:00)"),
+ "blender": (2, 6, 0),
+ "api": 41226,
+ "location": "File > Import-Export",
+ "warning": "imports and exports only geometry and material of ms3d file. (poor performance)",
+ "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Import-Export/MilkShape3D_MS3D",
+ "tracker_url": "",
+ "category": "Import-Export"
+ }
+
+
+#
+# DEBUG
+#
+def DEBUG_print(s):
+ if (ms3d_utils._DEBUG):
+ print("ms3d__init__.{0}".format(s))
+ pass
+
+
+###############################################################################
+# registration
+def menu_func_import(self, context):
+ #DEBUG_print("menu_func_import")
+ self.layout.operator(
+ ms3d_import.ImportMS3D.bl_idname,
+ text = ms3d_utils.TEXT_OPERATOR
+ )
+
+
+def menu_func_export(self, context):
+ #DEBUG_print("menu_func_export")
+ self.layout.operator(
+ ms3d_export.ExportMS3D.bl_idname,
+ text = ms3d_utils.TEXT_OPERATOR
+ )
+
+
+def register():
+ #DEBUG_print("register build{0}".format(bl_info["version"]))
+ bpy.utils.register_module(__name__)
+
+ bpy.types.INFO_MT_file_export.append(menu_func_export)
+ bpy.types.INFO_MT_file_import.append(menu_func_import)
+
+
+def unregister():
+ #DEBUG_print("unregister")
+ bpy.utils.unregister_module(__name__)
+
+ bpy.types.INFO_MT_file_export.remove(menu_func_export)
+ bpy.types.INFO_MT_file_import.remove(menu_func_import)
+
+
+###############################################################################
+# global entry point
+if (__name__ == "__main__"):
+ #DEBUG_print("__name__ == __main__")
+ register()
+
+
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list