[Bf-extensions-cvs] [4207e249] blender2.8: Snap Utilities Line: FIx inverted rotation.

mano-wii noreply at git.blender.org
Mon Nov 5 13:44:10 CET 2018


Commit: 4207e249e539549ac3215619909d1c5b390b6e8e
Author: mano-wii
Date:   Mon Nov 5 09:43:53 2018 -0200
Branches: blender2.8
https://developer.blender.org/rBA4207e249e539549ac3215619909d1c5b390b6e8e

Snap Utilities Line:	FIx inverted rotation.

And cleanup.

===================================================================

M	mesh_snap_utilities_line/common_classes.py

===================================================================

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



More information about the Bf-extensions-cvs mailing list