Object Operators: make-dupliface and join-uvs weren't using UNDO.

also improve make-dupliface tip
This commit is contained in:
2014-01-07 18:09:02 +11:00
parent 4a372102c7
commit ead8b82ca7

View File

@@ -132,7 +132,7 @@ class SelectCamera(Operator):
else: else:
if not self.extend: if not self.extend:
bpy.ops.object.select_all(action='DESELECT') bpy.ops.object.select_all(action='DESELECT')
context.scene.objects.active = camera scene.objects.active = camera
camera.hide = False camera.hide = False
camera.select = True camera.select = True
return {'FINISHED'} return {'FINISHED'}
@@ -166,6 +166,7 @@ class SelectHierarchy(Operator):
return context.object return context.object
def execute(self, context): def execute(self, context):
scene = context.scene
select_new = [] select_new = []
act_new = None act_new = None
@@ -201,7 +202,7 @@ class SelectHierarchy(Operator):
for obj in select_new: for obj in select_new:
obj.select = True obj.select = True
context.scene.objects.active = act_new scene.objects.active = act_new
return {'FINISHED'} return {'FINISHED'}
return {'CANCELLED'} return {'CANCELLED'}
@@ -479,6 +480,7 @@ class JoinUVs(Operator):
"""(needs matching geometry)""" """(needs matching geometry)"""
bl_idname = "object.join_uvs" bl_idname = "object.join_uvs"
bl_label = "Transfer UV Maps" bl_label = "Transfer UV Maps"
bl_options = {'REGISTER', 'UNDO'}
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
@@ -555,9 +557,10 @@ class JoinUVs(Operator):
class MakeDupliFace(Operator): class MakeDupliFace(Operator):
"""Make linked objects into dupli-faces""" """Converts objects into dupli-face instanced"""
bl_idname = "object.make_dupli_face" bl_idname = "object.make_dupli_face"
bl_label = "Make Dupli-Face" bl_label = "Make Dupli-Face"
bl_options = {'REGISTER', 'UNDO'}
def _main(self, context): def _main(self, context):
from mathutils import Vector from mathutils import Vector