diff --git a/src/GafferSceneUI/LightTool.cpp b/src/GafferSceneUI/LightTool.cpp index c899469c8be..8f3b038587c 100644 --- a/src/GafferSceneUI/LightTool.cpp +++ b/src/GafferSceneUI/LightTool.cpp @@ -1424,8 +1424,6 @@ class SpotLightHandle : public LightToolHandle return m_handleType == HandleType::Cone ? "cone angles" : "penumbra angles"; } - private : - void handlePathChanged() override { ConstCompoundObjectPtr attributes = scene()->fullAttributes( handlePath() ); @@ -1684,31 +1682,6 @@ class SpotLightHandle : public LightToolHandle return true; } - bool mouseMove( const ButtonEvent &event ) - { - if( !hasInspectors() || m_drag ) - { - return false; - } - - const auto &[coneHandleAngle, penumbraHandleAngle] = handleAngles(); - - const float angle = m_handleType == HandleType::Cone ? coneHandleAngle : penumbraHandleAngle.value(); - - const M44f r = M44f().rotate( V3f( 0, degreesToRadians( angle ), 0 ) ); - const Line3f rayLine( - V3f( 0 ), - V3f( 0, 0, m_visualiserScale * m_frustumScale * -10.f ) * r - ); - const V3f dragPoint = rayLine.closestPointTo( Line3f( event.line.p0, event.line.p1 ) ); - setTooltipPosition( dragPoint ); - m_arcRadius = dragPoint.length(); - - dirty( DirtyType::Render ); - - return false; - } - void setupDrag( const DragDropEvent &event ) override { m_drag = AngularDrag( @@ -1763,6 +1736,33 @@ class SpotLightHandle : public LightToolHandle return result; } + private : + + bool mouseMove( const ButtonEvent &event ) + { + if( !hasInspectors() || m_drag ) + { + return false; + } + + const auto &[coneHandleAngle, penumbraHandleAngle] = handleAngles(); + + const float angle = m_handleType == HandleType::Cone ? coneHandleAngle : penumbraHandleAngle.value(); + + const M44f r = M44f().rotate( V3f( 0, degreesToRadians( angle ), 0 ) ); + const Line3f rayLine( + V3f( 0 ), + V3f( 0, 0, m_visualiserScale * m_frustumScale * -10.f ) * r + ); + const V3f dragPoint = rayLine.closestPointTo( Line3f( event.line.p0, event.line.p1 ) ); + setTooltipPosition( dragPoint ); + m_arcRadius = dragPoint.length(); + + dirty( DirtyType::Render ); + + return false; + } + std::pair> handleAngles() const { InspectionInfo coneHandleInfo; @@ -1922,7 +1922,7 @@ class EdgeHandle : public LightToolHandle } - private : + protected : bool handleDragMoveInternal( const GafferUI::DragDropEvent &event ) override { @@ -2046,6 +2046,8 @@ class EdgeHandle : public LightToolHandle return ""; } + private : + bool mouseMove( const ButtonEvent &event ) { if( !hasInspectors() ) @@ -2197,7 +2199,7 @@ class CornerHandle : public LightToolHandle } - private : + protected : bool handleDragMoveInternal( const GafferUI::DragDropEvent &event ) override { @@ -2340,6 +2342,8 @@ class CornerHandle : public LightToolHandle return "Hold Ctrl to maintain aspect ratio"; } + private : + bool mouseMove( const ButtonEvent &event ) { if( !hasInspectors() )