Prevent redo panel for changing active bookmark

Also cancel operator when trying to activate a bookmark out of range.
This commit is contained in:
Julian Eisel 2020-02-16 21:52:59 +01:00
parent 200d3499c7
commit 5a01e034be
1 changed files with 7 additions and 1 deletions

View File

@ -311,11 +311,17 @@ class VIEW3D_OT_vr_pose_bookmark_activate(bpy.types.Operator):
bl_description = "Change to the selected VR pose bookmark from the list"
bl_options = {'UNDO', 'REGISTER'}
index: IntProperty(name="Index")
index: IntProperty(
name="Index",
options={'HIDDEN'},
)
def execute(self, context):
wm = context.window_manager
if self.index >= len(wm.vr_pose_bookmarks):
return {'CANCELLED'}
wm.vr_pose_bookmarks_active = self.index if self.properties.is_property_set(
"index") else wm.vr_pose_bookmarks_selected