[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [1228] trunk/py/scripts/addons: SVN maintenance.
gsr b3d
gsr.b3d at infernal-iceberg.com
Sun Dec 5 00:11:29 CET 2010
Revision: 1228
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-extensions&revision=1228
Author: gsrb3d
Date: 2010-12-05 00:11:29 +0100 (Sun, 05 Dec 2010)
Log Message:
-----------
SVN maintenance.
Modified Paths:
--------------
trunk/py/scripts/addons/io_export_anim_mesh_xna/__init__.py
trunk/py/scripts/addons/io_export_anim_mesh_xna/export_xna.py
trunk/py/scripts/addons/io_export_directx_x.py
Property Changed:
----------------
trunk/py/scripts/addons/io_export_anim_mesh_xna/__init__.py
trunk/py/scripts/addons/io_export_anim_mesh_xna/export_xna.py
Modified: trunk/py/scripts/addons/io_export_anim_mesh_xna/__init__.py
===================================================================
--- trunk/py/scripts/addons/io_export_anim_mesh_xna/__init__.py 2010-12-04 10:38:27 UTC (rev 1227)
+++ trunk/py/scripts/addons/io_export_anim_mesh_xna/__init__.py 2010-12-04 23:11:29 UTC (rev 1228)
@@ -1,85 +1,85 @@
-bl_addon_info = {
- "name": "Blender to XNA",
- "author": "John C Brown, JCBDigger (@MistyManor)",
- "version": (1,1),
- "blender": (2, 5, 5),
- "api": 32738,
- "location": "File > Export > XNA FBX Animated Model",
- "description": "Export the model and animations for use in XNA",
- "warning": "",
- "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/File_I-O/Blender-toXNA",
- "tracker_url": "https://projects.blender.org/tracker/index.php?func=detail&aid=25013&group_id=153&atid=469",
- "category": "Import/Export"}
-
-# ***** 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 on the GNU web site for full
-# details: http://www.gnu.org/licenses/gpl.html
-#
-# ***** END GPL LICENCE BLOCK *****
-
-# This script uses spaces for indents NOT tabs.
-"""
-Blender to XNA
-
-http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/File_I-O/Blender-toXNA
-"""
-
-# To support reload properly, try to access a package var, if it's there, reload everything
-if "bpy" in locals():
- import sys
- reload(sys.modules.get("io_export_anim_mesh_xna.export_xna", sys))
-
-import bpy
-
-# Add each additional script in a simlar block to this
-def menu_export_fbx_model(self, context):
- from io_export_anim_mesh_xna import export_xna
- import os
- default_path = os.path.splitext(bpy.data.filepath)[0] + ".fbx"
- self.layout.operator(export_xna.ExportFBXmodel.bl_idname, text="XNA FBX Model only (.fbx)").filepath = default_path
-
-def menu_export_fbx_takes(self, context):
- from io_export_anim_mesh_xna import export_xna
- import os
- # get the current action name
- currentAction = ""
- for arm_obj in bpy.context.scene.objects:
- if arm_obj.type == 'ARMATURE':
- if arm_obj.animation_data:
- if currentAction == "":
- currentAction = arm_obj.animation_data.action.name
-
- default_path = os.path.splitext(bpy.data.filepath)[0] + "-" + currentAction + ".fbx"
- self.layout.operator(export_xna.ExportFBXtakes.bl_idname, text="XNA FBX Animations only (.fbx)").filepath = default_path
-
-def menu_export_fbx_animated(self, context):
- from io_export_anim_mesh_xna import export_xna
- import os
- default_path = os.path.splitext(bpy.data.filepath)[0] + ".fbx"
- self.layout.operator(export_xna.ExportFBXanimated.bl_idname, text="XNA FBX Animated Model (.fbx)").filepath = default_path
-
-
-# Add references to all scripts invoked by this class
-def register():
- bpy.types.INFO_MT_file_export.append(menu_export_fbx_animated)
- bpy.types.INFO_MT_file_export.append(menu_export_fbx_model)
- bpy.types.INFO_MT_file_export.append(menu_export_fbx_takes)
-
-# Add references to all scripts invoked by this class
-def unregister():
- bpy.types.INFO_MT_file_export.remove(menu_export_fbx_animated)
- bpy.types.INFO_MT_file_export.remove(menu_export_fbx_model)
- bpy.types.INFO_MT_file_export.remove(menu_export_fbx_takes)
-
-if __name__ == "__main__":
- register()
+bl_addon_info = {
+ "name": "Blender to XNA",
+ "author": "John C Brown, JCBDigger (@MistyManor)",
+ "version": (1,1),
+ "blender": (2, 5, 5),
+ "api": 32738,
+ "location": "File > Export > XNA FBX Animated Model",
+ "description": "Export the model and animations for use in XNA",
+ "warning": "",
+ "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/File_I-O/Blender-toXNA",
+ "tracker_url": "https://projects.blender.org/tracker/index.php?func=detail&aid=25013&group_id=153&atid=469",
+ "category": "Import/Export"}
+
+# ***** 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 on the GNU web site for full
+# details: http://www.gnu.org/licenses/gpl.html
+#
+# ***** END GPL LICENCE BLOCK *****
+
+# This script uses spaces for indents NOT tabs.
+"""
+Blender to XNA
+
+http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/File_I-O/Blender-toXNA
+"""
+
+# To support reload properly, try to access a package var, if it's there, reload everything
+if "bpy" in locals():
+ import sys
+ reload(sys.modules.get("io_export_anim_mesh_xna.export_xna", sys))
+
+import bpy
+
+# Add each additional script in a simlar block to this
+def menu_export_fbx_model(self, context):
+ from io_export_anim_mesh_xna import export_xna
+ import os
+ default_path = os.path.splitext(bpy.data.filepath)[0] + ".fbx"
+ self.layout.operator(export_xna.ExportFBXmodel.bl_idname, text="XNA FBX Model only (.fbx)").filepath = default_path
+
+def menu_export_fbx_takes(self, context):
+ from io_export_anim_mesh_xna import export_xna
+ import os
+ # get the current action name
+ currentAction = ""
+ for arm_obj in bpy.context.scene.objects:
+ if arm_obj.type == 'ARMATURE':
+ if arm_obj.animation_data:
+ if currentAction == "":
+ currentAction = arm_obj.animation_data.action.name
+
+ default_path = os.path.splitext(bpy.data.filepath)[0] + "-" + currentAction + ".fbx"
+ self.layout.operator(export_xna.ExportFBXtakes.bl_idname, text="XNA FBX Animations only (.fbx)").filepath = default_path
+
+def menu_export_fbx_animated(self, context):
+ from io_export_anim_mesh_xna import export_xna
+ import os
+ default_path = os.path.splitext(bpy.data.filepath)[0] + ".fbx"
+ self.layout.operator(export_xna.ExportFBXanimated.bl_idname, text="XNA FBX Animated Model (.fbx)").filepath = default_path
+
+
+# Add references to all scripts invoked by this class
+def register():
+ bpy.types.INFO_MT_file_export.append(menu_export_fbx_animated)
+ bpy.types.INFO_MT_file_export.append(menu_export_fbx_model)
+ bpy.types.INFO_MT_file_export.append(menu_export_fbx_takes)
+
+# Add references to all scripts invoked by this class
+def unregister():
+ bpy.types.INFO_MT_file_export.remove(menu_export_fbx_animated)
+ bpy.types.INFO_MT_file_export.remove(menu_export_fbx_model)
+ bpy.types.INFO_MT_file_export.remove(menu_export_fbx_takes)
+
+if __name__ == "__main__":
+ register()
Property changes on: trunk/py/scripts/addons/io_export_anim_mesh_xna/__init__.py
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/py/scripts/addons/io_export_anim_mesh_xna/export_xna.py
===================================================================
--- trunk/py/scripts/addons/io_export_anim_mesh_xna/export_xna.py 2010-12-04 10:38:27 UTC (rev 1227)
+++ trunk/py/scripts/addons/io_export_anim_mesh_xna/export_xna.py 2010-12-04 23:11:29 UTC (rev 1228)
@@ -1,3017 +1,3017 @@
-# ***** 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 on the GNU web site for full
-# details: http://www.gnu.org/licenses/gpl.html
-#
-# ***** END GPL LICENCE BLOCK *****
-
-# This script uses spaces for indents NOT tabs.
-# Developer comments at the end of the file
-
-"""
-Blender to XNA
-
-This script is an exporter to the Autodesk FBX file format suitable for use with Microsoft XNA.
-
-http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/File_I-O/Blender-toXNA
-"""
-
-import os
-import time
-import math # math.pi
-import shutil # for file copying
-
-import bpy
-from mathutils import Vector, Euler, Matrix
-
-# I guess FBX uses degrees instead of radians (Arystan).
-# Call this function just before writing to FBX.
-def eulerRadToDeg(eul):
- ret = Euler()
-
- ret.x = 180 / math.pi * eul[0]
- ret.y = 180 / math.pi * eul[1]
- ret.z = 180 / math.pi * eul[2]
-
- return ret
-
-# Used to add the scene name into the filepath without using odd chars
-sane_name_mapping_ob = {}
-sane_name_mapping_mat = {}
-sane_name_mapping_tex = {}
-sane_name_mapping_take = {}
-sane_name_mapping_group = {}
-
-# Make sure reserved names are not used
-sane_name_mapping_ob['Scene'] = 'Scene_'
-sane_name_mapping_ob['blend_root'] = 'blend_root_'
-
-def increment_string(t):
- name = t
- num = ''
- while name and name[-1].isdigit():
- num = name[-1] + num
- name = name[:-1]
- if num: return '%s%d' % (name, int(num)+1)
- else: return name + '_0'
-
-
-
-# TODO - Disallow the name 'Scene' - it will bugger things up.
-# 'Blend_Root' is no longer used so it does not matter (JCB)
-def sane_name(data, dct):
- #if not data: return None
-
- if type(data)==tuple: # materials are paired up with images
- data, other = data
- use_other = True
- else:
- other = None
- use_other = False
-
- if data: name = data.name
- else: name = None
- orig_name = name
-
- if other:
- orig_name_other = other.name
- name = '%s #%s' % (name, orig_name_other)
- else:
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list