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:
authormeta-androcto <meta.androcto1@gmail.com>2017-05-17 07:50:10 +0300
committermeta-androcto <meta.androcto1@gmail.com>2017-05-17 07:50:10 +0300
commit28b4de5f0ce8953a0f8aed038b946a60078ba343 (patch)
tree774f34276da0db88a1595591098883cf7a527aeb /mesh_auto_mirror.py
parent09dc2339d44728bbca0954aef0e1b0b1f9e2c018 (diff)
mesh auto mirror, clean up line length
Diffstat (limited to 'mesh_auto_mirror.py')
-rw-r--r--mesh_auto_mirror.py74
1 files changed, 48 insertions, 26 deletions
diff --git a/mesh_auto_mirror.py b/mesh_auto_mirror.py
index 50986b23..84128072 100644
--- a/mesh_auto_mirror.py
+++ b/mesh_auto_mirror.py
@@ -24,26 +24,46 @@ bl_info = {
import bpy
from mathutils import Vector
-bpy.types.Scene.AutoMirror_axis = bpy.props.EnumProperty(items = [("x", "X", "", 1),
- ("y", "Y", "", 2),
- ("z", "Z", "", 3)],
- description="Axis used by the mirror modifier")
-bpy.types.Scene.AutoMirror_orientation = bpy.props.EnumProperty(items = [("positive","Positive", "", 1),
- ("negative", "Negative", "", 2)],
- description="Choose the side along the axis of the editable part (+/- coordinates)")
-bpy.types.Scene.AutoMirror_threshold = bpy.props.FloatProperty(default= 0.001,
- min= 0.001,
- description="Vertices closer than this distance are merged on the loopcut")
-bpy.types.Scene.AutoMirror_toggle_edit = bpy.props.BoolProperty(default= True,
- description="If not in edit mode, change mode to edit")
-bpy.types.Scene.AutoMirror_cut = bpy.props.BoolProperty(default= True,
- description="If enabeled, cut the mesh in two parts and mirror it. If not, just make a loopcut")
-bpy.types.Scene.AutoMirror_clipping = bpy.props.BoolProperty(default=True)
-bpy.types.Scene.AutoMirror_use_clip = bpy.props.BoolProperty(default=True,
- description="Use clipping for the mirror modifier")
-bpy.types.Scene.AutoMirror_show_on_cage = bpy.props.BoolProperty(default=True,
- description="Enable to edit the cage (it's the classical modifier's option)")
-bpy.types.Scene.AutoMirror_apply_mirror = bpy.props.BoolProperty(description="Apply the mirror modifier (useful to symmetrise the mesh)")
+bpy.types.Scene.AutoMirror_axis = bpy.props.EnumProperty(
+ items = [
+ ("x", "X", "", 1),
+ ("y", "Y", "", 2),
+ ("z", "Z", "", 3)],
+ description="Axis used by the mirror modifier"
+ )
+bpy.types.Scene.AutoMirror_orientation = bpy.props.EnumProperty(
+ items = [
+ ("positive","Positive", "", 1),
+ ("negative", "Negative", "", 2)],
+ description="Choose the side along the axis of the editable part (+/- coordinates)"
+ )
+bpy.types.Scene.AutoMirror_threshold = bpy.props.FloatProperty(
+ default= 0.001,
+ min= 0.001,
+ description="Vertices closer than this distance are merged on the loopcut"
+ )
+bpy.types.Scene.AutoMirror_toggle_edit = bpy.props.BoolProperty(
+ default= True,
+ description="If not in edit mode, change mode to edit"
+ )
+bpy.types.Scene.AutoMirror_cut = bpy.props.BoolProperty(
+ default= True,
+ description="If enabeled, cut the mesh in two parts and mirror it. If not, just make a loopcut"
+ )
+bpy.types.Scene.AutoMirror_clipping = bpy.props.BoolProperty(
+ default=True
+ )
+bpy.types.Scene.AutoMirror_use_clip = bpy.props.BoolProperty(
+ default=True,
+ description="Use clipping for the mirror modifier"
+ )
+bpy.types.Scene.AutoMirror_show_on_cage = bpy.props.BoolProperty(
+ default=True,
+ description="Enable to edit the cage (it's the classical modifier's option)"
+ )
+bpy.types.Scene.AutoMirror_apply_mirror = bpy.props.BoolProperty(
+ description="Apply the mirror modifier (useful to symmetrise the mesh)"
+ )
############### Operator
@@ -115,13 +135,15 @@ class AutoMirror(bpy.types.Operator):
bpy.ops.object.mode_set(mode="OBJECT") # Needed to avoid to translate vertices
v1 = Vector((loc[0],loc[1],loc[2]))
- bpy.ops.transform.translate(value=(X*orientation, Y*orientation, Z*orientation),
- constraint_axis=((X==1), (Y==1), (Z==1)),
- constraint_orientation='LOCAL')
+ bpy.ops.transform.translate(
+ value=(X*orientation, Y*orientation, Z*orientation),
+ constraint_axis=((X==1), (Y==1), (Z==1)),
+ constraint_orientation='LOCAL')
v2 = Vector((loc[0],loc[1],loc[2]))
- bpy.ops.transform.translate(value=(-X*orientation, -Y*orientation, -Z*orientation),
- constraint_axis=((X==1), (Y==1), (Z==1)),
- constraint_orientation='LOCAL')
+ bpy.ops.transform.translate(
+ value=(-X*orientation, -Y*orientation, -Z*orientation),
+ constraint_axis=((X==1), (Y==1), (Z==1)),
+ constraint_orientation='LOCAL')
bpy.ops.object.mode_set(mode="EDIT")
return v2-v1