[Bf-extensions-cvs] [36c8cfc] master: added wiki_url, added FilletPlus and CreaPrim options, removed FastOrigin
Gert De Roost
noreply at git.blender.org
Mon Dec 7 17:34:11 CET 2015
Commit: 36c8cfcb7a15ac51ce538ff921335f90f0ce7eaf
Author: Gert De Roost
Date: Mon Dec 7 17:34:14 2015 +0100
Branches: master
https://developer.blender.org/rBAC36c8cfcb7a15ac51ce538ff921335f90f0ce7eaf
added wiki_url, added FilletPlus and CreaPrim options, removed FastOrigin
===================================================================
M ewoc_projects_tools/__init__.py
M ewoc_projects_tools/mesh_deathguppie.py
M ewoc_projects_tools/mesh_edgegrow.py
M ewoc_projects_tools/mesh_edgetune.py
A ewoc_projects_tools/mesh_filletplus.py
M ewoc_projects_tools/mesh_floodsel.py
A ewoc_projects_tools/mesh_heal.py
M ewoc_projects_tools/mesh_laprelax.py
M ewoc_projects_tools/mesh_paredge.py
A ewoc_projects_tools/mesh_polyredux.py
M ewoc_projects_tools/mesh_selproject.py
M ewoc_projects_tools/mesh_straightenplus.py
A ewoc_projects_tools/object_creaprim.py
===================================================================
diff --git a/ewoc_projects_tools/__init__.py b/ewoc_projects_tools/__init__.py
index a98e95e..4c61aab 100644
--- a/ewoc_projects_tools/__init__.py
+++ b/ewoc_projects_tools/__init__.py
@@ -21,12 +21,12 @@
bl_info = {
"name": "EWOCprojects tools",
"author": "Gert De Roost - paleajed",
- "version": (1, 4, 0),
+ "version": (1, 4, 1),
"blender": (2, 65, 0),
"location": "View3D > Toolbar and View3D > Specials (W-key)",
"description": "Edit mode tools - contrib version",
"warning": "",
- "wiki_url": "",
+ "wiki_url": "http://www.ewocprojects.be/scripts.html",
"tracker_url": "",
"category": "Mesh"}
@@ -38,13 +38,15 @@ if "bpy" in locals():
imp.reload(mesh_paredge)
imp.reload(mesh_edgegrow)
imp.reload(mesh_fanconnect)
- imp.reload(object_fastorigin)
imp.reload(mesh_laprelax)
+ imp.reload(mesh_polyredux)
+ imp.reload(mesh_filletplus)
imp.reload(mesh_innerweld)
imp.reload(mesh_straightenplus)
imp.reload(mesh_floodsel)
imp.reload(mesh_deathguppie)
imp.reload(mesh_selproject)
+ imp.reload(object_creaprim)
imp.reload(object_decouple)
imp.reload(object_keeptrans)
@@ -54,13 +56,15 @@ else:
from . import mesh_paredge
from . import mesh_edgegrow
from . import mesh_fanconnect
- from . import object_fastorigin
from . import mesh_laprelax
+ from . import mesh_polyredux
+ from . import mesh_filletplus
from . import mesh_innerweld
from . import mesh_straightenplus
from . import mesh_floodsel
from . import mesh_deathguppie
from . import mesh_selproject
+ from . import object_creaprim
from . import object_decouple
from . import object_keeptrans
@@ -87,10 +91,12 @@ class VIEW3D_MT_edit_mesh_paleajed(bpy.types.Menu):
text="EdgeGrow")
layout.operator("mesh.fanconnect",
text="FanConnect")
- layout.operator("object.fastorigin",
- text="FastOrigin")
layout.operator("mesh.laprelax",
text="LapRelax")
+ layout.operator("mesh.polyredux",
+ text="PolyRedux")
+ layout.operator("mesh.filletplus",
+ text="FilletPlus")
layout.operator("mesh.innerweld",
text="InnerWeld")
layout.operator("mesh.straightenplus",
@@ -101,14 +107,6 @@ class VIEW3D_MT_edit_mesh_paleajed(bpy.types.Menu):
text="DeathGuppie")
layout.operator("mesh.selproject",
text="SelProject")
- if not(object_decouple.unparented):
- layout.operator("object.decouple",
- text="DeCouple")
- else:
- layout.operator("object.recouple",
- text="ReCouple")
- layout.operator("object.keeptrans",
- text="KeepTrans")
class PaleajedPanel(bpy.types.Panel):
@@ -132,8 +130,9 @@ class PaleajedPanel(bpy.types.Panel):
layout.operator("mesh.edgegrow")
layout.operator("mesh.fanconnect")
- layout.operator("object.fastorigin")
layout.operator("mesh.laprelax")
+ layout.operator("mesh.polyredux")
+ layout.operator("mesh.filletplus")
layout.operator("mesh.innerweld")
if not(mesh_straightenplus.started):
@@ -173,6 +172,10 @@ class PaleajedPanel(bpy.types.Panel):
else:
self.layout.label(text="ENTER to confirm")
+ self.layout.operator("object.creaprim")
+ self.layout.prop(scn, "Name")
+ self.layout.prop(scn, "Apply")
+
if not(object_decouple.unparented):
layout.operator("object.decouple",
text="DeCouple")
diff --git a/ewoc_projects_tools/mesh_deathguppie.py b/ewoc_projects_tools/mesh_deathguppie.py
index 0f563e1..da58ed3 100644
--- a/ewoc_projects_tools/mesh_deathguppie.py
+++ b/ewoc_projects_tools/mesh_deathguppie.py
@@ -44,7 +44,7 @@ Save as Default (Optional).
bl_info = {
"name": "DeathGuppie",
"author": "Gert De Roost",
- "version": (0, 3, 0),
+ "version": (0, 3, 1),
"blender": (2, 63, 0),
"location": "View3D > Tools",
"description": "Deathguppie subdivision operation",
@@ -107,6 +107,8 @@ class DeathGuppie(bpy.types.Operator):
mesh = selobj.data
bm = bmesh.from_edit_mesh(mesh)
bmkeep = bm.copy()
+ bmkeep.verts.ensure_lookup_table()
+ bmkeep.faces.ensure_lookup_table()
facelist = []
for f1 in bm.faces:
diff --git a/ewoc_projects_tools/mesh_edgegrow.py b/ewoc_projects_tools/mesh_edgegrow.py
index c6395f2..414f2a4 100644
--- a/ewoc_projects_tools/mesh_edgegrow.py
+++ b/ewoc_projects_tools/mesh_edgegrow.py
@@ -43,8 +43,8 @@ Save as Default (Optional).
bl_info = {
"name": "EdgeGrow",
"author": "Gert De Roost",
- "version": (0, 4, 1),
- "blender": (2, 65, 0),
+ "version": (0, 4, 2),
+ "blender": (2, 70, 0),
"location": "View3D > Tools",
"description": "Growing edgeloops with arrowkeys",
"warning": "",
@@ -58,7 +58,7 @@ import bpy
import bpy_extras
import bmesh
from bgl import glColor3f, glBegin, GL_LINES, glVertex2f, glEnd
-from mathutils import Vector, Matrix
+from mathutils import Vector, Matrix, Quaternion
import time
@@ -92,7 +92,7 @@ class EdgeGrow(bpy.types.Operator):
# User transforms view
return {'PASS_THROUGH'}
- elif event.type in {'RET', 'NUMPAD_ENTER'}:
+ elif event.type in {'RET', 'NUMPAD_ENTER'} or self.stop:
# Consolidate changes if ENTER pressed.
# Free the bmesh.
self.bm.free()
@@ -258,6 +258,10 @@ class EdgeGrow(bpy.types.Operator):
if edge.select:
self.selset.add(edge)
self.esellist.append(edge)
+ self.stop = False
+ if len(self.esellist) == 0:
+ self.stop = True
+ return
for vert in self.bm.verts:
if vert.select:
self.vsellist.append(vert)
diff --git a/ewoc_projects_tools/mesh_edgetune.py b/ewoc_projects_tools/mesh_edgetune.py
index b459948..25e95ac 100644
--- a/ewoc_projects_tools/mesh_edgetune.py
+++ b/ewoc_projects_tools/mesh_edgetune.py
@@ -7,7 +7,7 @@
#
# 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
+# 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
@@ -45,7 +45,7 @@ This script is an implementation of the concept of sliding vertices around
visualized in red.
The respective selected vertices will change position on the slide-edge to
the new position you choose by moving over it with the left mouse-button
- pressed. Vertices can be made to move past the end of the edge by
+ pressed. Vertices can be made to move past the end of the edge by
keeping leftmouse pressed, and moving along the supporting edge and
further in that same direction.
@@ -61,8 +61,8 @@ This script is an implementation of the concept of sliding vertices around
bl_info = {
"name": "EdgeTune",
"author": "Gert De Roost",
- "version": (3, 5, 1),
- "blender": (2, 65, 0),
+ "version": (3, 6, 1),
+ "blender": (2, 63, 0),
"location": "View3D > Tools",
"description": "Tuning edgeloops by redrawing them manually, sliding verts.",
"warning": "",
@@ -115,20 +115,34 @@ class EdgeTune(bpy.types.Operator):
def modal(self, context, event):
self.viewchange = False
- if event.type == 'LEFTMOUSE':
+ if event.type == 'LEFTMOUSE' and (event.alt != True):
if event.value == 'PRESS':
self.mbns = True
if event.value == 'RELEASE':
self.mbns = False
self.contedge = None
self.movedoff = True
- if event.type == 'RIGHTMOUSE':
+ if (event.type == 'RIGHTMOUSE' and (event.alt != True)) or event.type == 'ESC':
# cancel operation, reset to bmumdo mesh
+ if self.copyobj in list(self.scn.objects):
+ self.scn.objects.unlink(self.copyobj)
+ self.scn.update()
+ bpy.data.objects.remove(self.copyobj)
bpy.types.SpaceView3D.draw_handler_remove(self._handle, 'WINDOW')
+ self.bm.free()
bpy.ops.object.editmode_toggle()
self.bmundo.to_mesh(self.mesh)
bpy.ops.object.editmode_toggle()
+ if context.region:
+ if context.region.type == 'WINDOW':
+ context.region.tag_redraw()
return {'CANCELLED'}
+ elif event.type == 'RIGHTMOUSE' and event.alt:
+ self.viewchange = True
+ return {'PASS_THROUGH'}
+ elif event.type == 'LEFTMOUSE' and event.alt:
+ self.viewchange = True
+ return {'PASS_THROUGH'}
elif event.type == 'MIDDLEMOUSE':
# recalculate view parameters
self.viewchange = True
@@ -154,9 +168,16 @@ class EdgeTune(bpy.types.Operator):
elif event.type == 'RET':
# Consolidate changes.
# Free the bmesh.
+ if self.copyobj in list(self.scn.objects):
+ self.scn.objects.unlink(self.copyobj)
+ self.scn.update()
+ bpy.data.objects.remove(self.copyobj)
+ self.bm.free()
self.bmundo.free()
bpy.types.SpaceView3D.draw_handler_remove(self._handle, 'WINDOW')
- self.region.tag_redraw()
+ if context.region:
+ if context.region.type == 'WINDOW':
+ context.region.tag_redraw()
return {'FINISHED'}
elif event.type == 'MOUSEMOVE':
@@ -360,6 +381,12 @@ class EdgeTune(bpy.types.Operator):
vec = vec * self.selobj.matrix_world + self.selobj.matrix_world.to_translation()
return vec
+ def findlocalco(self, vec):
+
+ vec = vec.copy()
+ vec = (vec - self.selobj.location) * self.matrix.inverted()
+ return vec
+
def getscreencoords(self, vec, reg):
# calculate screencoords of given Vector
@@ -367,14 +394,69 @@ class EdgeTune(bpy.types.Operator):
prj = self.perspm[reg] * vec.to_4d()
return (self.halfwidth[reg] + self.halfwidth[reg] * (prj.x / prj.w), self.halfheight[reg] + self.halfheight[reg] * (prj.y / prj.w), prj.z)
+ def getmatrix(self, selobj):
+
+ # Rotating / panning / zooming 3D view is handled here.
+ # Creates a matrix.
+ if selobj.rotation_mode == 'AXIS_ANGLE':
+ # object rotation_quaternionmode axisangle
+ ang, x, y, z = selobj.rotation_axis_angle
+ matrix = Matrix.Rotation(-ang, 4, Vector((x, y, z)))
+ elif selobj.rotation_mode == 'QUATERNION':
+ # object rotation_quaternionmode euler
+ w, x, y, z = selobj.rotation_quaternion
+ x = -x
+ y = -y
+ z = -z
+ self.quat = Quaternion([w, x, y, z])
+ matrix = self.quat.to_matrix()
+ matrix.resize_4x4()
+ else:
+ # object rotation_quaternionmode euler
+ ax, ay, az = selobj.rotation_euler
+ mat_rotX = Matrix.Rotation(-ax, 4, 'X')
+ mat_rotY = Matrix.Rotation(-ay, 4, 'Y')
+ mat_rotZ = Matrix.Rotation(-az, 4, 'Z')
+ if selobj.rotation_mode == 'XYZ':
+ matrix = mat_rotX * ma
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list