diff --git a/Changes.md b/Changes.md index ba44237a33a..d4f6ea6209a 100644 --- a/Changes.md +++ b/Changes.md @@ -1,6 +1,11 @@ 1.4.x.x (relative to 1.4.0.0b4) ======= +Improvements +------------ + +- LightPosition Tool : The tool is now only visible for members of the `__lights` set, instead of all objects. + API --- @@ -11,6 +16,7 @@ Fixes ----- - PlugAlgo : Updated `canSetValueFromData()`, `setValueFromData()` and `getValueAsData()` with support for missing types. +- LightPosition Tool : Fixed lingering shadow pivot point after placing a shadow pivot, switching to highlight mode and switching back to shadow mode [^1]. 1.4.0.0b4 (relative to 1.4.0.0b3) ========= diff --git a/src/GafferSceneUI/LightPositionTool.cpp b/src/GafferSceneUI/LightPositionTool.cpp index d81d14d855e..9a025bb0d86 100644 --- a/src/GafferSceneUI/LightPositionTool.cpp +++ b/src/GafferSceneUI/LightPositionTool.cpp @@ -107,6 +107,8 @@ const float g_arrowHandleSelectionSize = g_circleHandleSelectionWidth * 2.f; const float g_unitConeHeight = 1.5f; +InternedString g_lightsSetName( "__lights" ); + const char *constantFragSource() { return @@ -666,8 +668,14 @@ void LightPositionTool::updateHandles( float rasterScale ) handles()->setTransform( s.orientedTransform( Orientation::Local ) ); + Context::Scope scopedContext( s.context() ); + if( !m_drag ) { + bool isLight = s.scene()->set( g_lightsSetName )->readable().match( s.path() ) & IECore::PathMatcher::ExactMatch; + m_distanceHandle->setVisible( isLight ); + m_rotateHandle->setVisible( isLight ); + bool singleSelection = selection().size() == 1; TranslationRotation trDistanceHandle( s, Orientation::World ); @@ -706,8 +714,6 @@ void LightPositionTool::updateHandles( float rasterScale ) // to pivot, and the rotation around the Z-axis. Any variance from those // contraints invalidates the stored parameters. - Context::Scope scopedContext( s.context() ); - const M44f transform = s.scene()->fullTransform( s.path() ) * sceneToTransform; const V3f p = transform.translation(); @@ -920,6 +926,7 @@ void LightPositionTool::plugSet( Plug *plug ) { auto h = static_cast( m_distanceHandle.get() ); h->setRequiresPivot( modePlug()->getValue() == (int)Mode::Shadow ); + updateHandles( m_rotateHandle->getRasterScale() ); } }