[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [4361] trunk/py/scripts/addons: rename vrml2 addon since it now exports multiple meshes
Campbell Barton
ideasman42 at gmail.com
Tue Mar 12 07:59:38 CET 2013
Revision: 4361
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=4361
Author: campbellbarton
Date: 2013-03-12 06:59:38 +0000 (Tue, 12 Mar 2013)
Log Message:
-----------
rename vrml2 addon since it now exports multiple meshes
Added Paths:
-----------
trunk/py/scripts/addons/io_scene_vrml2/
trunk/py/scripts/addons/io_scene_vrml2/__init__.py
trunk/py/scripts/addons/io_scene_vrml2/export_vrml2.py
Removed Paths:
-------------
trunk/py/scripts/addons/io_mesh_vrml2/
trunk/py/scripts/addons/io_scene_vrml2/__init__.py
trunk/py/scripts/addons/io_scene_vrml2/export_vrml2.py
Deleted: trunk/py/scripts/addons/io_scene_vrml2/__init__.py
===================================================================
--- trunk/py/scripts/addons/io_mesh_vrml2/__init__.py 2013-03-11 11:14:35 UTC (rev 4348)
+++ trunk/py/scripts/addons/io_scene_vrml2/__init__.py 2013-03-12 06:59:38 UTC (rev 4361)
@@ -1,110 +0,0 @@
-# ##### 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 #####
-
-# <pep8-80 compliant>
-
-bl_info = {
- "name": "VRML2 (Virtual Reality Modeling Language)",
- "author": "Campbell Barton",
- "blender": (2, 66, 0),
- "location": "File > Export",
- "description": "Exports the active mesh object to VRML2, supporting vertex and material colors",
- "warning": "",
- "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
- "Scripts/Import-Export/VRML2",
- "tracker_url": "",
- "support": 'OFFICIAL',
- "category": "Import-Export"}
-
-if "bpy" in locals():
- import imp
- if "export_vrml2" in locals():
- imp.reload(export_vrml2)
-
-
-import os
-import bpy
-from bpy.props import CollectionProperty, StringProperty, BoolProperty, EnumProperty
-from bpy_extras.io_utils import ExportHelper
-
-class ExportPLY(bpy.types.Operator, ExportHelper):
- """Export a single object as a Stanford PLY with normals, """ \
- """colors and texture coordinates"""
- bl_idname = "export_mesh.ply"
- bl_label = "Export PLY"
-
- filename_ext = ".ply"
- filter_glob = StringProperty(default="*.ply", options={'HIDDEN'})
-
- use_mesh_modifiers = BoolProperty(
- name="Apply Modifiers",
- description="Apply Modifiers to the exported mesh",
- default=True,
- )
- use_colors = BoolProperty(
- name="Vertex Colors",
- description="Export the active vertex color layer",
- default=True)
- color_type = EnumProperty(
- name='Color',
- items=(
- ('MATERIAL', "Material Color", ""),
- ('VERTEX', "Vertex Color", "")),
- default='MATERIAL',
- )
-
- @classmethod
- def poll(cls, context):
- obj = context.active_object
- return (obj is not None) and obj.type == 'MESH'
-
- def execute(self, context):
- filepath = self.filepath
- filepath = bpy.path.ensure_ext(filepath, self.filename_ext)
- from . import export_vrml2
- keywords = self.as_keywords(ignore=("check_existing", "filter_glob"))
- return export_vrml2.save(self, context, **keywords)
-
- def draw(self, context):
- layout = self.layout
-
- row = layout.row()
- row.prop(self, "use_mesh_modifiers")
- row.prop(self, "use_colors")
- row = layout.row()
- row.active = self.use_colors
- row.prop(self, "color_type")
-
-
-def menu_func_export(self, context):
- self.layout.operator(ExportPLY.bl_idname, text="VRML2 (.wrl)")
-
-
-def register():
- bpy.utils.register_module(__name__)
-
- bpy.types.INFO_MT_file_export.append(menu_func_export)
-
-
-def unregister():
- bpy.utils.unregister_module(__name__)
-
- bpy.types.INFO_MT_file_export.remove(menu_func_export)
-
-if __name__ == "__main__":
- register()
Copied: trunk/py/scripts/addons/io_scene_vrml2/__init__.py (from rev 4360, trunk/py/scripts/addons/io_mesh_vrml2/__init__.py)
===================================================================
--- trunk/py/scripts/addons/io_scene_vrml2/__init__.py (rev 0)
+++ trunk/py/scripts/addons/io_scene_vrml2/__init__.py 2013-03-12 06:59:38 UTC (rev 4361)
@@ -0,0 +1,128 @@
+# ##### 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 #####
+
+# <pep8-80 compliant>
+
+bl_info = {
+ "name": "VRML2 (Virtual Reality Modeling Language)",
+ "author": "Campbell Barton",
+ "blender": (2, 66, 0),
+ "location": "File > Export",
+ "description": "Exports the active mesh object to VRML2, supporting vertex and material colors",
+ "warning": "",
+ "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
+ "Scripts/Import-Export/VRML2",
+ "tracker_url": "",
+ "support": 'OFFICIAL',
+ "category": "Import-Export"}
+
+if "bpy" in locals():
+ import imp
+ if "export_vrml2" in locals():
+ imp.reload(export_vrml2)
+
+
+import os
+import bpy
+from bpy.props import CollectionProperty, StringProperty, BoolProperty, EnumProperty
+from bpy_extras.io_utils import ExportHelper, path_reference_mode
+
+class ExportVRML(bpy.types.Operator, ExportHelper):
+ """Export a single object as a VRML2, """ \
+ """colors and texture coordinates"""
+ bl_idname = "export_mesh.vrml2"
+ bl_label = "Export VRML2"
+
+ filename_ext = ".wrl"
+ filter_glob = StringProperty(default="*.wrl", options={'HIDDEN'})
+
+ use_selection = BoolProperty(
+ name="Selection Only",
+ description="Export selected objects only",
+ default=False,
+ )
+
+ use_mesh_modifiers = BoolProperty(
+ name="Apply Modifiers",
+ description="Apply Modifiers to the exported mesh",
+ default=True,
+ )
+ use_color = BoolProperty(
+ name="Vertex Colors",
+ description="Export the active vertex color layer",
+ default=True,
+ )
+ color_type = EnumProperty(
+ name='Color',
+ items=(
+ ('MATERIAL', "Material Color", ""),
+ ('VERTEX', "Vertex Color", "")),
+ default='MATERIAL',
+ )
+ use_uv = BoolProperty(
+ name="Texture/UVs",
+ description="Export the active texture and UV coords",
+ default=True,
+ )
+
+ path_mode = path_reference_mode
+
+ @classmethod
+ def poll(cls, context):
+ obj = context.active_object
+ return (obj is not None) and obj.type == 'MESH'
+
+ def execute(self, context):
+ filepath = self.filepath
+ filepath = bpy.path.ensure_ext(filepath, self.filename_ext)
+ from . import export_vrml2
+ keywords = self.as_keywords(ignore=("check_existing", "filter_glob"))
+ return export_vrml2.save(self, context, **keywords)
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.prop(self, "use_selection")
+ layout.prop(self, "use_mesh_modifiers")
+
+ row = layout.row()
+ row.prop(self, "use_uv")
+ row.prop(self, "use_color")
+ row = layout.row()
+ row.active = self.use_color
+ row.prop(self, "color_type")
+ layout.prop(self, "path_mode")
+
+
+def menu_func_export(self, context):
+ self.layout.operator(ExportVRML.bl_idname, text="VRML2 (.wrl)")
+
+
+def register():
+ bpy.utils.register_module(__name__)
+
+ bpy.types.INFO_MT_file_export.append(menu_func_export)
+
+
+def unregister():
+ bpy.utils.unregister_module(__name__)
+
+ bpy.types.INFO_MT_file_export.remove(menu_func_export)
+
+if __name__ == "__main__":
+ register()
Deleted: trunk/py/scripts/addons/io_scene_vrml2/export_vrml2.py
===================================================================
--- trunk/py/scripts/addons/io_mesh_vrml2/export_vrml2.py 2013-03-11 11:14:35 UTC (rev 4348)
+++ trunk/py/scripts/addons/io_scene_vrml2/export_vrml2.py 2013-03-12 06:59:38 UTC (rev 4361)
@@ -1,156 +0,0 @@
-# ##### 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 #####
-
-# <pep8-80 compliant>
-
-import bpy
-import bmesh
-
-def save_bmesh(fw, bm, use_color, color_type, material_colors):
- fw('#VRML V2.0 utf8\n')
- fw('#modeled using blender3d http://blender.org\n')
- fw('Shape {\n')
- fw('\tappearance Appearance {\n')
- fw('\t\tmaterial Material {\n')
- fw('\t\t}\n') # end 'Material'
- fw('\t}\n') # end 'Appearance'
-
- fw('\tgeometry IndexedFaceSet {\n')
- fw('\t\tcoord Coordinate {\n')
- fw('\t\t\tpoint [ ')
- v = None
- for v in bm.verts:
- fw("%.6f %.6f %.6f " % v.co[:])
- del v
- fw(']\n') # end 'point[]'
- fw('\t\t}\n') # end 'Coordinate'
-
- if use_color:
- if color_type == 'MATERIAL':
- fw('\t\tcolorPerVertex FALSE\n')
- fw('\t\tcolor Color {\n')
- fw('\t\t\tcolor [ ')
- c = None
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list