[Bf-extensions-cvs] [89f9296] master: mesh edit tools, update multi extrude, add vertex align

meta-androcto noreply at git.blender.org
Mon Apr 3 12:52:37 CEST 2017


Commit: 89f92968a76d4138f4d79e4b6c140a90879bcb93
Author: meta-androcto
Date:   Mon Apr 3 20:52:14 2017 +1000
Branches: master
https://developer.blender.org/rBA89f92968a76d4138f4d79e4b6c140a90879bcb93

mesh edit tools, update multi extrude, add vertex align

===================================================================

M	mesh_extra_tools/__init__.py
M	mesh_extra_tools/mesh_mextrude_plus.py
A	mesh_extra_tools/vertex_align.py

===================================================================

diff --git a/mesh_extra_tools/__init__.py b/mesh_extra_tools/__init__.py
index 89b9a45..d8e8792 100644
--- a/mesh_extra_tools/__init__.py
+++ b/mesh_extra_tools/__init__.py
@@ -64,6 +64,7 @@ if "bpy" in locals():
     importlib.reload(mesh_info_select)
     importlib.reload(mesh_extrude_and_reshape)
     importlib.reload(mesh_check)
+    importlib.reload(vertex_align)
 
 else:
     from . import face_inset_fillet
@@ -85,6 +86,7 @@ else:
     from . import mesh_help
     from . import mesh_extrude_and_reshape
     from . import mesh_check
+    from . import vertex_align
 
     from .mesh_select_tools import mesh_select_by_direction
     from .mesh_select_tools import mesh_select_by_edge_length
@@ -238,6 +240,30 @@ class EditToolsPanel(Panel):
             row.operator("mesh.random_vertices", text="Random Vertices")
             row.operator("mesh.extra_tools_help",
                         icon="LAYER_USED").help_ids = "random_vertices"
+            cen0 = context.scene.va_custom_props.en0
+            layout = self.layout
+            layout.label(text="Vertex Align:", icon="VERTEXSEL")
+            layout.prop(context.scene.va_custom_props, 'en0', expand = False)
+            
+            if cen0 == 'opt0':
+                row = layout.split(0.60)
+                row.label('Store data:')
+                row.operator('va.op0_id', text = 'Vertex')
+                row1 = layout.split(0.8, align=True)
+                row1.operator('va.op2_id', text = 'Align')
+                row1.operator('va.op7_id', text = '', icon = "LAYER_USED")
+            elif cen0 == 'opt1':
+                layout.operator('va.op3_id', text = 'Align')
+            elif cen0 == 'opt2':
+                row = layout.split(0.40)
+                row.label('Store data:')
+                row.operator('va.op0_id', text = 'Two vertices')
+                layout.operator('va.op5_id', text = 'Align')
+            elif cen0 == 'opt3':
+                row = layout.split(0.60)
+                row.label('Store data:')
+                row.operator('va.op1_id', text = 'Face')
+                layout.operator('va.op6_id', text = 'Align')
 
         # Edge options
         box1 = self.layout.box()
@@ -784,6 +810,7 @@ def register():
     vfe_specials.register()
     mesh_extrude_and_reshape.register()
     mesh_check.register()
+    vertex_align.register()
     bpy.utils.register_module(__name__)
 
     # Register Scene Properties
@@ -808,6 +835,7 @@ def unregister():
     vfe_specials.unregister()
     mesh_extrude_and_reshape.unregister()
     mesh_check.unregister()
+    vertex_align.unregister()
 
     del bpy.types.Scene.mesh_extra_tools
     del bpy.types.Object.tkkey
diff --git a/mesh_extra_tools/mesh_mextrude_plus.py b/mesh_extra_tools/mesh_mextrude_plus.py
index cb7c8b6..0ae161b 100644
--- a/mesh_extra_tools/mesh_mextrude_plus.py
+++ b/mesh_extra_tools/mesh_mextrude_plus.py
@@ -19,7 +19,7 @@
 # Repeats extrusion + rotation + scale for one or more faces
 # Original code by liero
 # Update by Jimmy Hazevoet 03/2017 for Blender 2.79
