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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-01-30 01:28:04 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-01-30 01:28:04 +0400
commit56fe01c3fb7acc529e2f5ec8b3ecf6b7d0cf8563 (patch)
treea33d52f2ce0df9fda06764e95b02e5eae0e7b934 /release/scripts
parentb820ec4ae4a62a05fc9ac6ca9c93a17128675407 (diff)
fix [#30017] Make Dupli-Face needs active mesh object
Diffstat (limited to 'release/scripts')
-rw-r--r--release/scripts/startup/bl_operators/object.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py
index 738cc7b24e0..2c329de3644 100644
--- a/release/scripts/startup/bl_operators/object.py
+++ b/release/scripts/startup/bl_operators/object.py
@@ -489,8 +489,7 @@ class ShapeTransfer(Operator):
return (obj and obj.mode != 'EDIT')
def execute(self, context):
- C = bpy.context
- ob_act = C.active_object
+ ob_act = context.active_object
objects = [ob for ob in C.selected_editable_objects if ob != ob_act]
if 1: # swap from/to, means we cant copy to many at once.
@@ -585,11 +584,6 @@ class MakeDupliFace(Operator):
bl_idname = "object.make_dupli_face"
bl_label = "Make Dupli-Face"
- @classmethod
- def poll(cls, context):
- obj = context.active_object
- return (obj and obj.type == 'MESH')
-
def _main(self, context):
from mathutils import Vector
@@ -601,22 +595,22 @@ class MakeDupliFace(Operator):
Vector((-offset, +offset, 0.0)),
)
- def matrix_to_quat(matrix):
+ def matrix_to_quad(matrix):
# scale = matrix.median_scale
trans = matrix.to_translation()
rot = matrix.to_3x3() # also contains scale
return [(rot * b) + trans for b in base_tri]
- scene = bpy.context.scene
+ scene = context.scene
linked = {}
- for obj in bpy.context.selected_objects:
+ for obj in context.selected_objects:
data = obj.data
if data:
linked.setdefault(data, []).append(obj)
for data, objects in linked.items():
face_verts = [axis for obj in objects
- for v in matrix_to_quat(obj.matrix_world)
+ for v in matrix_to_quad(obj.matrix_world)
for axis in v]
faces = list(range(len(face_verts) // 3))