parent
f7f65ffa7e
commit
4207e249e5
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue