Skip to content

Commit 07b40ee

Browse files
committed
IECoreMaya : Fixed erroneous display of hidden locations in VP2.
The VP2 scene traversal is depth first, and we were checking for visibility overrides after the child traversal. So the child locations which have scene:visible set to true, were being displayed and the location which had an override was being hidden. Now the check for a visibility override comes before the traversal, and the child traversal is pruned if the location is invisible.
1 parent 74d4979 commit 07b40ee

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/IECoreMaya/SceneShapeSubSceneOverride.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,6 +1404,16 @@ void SceneShapeSubSceneOverride::visitSceneLocations( const SceneInterface *scen
14041404
return;
14051405
}
14061406

1407+
// respect visibility attribute
1408+
if( sceneInterface->hasAttribute( SceneInterface::visibilityName ) )
1409+
{
1410+
ConstBoolDataPtr vis = runTimeCast<const BoolData>( sceneInterface->readAttribute( SceneInterface::visibilityName, m_time ) );
1411+
if( vis && !vis->readable() )
1412+
{
1413+
return;
1414+
}
1415+
}
1416+
14071417
MMatrix accumulatedMatrix;
14081418
if( !isRoot )
14091419
{
@@ -1430,7 +1440,6 @@ void SceneShapeSubSceneOverride::visitSceneLocations( const SceneInterface *scen
14301440
}
14311441

14321442
// Now handle current location.
1433-
14341443
if( isRoot )
14351444
{
14361445
// override relative location for root as it would otherwise be empty
@@ -1469,16 +1478,6 @@ void SceneShapeSubSceneOverride::visitSceneLocations( const SceneInterface *scen
14691478
return;
14701479
}
14711480

1472-
// respect visibility attribute
1473-
if( sceneInterface->hasAttribute( "scene:visible" ) )
1474-
{
1475-
ConstBoolDataPtr vis = runTimeCast<const BoolData>( sceneInterface->readAttribute( "scene:visible", m_time ) );
1476-
if( vis && !vis->readable() )
1477-
{
1478-
return;
1479-
}
1480-
}
1481-
14821481
IECore::ConstObjectPtr object = sceneInterface->readObject( m_time );
14831482
if( !objectCanBeRendered( object ) )
14841483
{

0 commit comments

Comments
 (0)