[Bf-extensions-cvs] [5a01e034] soc-2019-openxr: Prevent redo panel for changing active bookmark
Julian Eisel
noreply at git.blender.org
Sun Feb 16 21:54:24 CET 2020
Commit: 5a01e034be4bcc0aba5cf3c72bca4bbefbf79be7
Author: Julian Eisel
Date: Sun Feb 16 21:52:59 2020 +0100
Branches: soc-2019-openxr
https://developer.blender.org/rBA5a01e034be4bcc0aba5cf3c72bca4bbefbf79be7
Prevent redo panel for changing active bookmark
Also cancel operator when trying to activate a bookmark out of range.
===================================================================
M viewport_vr_preview.py
===================================================================
diff --git a/viewport_vr_preview.py b/viewport_vr_preview.py
index 597351f3..0e77f933 100644
--- a/viewport_vr_preview.py
+++ b/viewport_vr_preview.py
@@ -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
More information about the Bf-extensions-cvs
mailing list