diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-12-01 01:58:31 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-12-01 02:43:38 +0300 |
commit | 1d91e8c12a25618c308fcd25108bf36af0f27094 (patch) | |
tree | 362f198e4a2d891cffdcd38d9b8c8463cc160c65 /viewport_vr_preview | |
parent | 7aa99631512454831c639353bb1ed9886a7d0694 (diff) |
Cleanup: trailing space & tabs to spaces
Diffstat (limited to 'viewport_vr_preview')
-rw-r--r-- | viewport_vr_preview/action_map.py | 8 | ||||
-rw-r--r-- | viewport_vr_preview/action_map_io.py | 8 | ||||
-rw-r--r-- | viewport_vr_preview/configs/default.py | 36 | ||||
-rw-r--r-- | viewport_vr_preview/defaults.py | 32 | ||||
-rw-r--r-- | viewport_vr_preview/operators.py | 4 | ||||
-rw-r--r-- | viewport_vr_preview/versioning.py | 4 |
6 files changed, 46 insertions, 46 deletions
diff --git a/viewport_vr_preview/action_map.py b/viewport_vr_preview/action_map.py index 49c3f7dd..f0ffc046 100644 --- a/viewport_vr_preview/action_map.py +++ b/viewport_vr_preview/action_map.py @@ -62,10 +62,10 @@ def vr_create_actions(context: bpy.context): return # Ensure default action maps. - if not defaults.vr_ensure_default_actionmaps(session_state): + if not defaults.vr_ensure_default_actionmaps(session_state): return - for am in session_state.actionmaps: + for am in session_state.actionmaps: if len(am.actionmap_items) < 1: continue @@ -79,7 +79,7 @@ def vr_create_actions(context: bpy.context): for ami in am.actionmap_items: if len(ami.bindings) < 1: continue - + ok = session_state.action_create(context, am, ami) if not ok: return @@ -131,7 +131,7 @@ def vr_save_actionmaps(session_state, filepath, sort=False): action_map_io.actionconfig_export_as_data(session_state, filepath, sort=sort) print("Saved XR actionmaps: " + filepath) - + return True diff --git a/viewport_vr_preview/action_map_io.py b/viewport_vr_preview/action_map_io.py index c57543a0..fedea82e 100644 --- a/viewport_vr_preview/action_map_io.py +++ b/viewport_vr_preview/action_map_io.py @@ -77,11 +77,11 @@ def ami_args_as_data(ami): return "{" + ", ".join(s) + "}" -def ami_data_from_args(ami, args): +def ami_data_from_args(ami, args): ami.type = args["type"] ami.user_path0 = args["user_path0"] ami.user_path1 = args["user_path1"] - + if ami.type == 'FLOAT' or ami.type == 'VECTOR2D': ami.op = args["op"] ami.op_mode = args["op_mode"] @@ -168,7 +168,7 @@ def amb_args_as_data(amb, type): return "{" + ", ".join(s) + "}" -def amb_data_from_args(amb, args, type): +def amb_data_from_args(amb, args, type): amb.profile = args["profile"] amb.component_path0 = args["component_path0"] amb.component_path1 = args["component_path1"] @@ -327,7 +327,7 @@ def actionconfig_init_from_data(session_state, actionconfig_data, actionconfig_v if actionconfig_version is not None: from .versioning import actionconfig_update actionconfig_data = actionconfig_update(actionconfig_data, actionconfig_version) - + for (am_name, am_content) in actionconfig_data: am = session_state.actionmaps.new(session_state, am_name, True) am_items = am_content["items"] diff --git a/viewport_vr_preview/configs/default.py b/viewport_vr_preview/configs/default.py index efb130c1..bf4c46c7 100644 --- a/viewport_vr_preview/configs/default.py +++ b/viewport_vr_preview/configs/default.py @@ -68,7 +68,7 @@ actionconfig_data = \ [("mode", 'VIEWER_FORWARD'), ("lock_location_z", True), ], - }, + }, {"bindings": [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/thumbstick/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/trackpad/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), @@ -85,7 +85,7 @@ actionconfig_data = \ [("mode", 'VIEWER_BACK'), ("lock_location_z", True), ], - }, + }, {"bindings": [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/thumbstick/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/trackpad/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), @@ -102,7 +102,7 @@ actionconfig_data = \ [("mode", 'VIEWER_LEFT'), ("lock_location_z", True), ], - }, + }, {"bindings": [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/thumbstick/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/trackpad/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), @@ -119,7 +119,7 @@ actionconfig_data = \ [("mode", 'VIEWER_RIGHT'), ("lock_location_z", True), ], - }, + }, {"bindings": [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/thumbstick/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/trackpad/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), @@ -137,7 +137,7 @@ actionconfig_data = \ ("speed_min", 0.014), ("speed_max", 0.042), ], - }, + }, {"bindings": [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/thumbstick/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/trackpad/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), @@ -155,7 +155,7 @@ actionconfig_data = \ ("speed_min", 0.014), ("speed_max", 0.042), ], - }, + }, {"bindings": [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/thumbstick/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/trackpad/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), @@ -191,7 +191,7 @@ actionconfig_data = \ ("speed_min", 0.01), ("speed_max", 0.03), ], - }, + }, {"bindings": [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/thumbstick/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/trackpad/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), @@ -209,7 +209,7 @@ actionconfig_data = \ ("rotation", False), ("scale", True), ], - }, + }, {"bindings": [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/x/click', "component_path1": '/input/a/click', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/back/click', "component_path1": '/input/back/click', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), @@ -245,7 +245,7 @@ actionconfig_data = \ ("from_viewer", True), ("color", (0.0, 1.0, 1.0, 1.0)), ], - }, + }, {"bindings": [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/input/trigger_right/value', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ], @@ -262,7 +262,7 @@ actionconfig_data = \ [("mode", 'VIEWER_FORWARD'), ("lock_location_z", True), ], - }, + }, {"bindings": [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/input/thumbstick_left/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ], @@ -273,7 +273,7 @@ actionconfig_data = \ [("mode", 'VIEWER_BACK'), ("lock_location_z", True), ], - }, + }, {"bindings": [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/input/thumbstick_left/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ], @@ -284,7 +284,7 @@ actionconfig_data = \ [("mode", 'VIEWER_LEFT'), ("lock_location_z", True), ], - }, + }, {"bindings": [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/input/thumbstick_left/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ], @@ -295,7 +295,7 @@ actionconfig_data = \ [("mode", 'VIEWER_RIGHT'), ("lock_location_z", True), ], - }, + }, {"bindings": [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/input/thumbstick_left/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ], @@ -307,7 +307,7 @@ actionconfig_data = \ ("speed_min", 0.014), ("speed_max", 0.042), ], - }, + }, {"bindings": [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/input/thumbstick_right/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ], @@ -319,7 +319,7 @@ actionconfig_data = \ ("speed_min", 0.014), ("speed_max", 0.042), ], - }, + }, {"bindings": [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/input/thumbstick_right/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ], @@ -331,7 +331,7 @@ actionconfig_data = \ ("speed_min", 0.01), ("speed_max", 0.03), ], - }, + }, {"bindings": [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/input/thumbstick_right/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ], @@ -343,7 +343,7 @@ actionconfig_data = \ ("speed_min", 0.01), ("speed_max", 0.03), ], - }, + }, {"bindings": [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/input/thumbstick_right/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ], @@ -355,7 +355,7 @@ actionconfig_data = \ ("rotation", False), ("scale", True), ], - }, + }, {"bindings": [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/input/a/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ], diff --git a/viewport_vr_preview/defaults.py b/viewport_vr_preview/defaults.py index 205e39d2..fc768b8a 100644 --- a/viewport_vr_preview/defaults.py +++ b/viewport_vr_preview/defaults.py @@ -107,7 +107,7 @@ def vr_defaults_action_add(am, ami = am.actionmap_items.new(name, True) - if ami: + if ami: ami.type = 'FLOAT' ami.user_path0 = user_path0 ami.user_path1 = user_path1 @@ -131,7 +131,7 @@ def vr_defaults_pose_action_add(am, is_controller_grip, is_controller_aim): ami = am.actionmap_items.new(name, True) - if ami: + if ami: ami.type = 'POSE' ami.user_path0 = user_path0 ami.user_path1 = user_path1 @@ -146,11 +146,11 @@ def vr_defaults_haptic_action_add(am, user_path0, user_path1): ami = am.actionmap_items.new(name, True) - if ami: + if ami: ami.type = 'VIBRATION' ami.user_path0 = user_path0 ami.user_path1 = user_path1 - + return ami @@ -162,7 +162,7 @@ def vr_defaults_actionbinding_add(ami, threshold, axis0_region, axis1_region): - amb = ami.bindings.new(name, True) + amb = ami.bindings.new(name, True) if amb: amb.profile = profile amb.component_path0 = component_path0 @@ -181,7 +181,7 @@ def vr_defaults_pose_actionbinding_add(ami, component_path1, location, rotation): - amb = ami.bindings.new(name, True) + amb = ami.bindings.new(name, True) if amb: amb.profile = profile amb.component_path0 = component_path0 @@ -197,7 +197,7 @@ def vr_defaults_haptic_actionbinding_add(ami, profile, component_path0, component_path1): - amb = ami.bindings.new(name, True) + amb = ami.bindings.new(name, True) if amb: amb.profile = profile amb.component_path0 = component_path0 @@ -652,7 +652,7 @@ def vr_defaults_create_default(session_state): False, 0.0, 0.0, - 0.0, + 0.0, 'PRESS') if ami: vr_defaults_actionbinding_add(ami, @@ -673,7 +673,7 @@ def vr_defaults_create_default(session_state): 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.INDEX.value, - VRDefaultActionprofiles.INDEX.value, + VRDefaultActionprofiles.INDEX.value, "/input/thumbstick/x", "", 0.3, @@ -728,7 +728,7 @@ def vr_defaults_create_default(session_state): if ami: vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, + VRDefaultActionprofiles.COSMOS.value, "/input/thumbstick/x", "", 0.3, @@ -736,7 +736,7 @@ def vr_defaults_create_default(session_state): 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, - VRDefaultActionprofiles.HUAWEI.value, + VRDefaultActionprofiles.HUAWEI.value, "/input/trackpad/x", "", 0.3, @@ -752,7 +752,7 @@ def vr_defaults_create_default(session_state): 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.OCULUS.value, - VRDefaultActionprofiles.OCULUS.value, + VRDefaultActionprofiles.OCULUS.value, "/input/thumbstick/x", "", 0.3, @@ -760,7 +760,7 @@ def vr_defaults_create_default(session_state): 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.REVERB_G2.value, - VRDefaultActionprofiles.REVERB_G2.value, + VRDefaultActionprofiles.REVERB_G2.value, "/input/thumbstick/x", "", 0.3, @@ -1460,7 +1460,7 @@ def vr_defaults_create_default_gamepad(session_state): if ami: vr_defaults_haptic_actionbinding_add(ami, VRDefaultActionbindings.GAMEPAD.value, - VRDefaultActionprofiles.GAMEPAD.value, + VRDefaultActionprofiles.GAMEPAD.value, "/output/haptic_right", "") @@ -1471,7 +1471,7 @@ def vr_defaults_create_default_gamepad(session_state): if ami: vr_defaults_haptic_actionbinding_add(ami, VRDefaultActionbindings.GAMEPAD.value, - VRDefaultActionprofiles.GAMEPAD.value, + VRDefaultActionprofiles.GAMEPAD.value, "/output/haptic_left_trigger", "") @@ -1482,7 +1482,7 @@ def vr_defaults_create_default_gamepad(session_state): if ami: vr_defaults_haptic_actionbinding_add(ami, VRDefaultActionbindings.GAMEPAD.value, - VRDefaultActionprofiles.GAMEPAD.value, + VRDefaultActionprofiles.GAMEPAD.value, "/output/haptic_right_trigger", "") diff --git a/viewport_vr_preview/operators.py b/viewport_vr_preview/operators.py index 932dac31..7a19b9fb 100644 --- a/viewport_vr_preview/operators.py +++ b/viewport_vr_preview/operators.py @@ -316,7 +316,7 @@ class VIEW3D_GT_vr_controller_aim(Gizmo): def draw(self, context): bgl.glLineWidth(1) bgl.glEnable(bgl.GL_BLEND) - + self.color = 1.0, 0.2, 0.322 self.draw_preset_arrow(self.matrix_basis, axis='POS_X') self.color = 0.545, 0.863, 0.0 @@ -414,7 +414,7 @@ class VIEW3D_GGT_vr_controller_poses(GizmoGroup): gizmo.aspect = 1 / 3, 1 / 4 gizmo.color_highlight = 1.0, 1.0, 1.0 gizmo.alpha = 1.0 - + def draw_prepare(self, context): grip_idx = 0 aim_idx = 0 diff --git a/viewport_vr_preview/versioning.py b/viewport_vr_preview/versioning.py index bf7e891a..15d4de29 100644 --- a/viewport_vr_preview/versioning.py +++ b/viewport_vr_preview/versioning.py @@ -40,14 +40,14 @@ def actionconfig_update(actionconfig_data, actionconfig_version): ## ## for (am_name, am_content) in actionconfig_data: ## # Apply action map updates. -## +## ## am_items = am_content["items"] ## ## for (ami_name, ami_args, ami_data, ami_content) in am_items ## # Apply action map item updates. ## ## ami_bindings = ami_content["bindings"] -## +## ## for (amb_name, amb_args) in ami_bindings: ## # Apply action map binding updates. |