[Bf-extensions-cvs] [512687f5] master: Now edit MultiMesh support rotation scale location, and code cleanup
Eugenio Pignataro
noreply at git.blender.org
Thu Dec 14 14:23:09 CET 2017
Commit: 512687f54e26dc4cde5cf94455df3e395c23cae2
Author: Eugenio Pignataro
Date: Thu Dec 14 10:23:03 2017 -0300
Branches: master
https://developer.blender.org/rBA512687f54e26dc4cde5cf94455df3e395c23cae2
Now edit MultiMesh support rotation scale location, and code cleanup
===================================================================
M oscurart_tools/__init__.py
M oscurart_tools/oscurart_meshes.py
===================================================================
diff --git a/oscurart_tools/__init__.py b/oscurart_tools/__init__.py
index de285c15..8affc8bb 100644
--- a/oscurart_tools/__init__.py
+++ b/oscurart_tools/__init__.py
@@ -205,11 +205,11 @@ class OscPanelMesh(Panel):
colrow = col.row(align=1)
colrow.operator("lattice.mirror_selected", icon="LATTICE_DATA")
colrow = col.row(align=1)
- colrow.label(text="Multimesh")
+ colrow.label(text="Edit Multimesh")
colrow.prop_search(scene, "multimeshedit", bpy.data, "groups", text="")
colrow = col.row(align=1)
- colrow.operator("mesh.create_edit_multimesh", icon="IMPORT")
- colrow.operator("mesh.apply_edit_multimesh", icon="EXPORT")
+ colrow.operator("mesh.create_edit_multimesh", icon="IMPORT", text= "StartEdit")
+ colrow.operator("mesh.apply_edit_multimesh", icon="EXPORT", text="FinishEdit")
class OscPanelShapes(Panel):
bl_idname = "Oscurart Shapes Tools"
diff --git a/oscurart_tools/oscurart_meshes.py b/oscurart_tools/oscurart_meshes.py
index 1b0d9d3c..ea899d53 100644
--- a/oscurart_tools/oscurart_meshes.py
+++ b/oscurart_tools/oscurart_meshes.py
@@ -660,11 +660,10 @@ class createEditMultimesh(Operator):
vertlist = []
polylist = []
for ob in temp:
+ objectMatrix = ob[0].matrix_world.copy()
for vert in ob[0].data.vertices:
- #print(vert.co[:])
- vertlist.append(vert.co+ob[0].location)
- for poly in ob[0].data.polygons:
- #print(poly.vertices[:])
+ vertlist.append(objectMatrix*vert.co)
+ for poly in ob[0].data.polygons:
polylist.append(tuple([vert+vi for vert in poly.vertices[:]]))
relvert[ob[0]] = {vert.index:vert.index+vi for vert in ob[0].data.vertices}
vi += len(ob[0].data.vertices)
@@ -688,8 +687,9 @@ class ApplyEditMultimesh(Operator):
def execute(self,context):
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
for object,rv in relvert.items():
+ objectMatrix = object.matrix_world.inverted().copy()
for source, target in rv.items():
- object.data.vertices[source].co = me.vertices[target].co-object.location
+ object.data.vertices[source].co = objectMatrix * me.vertices[target].co
object.hide = 0
bpy.context.scene.objects.unlink(ob)
return {'FINISHED'}
More information about the Bf-extensions-cvs
mailing list