Move "From Cursor" operator which sets dupli group offset to own operator
Previously it used to use cursor location from time when panel was drawn, which in some cases lead to using previous cursor location instead of current.
This commit is contained in:
@@ -691,3 +691,29 @@ class TransformsToDeltasAnim(Operator):
|
||||
context.scene.frame_set(context.scene.frame_current)
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class DupliOffsetFromCursor(Operator):
|
||||
'''Set offset used for DupliGroup based on cursor position'''
|
||||
bl_idname = "object.dupli_offset_from_cursor"
|
||||
bl_label = "Set Offset From Cursor"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
group = IntProperty(
|
||||
name="Group",
|
||||
description="Group index to set offset for",
|
||||
default=0,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.active_object is not None
|
||||
|
||||
def execute(self, context):
|
||||
scene = context.scene
|
||||
ob = context.active_object
|
||||
group = self.group
|
||||
|
||||
ob.users_group[group].dupli_offset = scene.cursor_location
|
||||
|
||||
return {'FINISHED'}
|
||||
|
Reference in New Issue
Block a user