Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormano-wii <germano.costa@ig.com.br>2018-11-05 14:43:53 +0300
committermano-wii <germano.costa@ig.com.br>2018-11-05 14:43:53 +0300
commit4207e249e539549ac3215619909d1c5b390b6e8e (patch)
treece55b4c9cb43108e0a82000cf9e8489a5e252354 /mesh_snap_utilities_line/common_classes.py
parentf7f65ffa7e592b3d101a67ce75e244ec9830a006 (diff)
Snap Utilities Line: FIx inverted rotation.
And cleanup.
Diffstat (limited to 'mesh_snap_utilities_line/common_classes.py')
-rw-r--r--mesh_snap_utilities_line/common_classes.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/mesh_snap_utilities_line/common_classes.py b/mesh_snap_utilities_line/common_classes.py
index e5ee0a91..04008be5 100644
--- a/mesh_snap_utilities_line/common_classes.py
+++ b/mesh_snap_utilities_line/common_classes.py
@@ -427,10 +427,6 @@ class MousePointWidgetGroup(bpy.types.GizmoGroup):
bl_region_type = 'WINDOW'
bl_options = {'3D'}
- __slots__ = (
- "snap_widget",
- )
-
def setup(self, context):
snap_widget = self.gizmos.new(MousePointWidget.bl_idname)
props = snap_widget.target_set_operator("mesh.make_line")
@@ -442,16 +438,16 @@ class VIEW3D_OT_rotate_custom_pivot(bpy.types.Operator):
bl_label = "Rotate the view"
bl_options = {'BLOCKING', 'GRAB_CURSOR'}
- pivot = bpy.props.FloatVectorProperty("Pivot", subtype='XYZ')
- g_up_axis = bpy.props.FloatVectorProperty("up_axis", default=(0.0, 0.0, 1.0), subtype='XYZ')
- sensitivity = bpy.props.FloatProperty("sensitivity", default=0.007)
+ pivot: bpy.props.FloatVectorProperty("Pivot", subtype='XYZ')
+ g_up_axis: bpy.props.FloatVectorProperty("up_axis", default=(0.0, 0.0, 1.0), subtype='XYZ')
+ sensitivity: bpy.props.FloatProperty("sensitivity", default=0.007)
def modal(self, context, event):
from mathutils import Matrix
if event.value == 'PRESS' and event.type in {'MOUSEMOVE', 'INBETWEEN_MOUSEMOVE'}:
dx = self.init_coord[0] - event.mouse_region_x
dy = self.init_coord[1] - event.mouse_region_y
- rot_ver = Matrix.Rotation(dx * self.sensitivity, 3, self.g_up_axis)
+ rot_ver = Matrix.Rotation(-dx * self.sensitivity, 3, self.g_up_axis)
rot_hor = Matrix.Rotation(dy * self.sensitivity, 3, self.view_rot[0])
rot_mat = rot_hor @ rot_ver
view_matrix = self.view_rot @ rot_mat