-# normal rotation, probability, scaled offset, object origin, initial scale noise
+# normal rotation, probability, scaled offset, object coörds, initial and per step noise
 
 
 bl_info = {
@@ -81,29 +81,29 @@ class MExtrude(Operator):
 
     off = FloatProperty(
                 name="Offset",
-                soft_min=0.001, soft_max=2,
-                min=-2, max=5,
+                soft_min=0.001, soft_max=10,
+                min=-100, max=100,
                 default=1.0,
                 description="Translation"
                 )
     offx = FloatProperty(
                 name="Loc X",
-                soft_min=-2.0, soft_max=2.0,
-                min=-5.0, max=5.0,
+                soft_min=-10.0, soft_max=10.0,
+                min=-100.0, max=100.0,
                 default=0.0,
                 description="Global translation X"
                 )
     offy = FloatProperty(
                 name="Loc Y",
-                soft_min=-2.0, soft_max=2.0,
-                min=-5.0, max=5.0,
+                soft_min=-10.0, soft_max=10.0,
+                min=-100.0, max=100.0,
                 default=0.0,
                 description="Global translation Y"
                 )
     offz = FloatProperty(
                 name="Loc Z",
-                soft_min=-2.0, soft_max=2.0,
-                min=-5.0, max=5.0,
+                soft_min=-10.0, soft_max=10.0,
+                min=-100.0, max=100.0,
                 default=0.0,
                 description="Global translation Z"
                 )
@@ -152,27 +152,27 @@ class MExtrude(Operator):
                 )
     sca = FloatProperty(
                 name="Scale",
-                min=0.1, max=2,
-                soft_min=0.5, soft_max=1.2,
+                min=0.01, max=10,
+                soft_min=0.5, soft_max=1.5,
                 default=1.0,
                 description="Scaling of the selected faces after extrusion"
                 )
     var1 = FloatProperty(
-                name="Offset Var", min=-5, max=5,
+                name="Offset Var", min=-10, max=10,
                 soft_min=-1, soft_max=1,
                 default=0,
                 description="Offset variation"
                 )
     var2 = FloatProperty(
                 name="Rotation Var",
-                min=-5, max=5,
+                min=-10, max=10,
                 soft_min=-1, soft_max=1,
                 default=0,
                 description="Rotation variation"
                 )
     var3 = FloatProperty(
                 name="Scale Noise",
-                min=-5, max=5,
+                min=-10, max=10,
                 soft_min=-1, soft_max=1,
                 default=0,
                 description="Scaling noise"
@@ -185,7 +185,7 @@ class MExtrude(Operator):
                 )
     num = IntProperty(
                 name="Repeat",
-                min=1, max=250,
+                min=1, max=500,
                 soft_max=100,
                 default=5,
                 description="Repetitions"
@@ -207,17 +207,16 @@ class MExtrude(Operator):
                 description="Scale * Offset"
                 )
     opt3 = BoolProperty(
-                name="Per step scale noise",
+                name="Per step rotation noise",
                 default=False,
-                description="Per step scale noise, Initial scale noise"
+                description="Per step rotation noise, Initial rotation noise"
                 )
     opt4 = BoolProperty(
-                name="Per step rotation noise",
+                name="Per step scale noise",
                 default=False,
-                description="Per step rotation noise, Initial rotation noise"
+                description="Per step scale noise, Initial scale noise"
                 )
 
-
     @classmethod
     def poll(cls, context):
         obj = context.object
@@ -253,7 +252,7 @@ class MExtrude(Operator):
         col.prop(self, 'num')
 
         col = layout.column(align=True)
-        col.label(text="Extra settings:")
+        col.label(text="Options:")
         col.prop(self, "opt1")
         col.prop(self, "opt2")
         col.prop(self, "opt3")
@@ -280,12 +279,12 @@ class MExtrude(Operator):
             loc = gloc(self, i)
             of.normal_update()
 
-            # initial scale noise
-            if self.opt3 is False:
-                s = vsca(self, i)
             # initial rotation noise
-            if self.opt4 is False:
+            if self.opt3 is False:
                 rot = vrot(self, i)
+            # initial scale noise
+            if self.opt4 is False:
+                s = vsca(self, i)
 
             # extrusion loop
             for r in range(self.num):
@@ -303,12 +302,12 @@ class MExtrude(Operator):
                     else:
                         ce = origin
 
-                    # per step scale noise
-                    if self.opt3 is True:
-                        s = vsca(self, i + r)
                     # per step rotation noise
-                    if self.opt4 is True:
+                    if self.opt3 is True:
                         rot = vrot(self, i + r)
+                    # per step scale noise
+                    if self.opt4 is True:
+                        s = vsca(self, i + r)
 
                     # proportional, scale * offset
                     if self.opt2 is True:
diff --git a/mesh_extra_tools/vertex_align.py b/mesh_extra_tools/vertex_align.py
new file mode 100644
index 0000000..04401ae
--- /dev/null
+++ b/mesh_extra_tools/vertex_align.py
@@ -0,0 +1,334 @@
+# -*- coding: utf-8 -*-
+
+# ***** 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 LICENCE BLOCK *****
+
+# ------ ------
+bl_info = {
+    'name': 'vertex align',
+    'author': '',
+    'version': (0, 1, 6),
+    'blender': (2, 6, 1),
+    'location': 'View3D > Tool Shelf',
+    'description': '',
+    'warning': '',
+    'wiki_url': '',
+    'tracker_url': '',
+    'category': 'Mesh' }
+
+# ------ ------
+import bpy
+from bpy.props import PointerProperty, EnumProperty, FloatProperty, BoolProperty
+from mathutils import Vector
+from mathutils.geometry import intersect_point_line, intersect_line_plane
+
+# ------ Edit Mode Toggle------
+def edit_mode_out():
+    bpy.ops.object.mode_set(mode = 'OBJECT')
+
+def edit_mode_in():
+    bpy.ops.object.mode_set(mode = 'EDIT')
+
+# ------ ------
+def get_mesh_data_():
+    edit_mode_out()
+    ob_act = bpy.context.active_object
+    me = ob_act

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list