diff --git a/__init__.py b/__init__.py index 9983dd0..e2639db 100644 --- a/__init__.py +++ b/__init__.py @@ -22,7 +22,7 @@ "description": "Creates active touch zones over View 2D and 3D areas for easier viewport navigation with touch screens and pen tablets.", "author": "NENDO, Karan(b3dhub)", "blender": (2, 93, 0), - "version": (4, 2, 0), + "version": (4, 2, 1), "category": "3D View", "location": "View3D > Tools > NENDO", "warning": "", diff --git a/blender_manifest.toml b/blender_manifest.toml index 225cc2c..6a53e02 100644 --- a/blender_manifest.toml +++ b/blender_manifest.toml @@ -1,7 +1,7 @@ schema_version = "1.0.0" id = "touchview" -version = "4.2.0" +version = "4.2.1" name = "Touch Viewport" tagline = "Creates active touch zones over View 2D and 3D areas" maintainer = "NENDO, Karan(b3dhub)" @@ -23,15 +23,15 @@ files = "preserve settings when enabling/disabling the add-on" [build] paths_exclude_pattern = [ - "__pycache__/", - "/.git/", - "docs/", - ".gitignore", - "/*.zip", - "/bin", - "settings.json", - "bundle.sh", - "mypy.ini", - "requirements.txt", - "README.md" + "__pycache__/", + "/.git/", + "docs/", + ".gitignore", + "/*.zip", + "/bin", + "settings.json", + "bundle.sh", + "mypy.ini", + "requirements.txt", + "README.md", ] diff --git a/preferences.py b/preferences.py index eeb21e6..d627579 100644 --- a/preferences.py +++ b/preferences.py @@ -611,9 +611,9 @@ def draw(self, context): if self.gizmo_tabs == "ACTIONS": if not self.show_float_menu: - col.operator("view3d.toggle_floating_menu", text="Show Action Menu") + col.operator("touchview.toggle_floating_menu", text="Show Action Menu") else: - col.operator("view3d.toggle_floating_menu", text="Hide Action Menu", depress=True) + col.operator("touchview.toggle_floating_menu", text="Hide Action Menu", depress=True) box = col.box() box.active = self.show_float_menu col = box.column() diff --git a/source/ops/actions.py b/source/ops/actions.py index 13a0071..a8b80fe 100644 --- a/source/ops/actions.py +++ b/source/ops/actions.py @@ -11,7 +11,7 @@ class TOUCHVIEW_OT_flip_tools(Operator): """Relocate Tools panel between left and right""" bl_label = "Tools Region Swap" - bl_idname = "view3d.tools_region_flip" + bl_idname = "touchview.tools_region_flip" @classmethod def poll(cls, context): @@ -33,7 +33,7 @@ class TOUCHVIEW_OT_next_pivot_mode(Operator): """Step through Pivot modes""" bl_label = "Use next Pivot mode" - bl_idname = "view3d.step_pivot_mode" + bl_idname = "touchview.step_pivot_mode" @classmethod def poll(cls, context): @@ -90,7 +90,7 @@ class TOUCHVIEW_OT_toggle_floating_menu(Operator): """Toggle Floating Menu""" bl_label = "Toggle Floating Menu" - bl_idname = "view3d.toggle_floating_menu" + bl_idname = "touchview.toggle_floating_menu" def execute(self, context): prefs = preferences() diff --git a/source/ops/touch.py b/source/ops/touch.py index 21211dd..ccc9d5f 100644 --- a/source/ops/touch.py +++ b/source/ops/touch.py @@ -1,3 +1,4 @@ +# Built-in modules import math import bpy @@ -7,6 +8,7 @@ region_2d_to_vector_3d) from mathutils import Vector +# Local modules from ..utils.blender import preferences from ..utils.constants import (FINISHED, LMOUSE, PASSTHROUGH, PEN, PRESS, RMOUSE, brush_modes, input_mode_items) @@ -112,7 +114,7 @@ def invoke(self, context, event): prefs = preferences() if not prefs.is_enabled: return PASSTHROUGH - if settings.input_mode == "full" and (event.type == PEN or not isTouch(event)): + if prefs.input_mode == "FULL" and (event.type == PEN or not is_touch(event)): return PASSTHROUGH if event.value != PRESS: diff --git a/source/ui/panel.py b/source/ui/panel.py index 6ff900c..c030b47 100644 --- a/source/ui/panel.py +++ b/source/ui/panel.py @@ -37,9 +37,10 @@ def draw(self, context): col.prop(prefs, "enable_floating_toggle") -class TOUCHVIEW_PT_ControlZones(TouchView, Panel): +class TOUCHVIEW_PT_control_zones(TouchView, Panel): bl_label = "Control Zones" bl_parent_id = "TOUCHVIEW_PT_view_3d_panel" + bl_options = {"DEFAULT_CLOSED"} def draw_header(self, context): prefs = preferences() @@ -78,6 +79,7 @@ def draw(self, context): class TOUCHVIEW_PT_gizmo_bar(TouchView, Panel): bl_label = "Gizmo" bl_parent_id = "TOUCHVIEW_PT_view_3d_panel" + bl_options = {"DEFAULT_CLOSED"} def draw(self, context): prefs = preferences() @@ -101,6 +103,7 @@ def draw(self, context): class TOUCHVIEW_PT_right_click(TouchView, Panel): bl_label = "Right Click Actions" bl_parent_id = "TOUCHVIEW_PT_view_3d_panel" + bl_options = {"DEFAULT_CLOSED"} def draw(self, context): prefs = preferences() @@ -117,6 +120,7 @@ def draw(self, context): class TOUCHVIEW_PT_double_click(TouchView, Panel): bl_label = "Double Click Actions" bl_parent_id = "TOUCHVIEW_PT_view_3d_panel" + bl_options = {"DEFAULT_CLOSED"} def draw(self, context): prefs = preferences() @@ -133,6 +137,7 @@ def draw(self, context): class TOUCHVIEW_PT_tool_settings(TouchView, Panel): bl_label = "Tool Options" bl_parent_id = "TOUCHVIEW_PT_view_3d_panel" + bl_options = {"DEFAULT_CLOSED"} def draw(self, context): prefs = preferences() @@ -147,6 +152,7 @@ def draw(self, context): class TOUCHVIEW_PT_viewport_options(TouchView, Panel): bl_label = "Viewport Options" bl_parent_id = "TOUCHVIEW_PT_view_3d_panel" + bl_options = {"DEFAULT_CLOSED"} def draw(self, context): prefs = preferences() @@ -159,7 +165,7 @@ def draw(self, context): space = context.area.spaces.active col = layout.column() - col.operator("view3d.tools_region_flip", text="Flip Tools") + col.operator("touchview.tools_region_flip", text="Flip Tools") if len(space.region_quadviews) > 0: col.operator("screen.region_quadview", text="Disable Quadview") else: @@ -283,7 +289,7 @@ def __operator_exists(self, idname): classes = ( TOUCHVIEW_PT_view_3d_panel, - TOUCHVIEW_PT_ControlZones, + TOUCHVIEW_PT_control_zones, TOUCHVIEW_PT_gizmo_bar, TOUCHVIEW_PT_right_click, TOUCHVIEW_PT_double_click, diff --git a/source/utils/keymaps.py b/source/utils/keymaps.py index deab216..ba7d8eb 100644 --- a/source/utils/keymaps.py +++ b/source/utils/keymaps.py @@ -30,7 +30,7 @@ def assign_keymaps(): kmi = km.keymap_items.new("view2d.pan", LMOUSE, PRESS) modified_keymaps.append((km, kmi)) - # add LEFT MOUSE ACTION for view3d.view_ops + # add LEFT MOUSE ACTION for touchview.view_ops for kmap in wm.keyconfigs["Blender"].keymaps: km = wm.keyconfigs.addon.keymaps.new(name=kmap.name, space_type=kmap.space_type, region_type=kmap.region_type) if kmap.name in top_level_names: