[Bf-extensions-cvs] [cb8aea01] xr-actions-D9124: viewport_vr_preview.py: Add input threshold property

Peter Kim noreply at git.blender.org
Mon Oct 19 17:57:46 CEST 2020


Commit: cb8aea01e3670b5ba92aae5a09d1bedf9bae3c32
Author: Peter Kim
Date:   Tue Oct 20 00:56:21 2020 +0900
Branches: xr-actions-D9124
https://developer.blender.org/rBAcb8aea01e3670b5ba92aae5a09d1bedf9bae3c32

viewport_vr_preview.py: Add input threshold property

===================================================================

M	viewport_vr_preview.py

===================================================================

diff --git a/viewport_vr_preview.py b/viewport_vr_preview.py
index 446f69cc..8b7698de 100644
--- a/viewport_vr_preview.py
+++ b/viewport_vr_preview.py
@@ -319,7 +319,7 @@ def create_vr_actions(context: bpy.context):
             else:
                 continue
 
-            wm.xr_session_state.create_action(context, action_set.name, action.name, type, action.user_path0, action.user_path1, action.op, op_flag)         
+            wm.xr_session_state.create_action(context, action_set.name, action.name, type, action.user_path0, action.user_path1, action.threshold, action.op, op_flag)         
 
             if action.type == 'POSE':
                 wm.xr_session_state.create_action_space(context, action_set.name, action.name, action.user_path0, action.user_path1, \
@@ -388,6 +388,12 @@ class VRAction(PropertyGroup):
     component_path1: bpy.props.StringProperty(
         name="OpenXR component path",
     )
+    threshold: bpy.props.FloatProperty(
+        name="Input threshold",
+        default=0.3,
+        min=0.0,
+        max=1.0,
+    )
     op: bpy.props.StringProperty(
         name="Python operator",
     )
@@ -508,6 +514,8 @@ class VIEW3D_PT_vr_actions(Panel):
             layout.prop(action_selected, "component_path1", text="Component Path 1")
 
             if action_selected.type == 'BUTTON':
+                layout.prop(action_selected,
+                            "threshold", text="Threshold")
                 layout.prop(action_selected,
                             "op", text="Operator")
                 layout.prop(action_selected,



More information about the Bf-extensions-cvs mailing list