From da4cba363de7729b9d753fbe90773406b36c2211 Mon Sep 17 00:00:00 2001 From: Karan Prakash Date: Sun, 29 Dec 2024 10:06:32 +0530 Subject: [PATCH 1/8] Fixed: touch.py --- source/ops/touch.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source/ops/touch.py b/source/ops/touch.py index 21211dd..af68c89 100644 --- a/source/ops/touch.py +++ b/source/ops/touch.py @@ -1,15 +1,15 @@ -import math - import bpy from bpy.props import EnumProperty from bpy.types import Operator -from bpy_extras.view3d_utils import (region_2d_to_origin_3d, - region_2d_to_vector_3d) +from bpy_extras.view3d_utils import region_2d_to_origin_3d, region_2d_to_vector_3d from mathutils import Vector +# Built-in modules +import math + +# Local modules from ..utils.blender import preferences -from ..utils.constants import (FINISHED, LMOUSE, PASSTHROUGH, PEN, PRESS, - RMOUSE, brush_modes, input_mode_items) +from ..utils.constants import FINISHED, LMOUSE, PASSTHROUGH, PEN, PRESS, RMOUSE, brush_modes, input_mode_items def is_touch(event): @@ -112,7 +112,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: From 9ad0614d0353de9eda7f042c378e83fdee92a136 Mon Sep 17 00:00:00 2001 From: Karan Prakash Date: Sun, 29 Dec 2024 10:06:38 +0530 Subject: [PATCH 2/8] Update actions.py --- source/ops/actions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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() From 5cc47cc841e44c966fa9f4c818ef786cf8321f34 Mon Sep 17 00:00:00 2001 From: Karan Prakash Date: Sun, 29 Dec 2024 10:06:44 +0530 Subject: [PATCH 3/8] Update panel.py --- source/ui/panel.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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, From 67ea4a23b07605b640582908a2e024d2c8d4843a Mon Sep 17 00:00:00 2001 From: Karan Prakash Date: Sun, 29 Dec 2024 10:06:47 +0530 Subject: [PATCH 4/8] Update keymaps.py --- source/utils/keymaps.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/utils/keymaps.py b/source/utils/keymaps.py index deab216..6ba7c18 100644 --- a/source/utils/keymaps.py +++ b/source/utils/keymaps.py @@ -1,7 +1,6 @@ import bpy -from .constants import (DCLICK, LMOUSE, PRESS, RMOUSE, flat_modes, - top_level_names) +from .constants import DCLICK, LMOUSE, PRESS, RMOUSE, flat_modes, top_level_names default_keymaps = [] modified_keymaps = [] @@ -30,7 +29,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: From 0499178ca2d06625c08ae25166db56ce22507052 Mon Sep 17 00:00:00 2001 From: Karan Prakash Date: Sun, 29 Dec 2024 10:06:50 +0530 Subject: [PATCH 5/8] Update preferences.py --- preferences.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/preferences.py b/preferences.py index eeb21e6..bed3856 100644 --- a/preferences.py +++ b/preferences.py @@ -6,10 +6,16 @@ from bpy.props import * from bpy.types import AddonPreferences, PropertyGroup, UILayout -from .source.utils.constants import (double_click_items, edit_modes, - gizmo_sets, menu_defaults, - menu_orientation_items, menu_style_items, - pivot_items, position_items) +from .source.utils.constants import ( + double_click_items, + edit_modes, + gizmo_sets, + menu_defaults, + menu_orientation_items, + menu_style_items, + pivot_items, + position_items, +) def NODE_HT_nendo_header(s, c): @@ -611,9 +617,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() From f96cc16d9a7c843d4e614fad7df8e376cc1bdd9d Mon Sep 17 00:00:00 2001 From: Karan Prakash Date: Sun, 29 Dec 2024 10:06:55 +0530 Subject: [PATCH 6/8] Update blender_manifest.toml --- blender_manifest.toml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) 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", ] From 8edfea0071a025a9ed9bc0ee7bfec4803eb79eeb Mon Sep 17 00:00:00 2001 From: Karan Prakash Date: Sun, 29 Dec 2024 10:07:07 +0530 Subject: [PATCH 7/8] Update __init__.py --- __init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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": "", From bfc187f12a8fef52b9cbeb1e4639cc550bfe97ad Mon Sep 17 00:00:00 2001 From: Karan Prakash Date: Mon, 30 Dec 2024 08:06:57 +0530 Subject: [PATCH 8/8] Fixed: `isort` errors --- preferences.py | 14 ++++---------- source/ops/touch.py | 12 +++++++----- source/utils/keymaps.py | 3 ++- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/preferences.py b/preferences.py index bed3856..d627579 100644 --- a/preferences.py +++ b/preferences.py @@ -6,16 +6,10 @@ from bpy.props import * from bpy.types import AddonPreferences, PropertyGroup, UILayout -from .source.utils.constants import ( - double_click_items, - edit_modes, - gizmo_sets, - menu_defaults, - menu_orientation_items, - menu_style_items, - pivot_items, - position_items, -) +from .source.utils.constants import (double_click_items, edit_modes, + gizmo_sets, menu_defaults, + menu_orientation_items, menu_style_items, + pivot_items, position_items) def NODE_HT_nendo_header(s, c): diff --git a/source/ops/touch.py b/source/ops/touch.py index af68c89..ccc9d5f 100644 --- a/source/ops/touch.py +++ b/source/ops/touch.py @@ -1,15 +1,17 @@ +# Built-in modules +import math + import bpy from bpy.props import EnumProperty from bpy.types import Operator -from bpy_extras.view3d_utils import region_2d_to_origin_3d, region_2d_to_vector_3d +from bpy_extras.view3d_utils import (region_2d_to_origin_3d, + region_2d_to_vector_3d) from mathutils import Vector -# Built-in modules -import math - # Local modules from ..utils.blender import preferences -from ..utils.constants import FINISHED, LMOUSE, PASSTHROUGH, PEN, PRESS, RMOUSE, brush_modes, input_mode_items +from ..utils.constants import (FINISHED, LMOUSE, PASSTHROUGH, PEN, PRESS, + RMOUSE, brush_modes, input_mode_items) def is_touch(event): diff --git a/source/utils/keymaps.py b/source/utils/keymaps.py index 6ba7c18..ba7d8eb 100644 --- a/source/utils/keymaps.py +++ b/source/utils/keymaps.py @@ -1,6 +1,7 @@ import bpy -from .constants import DCLICK, LMOUSE, PRESS, RMOUSE, flat_modes, top_level_names +from .constants import (DCLICK, LMOUSE, PRESS, RMOUSE, flat_modes, + top_level_names) default_keymaps = [] modified_keymaps = []