Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--io_mesh_stl/__init__.py9
-rw-r--r--io_mesh_uv_layout/__init__.py74
-rw-r--r--io_scene_obj/__init__.py227
-rw-r--r--io_shape_mdd/__init__.py60
4 files changed, 282 insertions, 88 deletions
diff --git a/io_mesh_stl/__init__.py b/io_mesh_stl/__init__.py
index 48c37af4..e9788013 100644
--- a/io_mesh_stl/__init__.py
+++ b/io_mesh_stl/__init__.py
@@ -16,7 +16,7 @@
#
# ##### END GPL LICENSE BLOCK #####
-# <pep8 compliant>
+# <pep8-80 compliant>
bl_info = {
"name": "STL format",
@@ -27,8 +27,8 @@ bl_info = {
"location": "File > Import-Export > Stl",
"description": "Import-Export STL files",
"warning": "",
- "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/"\
- "Scripts/Import-Export/STL",
+ "wiki_url": ("http://wiki.blender.org/index.php/Extensions:2.5/Py/"
+ "Scripts/Import-Export/STL"),
"tracker_url": "https://projects.blender.org/tracker/index.php?"
"func=detail&aid=22837",
"support": 'OFFICIAL',
@@ -83,7 +83,8 @@ class ImportSTL(bpy.types.Operator, ImportHelper):
from . import stl_utils
from . import blender_utils
- paths = [os.path.join(self.directory, name.name) for name in self.files]
+ paths = [os.path.join(self.directory, name.name)
+ for name in self.files]
if not paths:
paths.append(self.filepath)
diff --git a/io_mesh_uv_layout/__init__.py b/io_mesh_uv_layout/__init__.py
index 363aff47..e7cf81ff 100644
--- a/io_mesh_uv_layout/__init__.py
+++ b/io_mesh_uv_layout/__init__.py
@@ -16,19 +16,19 @@
#
# ##### END GPL LICENSE BLOCK #####
-# <pep8 compliant>
+# <pep8-80 compliant>
bl_info = {
"name": "UV Layout",
"author": "Campbell Barton, Matt Ebb",
"version": (1, 0),
- "blender": (2, 5, 7),
+ "blender": (2, 5, 8),
"api": 35622,
"location": "Image-Window > UVs > Export UV Layout",
"description": "Export the UV layout as a 2D graphic",
"warning": "",
- "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/"\
- "Scripts/Import-Export/UV_Layout",
+ "wiki_url": ("http://wiki.blender.org/index.php/Extensions:2.5/Py/"
+ "Scripts/Import-Export/UV_Layout"),
"tracker_url": "https://projects.blender.org/tracker/index.php?"
"func=detail&aid=22837",
"support": 'OFFICIAL',
@@ -47,7 +47,12 @@ if "bpy" in locals():
import bpy
-from bpy.props import StringProperty, BoolProperty, EnumProperty, IntVectorProperty, FloatProperty
+from bpy.props import (StringProperty,
+ BoolProperty,
+ EnumProperty,
+ IntVectorProperty,
+ FloatProperty,
+ )
class ExportUVLayout(bpy.types.Operator):
@@ -57,18 +62,47 @@ class ExportUVLayout(bpy.types.Operator):
bl_label = "Export UV Layout"
bl_options = {'REGISTER', 'UNDO'}
- filepath = StringProperty(name="File Path", description="File path used for exporting the SVG file", maxlen=1024, default="", subtype='FILE_PATH')
- check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'})
- export_all = BoolProperty(name="All UV's", description="Export all UVs in this mesh (not just the visible ones)", default=False)
- mode = EnumProperty(items=(
- ('SVG', "Scalable Vector Graphic (.svg)", "Export the UV layout to a vector SVG file"),
- ('EPS', "Encapsulate PostScript (.eps)", "Export the UV layout to a vector EPS file"),
- ('PNG', "PNG Image (.png)", "Export the UV layout a bitmap image")),
- name="Format",
- description="File format to export the UV layout to",
- default='PNG')
- size = IntVectorProperty(size=2, default=(1024, 1024), min=8, max=32768, description="Dimensions of the exported file")
- opacity = FloatProperty(name="Fill Opacity", min=0.0, max=1.0, default=0.25)
+ filepath = StringProperty(
+ name="File Path",
+ description="File path used for exporting the SVG file",
+ maxlen=1024,
+ default="",
+ subtype='FILE_PATH',
+ )
+ check_existing = BoolProperty(
+ name="Check Existing",
+ description="Check and warn on overwriting existing files",
+ default=True,
+ options={'HIDDEN'},
+ )
+ export_all = BoolProperty(
+ name="All UV's",
+ description="Export all UVs in this mesh (not just visible ones)",
+ default=False,
+ )
+ mode = EnumProperty(
+ items=(('SVG', "Scalable Vector Graphic (.svg)",
+ "Export the UV layout to a vector SVG file"),
+ ('EPS', "Encapsulate PostScript (.eps)",
+ "Export the UV layout to a vector EPS file"),
+ ('PNG', "PNG Image (.png)",
+ "Export the UV layout a bitmap image"),
+ ),
+ name="Format",
+ description="File format to export the UV layout to",
+ default='PNG',
+ )
+ size = IntVectorProperty(
+ size=2,
+ default=(1024, 1024),
+ min=8, max=32768,
+ description="Dimensions of the exported file",
+ )
+ opacity = FloatProperty(
+ name="Fill Opacity",
+ min=0.0, max=1.0,
+ default=0.25,
+ )
@classmethod
def poll(cls, context):
@@ -117,7 +151,8 @@ class ExportUVLayout(bpy.types.Operator):
for i in range(uv_layer_len):
uv_elem = uv_layer[i]
# context checks
- if faces[i].select and (local_image is Ellipsis or local_image == uv_elem.image):
+ if faces[i].select and (local_image is Ellipsis or
+ local_image == uv_elem.image):
#~ uv = uv_elem.uv
#~ if False not in uv_elem.select_uv[:len(uv)]:
#~ yield (i, uv)
@@ -155,7 +190,8 @@ class ExportUVLayout(bpy.types.Operator):
from . import export_uv_svg
func = export_uv_svg.write
- func(fw, mesh, self.size[0], self.size[1], self.opacity, lambda: self._face_uv_iter(context))
+ func(fw, mesh, self.size[0], self.size[1], self.opacity,
+ lambda: self._face_uv_iter(context))
if is_editmode:
bpy.ops.object.mode_set(mode='EDIT', toggle=False)
diff --git a/io_scene_obj/__init__.py b/io_scene_obj/__init__.py
index cd8a855d..74a30293 100644
--- a/io_scene_obj/__init__.py
+++ b/io_scene_obj/__init__.py
@@ -16,23 +16,23 @@
#
# ##### END GPL LICENSE BLOCK #####
-# <pep8 compliant>
+# <pep8-80 compliant>
bl_info = {
"name": "Wavefront OBJ format",
"author": "Campbell Barton",
- "blender": (2, 5, 7),
+ "blender": (2, 5, 8),
"api": 35622,
"location": "File > Import-Export",
- "description": "Import-Export OBJ, Import OBJ mesh, UV's, materials and textures",
+ "description": ("Import-Export OBJ, Import OBJ mesh, UV's, "
+ "materials and textures"),
"warning": "",
- "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/"\
- "Scripts/Import-Export/Wavefront_OBJ",
+ "wiki_url": ("http://wiki.blender.org/index.php/Extensions:2.5/Py/"
+ "Scripts/Import-Export/Wavefront_OBJ"),
"tracker_url": "",
"support": 'OFFICIAL',
"category": "Import-Export"}
-# To support reload properly, try to access a package var, if it's there, reload everything
if "bpy" in locals():
import imp
if "import_obj" in locals():
@@ -42,8 +42,11 @@ if "bpy" in locals():
import bpy
-from bpy.props import BoolProperty, FloatProperty, StringProperty, EnumProperty
-
+from bpy.props import (BoolProperty,
+ FloatProperty,
+ StringProperty,
+ EnumProperty,
+ )
from bpy_extras.io_utils import (ExportHelper,
ImportHelper,
path_reference_mode,
@@ -59,27 +62,65 @@ class ImportOBJ(bpy.types.Operator, ImportHelper):
bl_options = {'PRESET'}
filename_ext = ".obj"
- filter_glob = StringProperty(default="*.obj;*.mtl", options={'HIDDEN'})
+ filter_glob = StringProperty(
+ default="*.obj;*.mtl",
+ options={'HIDDEN'},
+ )
- use_ngons = BoolProperty(name="NGons", description="Import faces with more then 4 verts as fgons", default=True)
- use_edges = BoolProperty(name="Lines", description="Import lines and faces with 2 verts as edge", default=True)
- use_smooth_groups = BoolProperty(name="Smooth Groups", description="Surround smooth groups by sharp edges", default=True)
+ use_ngons = BoolProperty(
+ name="NGons",
+ description="Import faces with more then 4 verts as fgons",
+ default=True,
+ )
+ use_edges = BoolProperty(
+ name="Lines",
+ description="Import lines and faces with 2 verts as edge",
+ default=True,
+ )
+ use_smooth_groups = BoolProperty(
+ name="Smooth Groups",
+ description="Surround smooth groups by sharp edges",
+ default=True,
+ )
- use_split_objects = BoolProperty(name="Object", description="Import OBJ Objects into Blender Objects", default=True)
- use_split_groups = BoolProperty(name="Group", description="Import OBJ Groups into Blender Objects", default=True)
+ use_split_objects = BoolProperty(
+ name="Object",
+ description="Import OBJ Objects into Blender Objects",
+ default=True,
+ )
+ use_split_groups = BoolProperty(
+ name="Group",
+ description="Import OBJ Groups into Blender Objects",
+ default=True,
+ )
- use_groups_as_vgroups = BoolProperty(name="Poly Groups", description="Import OBJ groups as vertex groups.", default=False)
+ use_groups_as_vgroups = BoolProperty(
+ name="Poly Groups",
+ description="Import OBJ groups as vertex groups.",
+ default=False,
+ )
- use_image_search = BoolProperty(name="Image Search", description="Search subdirs for any assosiated images (Warning, may be slow)", default=True)
+ use_image_search = BoolProperty(
+ name="Image Search",
+ description=("Search subdirs for any assosiated images "
+ "(Warning, may be slow)"),
+ default=True,
+ )
split_mode = EnumProperty(
name="Split",
items=(('ON', "Split", "Split geometry, omits unused verts"),
- ('OFF', "Keep Vert Order", "Maintain vertex order from file"),
+ ('OFF', "Keep Vert Order", "Keep vertex order from file"),
),
)
- global_clamp_size = FloatProperty(name="Clamp Scale", description="Clamp the size to this maximum (Zero to Disable)", min=0.0, max=1000.0, soft_min=0.0, soft_max=1000.0, default=0.0)
+ global_clamp_size = FloatProperty(
+ name="Clamp Scale",
+ description="Clamp the size to this maximum (Zero to Disable)",
+ min=0.0, max=1000.0,
+ soft_min=0.0, soft_max=1000.0,
+ default=0.0,
+ )
axis_forward = EnumProperty(
name="Forward",
items=(('X', "X Forward", ""),
@@ -104,9 +145,6 @@ class ImportOBJ(bpy.types.Operator, ImportHelper):
default='Y',
)
- # fake prop, only disables split.
- # keep_vertex_order = BoolProperty(name="Keep Vert Order", description="Keep vert and face order, disables split options, enable for morph targets", default= True)
-
def check(self, context):
return axis_conversion_ensure(self, "axis_forward", "axis_up")
@@ -120,9 +158,15 @@ class ImportOBJ(bpy.types.Operator, ImportHelper):
else:
self.use_groups_as_vgroups = False
- keywords = self.as_keywords(ignore=("axis_forward", "axis_up", "filter_glob", "split_mode"))
+ keywords = self.as_keywords(ignore=("axis_forward",
+ "axis_up",
+ "filter_glob",
+ "split_mode",
+ ))
- global_matrix = axis_conversion(from_forward=self.axis_forward, from_up=self.axis_up).to_4x4()
+ global_matrix = axis_conversion(from_forward=self.axis_forward,
+ from_up=self.axis_up,
+ ).to_4x4()
keywords["global_matrix"] = global_matrix
return import_obj.load(self, context, **keywords)
@@ -164,37 +208,110 @@ class ExportOBJ(bpy.types.Operator, ExportHelper):
bl_options = {'PRESET'}
filename_ext = ".obj"
- filter_glob = StringProperty(default="*.obj;*.mtl", options={'HIDDEN'})
+ filter_glob = StringProperty(
+ default="*.obj;*.mtl",
+ options={'HIDDEN'},
+ )
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
# context group
- use_selection = BoolProperty(name="Selection Only", description="Export selected objects only", default=False)
- use_all_scenes = BoolProperty(name="All Scenes", description="", default=False)
- use_animation = BoolProperty(name="Animation", description="", default=False)
+ use_selection = BoolProperty(
+ name="Selection Only",
+ description="Export selected objects only",
+ default=False,
+ )
+ use_all_scenes = BoolProperty(
+ name="All Scenes",
+ description="",
+ default=False,
+ )
+ use_animation = BoolProperty(
+ name="Animation",
+ description="",
+ default=False,
+ )
# object group
- use_apply_modifiers = BoolProperty(name="Apply Modifiers", description="Apply modifiers (preview resolution)", default=True)
+ use_apply_modifiers = BoolProperty(
+ name="Apply Modifiers",
+ description="Apply modifiers (preview resolution)",
+ default=True,
+ )
# extra data group
- use_edges = BoolProperty(name="Edges", description="", default=True)
- use_normals = BoolProperty(name="Normals", description="", default=False)
- use_hq_normals = BoolProperty(name="High Quality Normals", description="", default=True)
- use_uvs = BoolProperty(name="UVs", description="", default=True)
- use_materials = BoolProperty(name="Materials", description="", default=True)
- # copy_images = BoolProperty(name="Copy Images", description="", default=False)
- use_triangles = BoolProperty(name="Triangulate", description="", default=False)
- use_vertex_groups = BoolProperty(name="Polygroups", description="", default=False)
- use_nurbs = BoolProperty(name="Nurbs", description="", default=False)
+ use_edges = BoolProperty(
+ name="Edges",
+ description="",
+ default=True,
+ )
+ use_normals = BoolProperty(
+ name="Normals",
+ description="",
+ default=False,
+ )
+ use_hq_normals = BoolProperty(
+ name="High Quality Normals",
+ description="",
+ default=True,
+ )
+ use_uvs = BoolProperty(
+ name="UVs",
+ description="",
+ default=True,
+ )
+ use_materials = BoolProperty(
+ name="Materials",
+ description="",
+ default=True,
+ )
+ use_triangles = BoolProperty(
+ name="Triangulate",
+ description="",
+ default=False,
+ )
+ use_vertex_groups = BoolProperty(
+ name="Polygroups",
+ description="",
+ default=False,
+ )
+ use_nurbs = BoolProperty(
+ name="Nurbs",
+ description="",
+ default=False,
+ )
# grouping group
- use_blen_objects = BoolProperty(name="Objects as OBJ Objects", description="", default=True)
- group_by_object = BoolProperty(name="Objects as OBJ Groups ", description="", default=False)
- group_by_material = BoolProperty(name="Material Groups", description="", default=False)
- keep_vertex_order = BoolProperty(name="Keep Vertex Order", description="", default=False)
+ use_blen_objects = BoolProperty(
+ name="Objects as OBJ Objects",
+ description="",
+ default=True,
+ )
+ group_by_object = BoolProperty(
+ name="Objects as OBJ Groups ",
+ description="",
+ default=False,
+ )
+ group_by_material = BoolProperty(
+ name="Material Groups",
+ description="",
+ default=False,
+ )
+ keep_vertex_order = BoolProperty(
+ name="Keep Vertex Order",
+ description="",
+ default=False,
+ )
- global_scale = FloatProperty(name="Scale", description="Scale all data, (Note! some imports dont support scaled armatures)", min=0.01, max=1000.0, soft_min=0.01, soft_max=1000.0, default=1.0)
+ global_scale = FloatProperty(
+ name="Scale",
+ description="Scale all data",
+ min=0.01, max=1000.0,
+ soft_min=0.01,
+ soft_max=1000.0,
+ default=1.0,
+ )
axis_forward = EnumProperty(
name="Forward",
@@ -229,11 +346,24 @@ class ExportOBJ(bpy.types.Operator, ExportHelper):
from . import export_obj
from mathutils import Matrix
- keywords = self.as_keywords(ignore=("axis_forward", "axis_up", "global_scale", "check_existing", "filter_glob"))
+ keywords = self.as_keywords(ignore=("axis_forward",
+ "axis_up",
+ "global_scale",
+ "check_existing",
+ "filter_glob",
+ ))
global_matrix = Matrix()
- global_matrix[0][0] = global_matrix[1][1] = global_matrix[2][2] = self.global_scale
- global_matrix = global_matrix * axis_conversion(to_forward=self.axis_forward, to_up=self.axis_up).to_4x4()
+
+ global_matrix[0][0] = \
+ global_matrix[1][1] = \
+ global_matrix[2][2] = self.global_scale
+
+ global_matrix = (global_matrix *
+ axis_conversion(to_forward=self.axis_forward,
+ to_up=self.axis_up,
+ ).to_4x4())
+
keywords["global_matrix"] = global_matrix
return export_obj.save(self, context, **keywords)
@@ -259,12 +389,5 @@ def unregister():
bpy.types.INFO_MT_file_import.remove(menu_func_import)
bpy.types.INFO_MT_file_export.remove(menu_func_export)
-
-# CONVERSION ISSUES
-# - matrix problem
-# - duplis - only tested dupliverts
-# - all scenes export
-# + normals calculation
-
if __name__ == "__main__":
register()
diff --git a/io_shape_mdd/__init__.py b/io_shape_mdd/__init__.py
index bc195735..ff8d7308 100644
--- a/io_shape_mdd/__init__.py
+++ b/io_shape_mdd/__init__.py
@@ -26,13 +26,12 @@ bl_info = {
"location": "File > Import-Export",
"description": "Import-Export MDD as mesh shape keys",
"warning": "",
- "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/"\
- "Scripts/Import-Export/NewTek_OBJ",
+ "wiki_url": ("http://wiki.blender.org/index.php/Extensions:2.5/Py/"
+ "Scripts/Import-Export/NewTek_OBJ"),
"tracker_url": "",
"support": 'OFFICIAL',
"category": "Import-Export"}
-# To support reload properly, try to access a package var, if it's there, reload everything
if "bpy" in locals():
import imp
if "import_mdd" in locals():
@@ -52,10 +51,22 @@ class ImportMDD(bpy.types.Operator, ImportHelper):
bl_label = "Import MDD"
filename_ext = ".mdd"
- filter_glob = StringProperty(default="*.mdd", options={'HIDDEN'})
- frame_start = IntProperty(name="Start Frame", description="Start frame for inserting animation", min=-300000, max=300000, default=0)
- frame_step = IntProperty(name="Step", min=1, max=1000, default=1)
+ filter_glob = StringProperty(
+ default="*.mdd",
+ options={'HIDDEN'},
+ )
+ frame_start = IntProperty(
+ name="Start Frame",
+ description="Start frame for inserting animation",
+ min=-300000, max=300000,
+ default=0,
+ )
+ frame_step = IntProperty(
+ name="Step",
+ min=1, max=1000,
+ default=1,
+ )
@classmethod
def poll(cls, context):
@@ -69,8 +80,10 @@ class ImportMDD(bpy.types.Operator, ImportHelper):
if not self.frame_start:
self.frame_start = scene.frame_current
+ keywords = self.as_keywords(ignore=("filter_glob",))
+
from . import import_mdd
- return import_mdd.load(self, context, **self.as_keywords(ignore=("filter_glob",)))
+ return import_mdd.load(self, context, **keywords)
class ExportMDD(bpy.types.Operator, ExportHelper):
@@ -90,9 +103,24 @@ class ExportMDD(bpy.types.Operator, ExportHelper):
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
- fps = IntProperty(name="Frames Per Second", description="Number of frames/second", min=minfps, max=maxfps, default=25)
- frame_start = IntProperty(name="Start Frame", description="Start frame for baking", min=minframe, max=maxframe, default=1)
- frame_end = IntProperty(name="End Frame", description="End frame for baking", min=minframe, max=maxframe, default=250)
+ fps = IntProperty(
+ name="Frames Per Second",
+ description="Number of frames/second",
+ min=minfps, max=maxfps,
+ default=25,
+ )
+ frame_start = IntProperty(
+ name="Start Frame",
+ description="Start frame for baking",
+ min=minframe, max=maxframe,
+ default=1,
+ )
+ frame_end = IntProperty(
+ name="End Frame",
+ description="End frame for baking",
+ min=minframe, max=maxframe,
+ default=250,
+ )
@classmethod
def poll(cls, context):
@@ -109,16 +137,22 @@ class ExportMDD(bpy.types.Operator, ExportHelper):
if not self.fps:
self.fps = scene.render.fps
+ keywords = self.as_keywords(ignore=("check_existing", "filter_glob"))
+
from . import export_mdd
- return export_mdd.save(self, context, **self.as_keywords(ignore=("check_existing", "filter_glob")))
+ return export_mdd.save(self, context, **keywords)
def menu_func_import(self, context):
- self.layout.operator(ImportMDD.bl_idname, text="Lightwave Point Cache (.mdd)")
+ self.layout.operator(ImportMDD.bl_idname,
+ text="Lightwave Point Cache (.mdd)",
+ )
def menu_func_export(self, context):
- self.layout.operator(ExportMDD.bl_idname, text="Lightwave Point Cache (.mdd)")
+ self.layout.operator(ExportMDD.bl_idname,
+ text="Lightwave Point Cache (.mdd)",
+ )
def register():