Skip to content

Commit

Permalink
Reconfiguring for zip install
Browse files Browse the repository at this point in the history
Messed up last time, I'm not sure how my test worked, but when I tried it again today it didn't, so this is me fixing it up
  • Loading branch information
SpectralVectors authored Jul 1, 2021
1 parent 6a1f93e commit 04cdde2
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 34 deletions.
26 changes: 26 additions & 0 deletions Preferences.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import bpy

class RightMouseNavigationPreferences(bpy.types.AddonPreferences):
bl_idname = __package__

timepreference: bpy.props.FloatProperty(
name="Time Threshold",
description="How long you have hold right mouse to open menu",
default=0.3,
min=0.1,
max=2
)

distancepreference: bpy.props.FloatProperty(
name="Distance Threshold",
description="How far you have to move the mouse to trigger navigation",
default=20,
min=1,
max=200
)

def draw(self, context):
layout = self.layout
row = layout.row()
row.prop(self, 'timepreference')
row.prop(self, 'distancepreference')
29 changes: 2 additions & 27 deletions RightMouseNavigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,12 @@
'name': 'Right Mouse Navigation',
'category': 'View 3D',
'author': 'Spectral Vectors',
'version': (0, 1, 1),
'version': (0, 1, 4),
'blender': (2, 90, 0),
'location': '3D Viewport',
"description": "Enables Right Mouse Viewport Navigation"
}

class RightMouseNavigationPreferences(bpy.types.AddonPreferences):
bl_idname = __name__

timepreference: bpy.props.FloatProperty(
name="Time Threshold",
description="How long you have hold right mouse to open menu",
default=0.3,
min=0.1,
max=2
)

distancepreference: bpy.props.FloatProperty(
name="Distance Threshold",
description="How far you have to move the mouse to trigger navigation",
default=20,
min=1,
max=200
)

def draw(self, context):
layout = self.layout
row = layout.row()
row.prop(self, 'timepreference')
row.prop(self, 'distancepreference')

class POINT(ctypes.Structure):
_fields_ = [("x", ctypes.c_long), ("y", ctypes.c_long)]

Expand All @@ -56,7 +31,7 @@ class BLUI_OT_right_mouse_navigation(bpy.types.Operator):
def modal(self, context, event):

preferences = context.preferences
addon_prefs = preferences.addons[__name__].preferences
addon_prefs = preferences.addons[__package__].preferences

# Check if the Viewport is Perspective or Orthographic
if bpy.context.region_data.is_perspective:
Expand Down
13 changes: 6 additions & 7 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,26 @@
'name': 'Right Mouse Navigation',
'category': 'View 3D',
'author': 'Spectral Vectors',
'version': (0, 1, 1),
'version': (0, 1, 4),
'blender': (2, 90, 0),
'location': '3D Viewport',
"description": "Enables Right Mouse Viewport Navigation"
}

import bpy

from .RightMouseNavigation import(
RightMouseNavigationPreferences,
BLUI_OT_right_mouse_navigation,
)
from .RightMouseNavigation import BLUI_OT_right_mouse_navigation
from .Preferences import RightMouseNavigationPreferences


addon_keymaps = []

def register():

register_keymaps()
bpy.utils.register_class(RightMouseNavigationPreferences)
bpy.utils.register_class(BLUI_OT_right_mouse_navigation)


register_keymaps()

def register_keymaps():
keyconfig = bpy.context.window_manager.keyconfigs
Expand Down

0 comments on commit 04cdde2

Please sign in to comment.