Skip to content

Conversation

@bradleyhenke
Copy link
Contributor

This PR fixes a couple of drawing bugs related to SceneShapes in VP2:

  • IECoreMaya : Fixed erroneous display of hidden locations in VP2.
  • IECoreMaya : Updated SceneShape drawing to respect ancestral visibility overrides.
  • IECoreMaya : Fixed SceneShape isolate selection in maya.

Related Issues

  • N/A

Dependencies

  • N/A

Breaking Changes

  • N/A

Checklist

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable.
  • I have tested my change(s) in the test suite, and added new test cases where necessary.
  • My code follows the Cortex project's prevailing coding style and conventions.

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.
There have been visibility discrepancies when a layout is collasped
or expanded. When collasped, the drawing code is able to read
visibility overrides and hide the appropriate sub-hierarchies.
However, when the same layout is expanded the visibility was tested
at each expanded location, and it failed to consider overrides
which occured further up in the hierarchy.

This commit solves this discrepancy by using LiveScene to determine
if the sceneShape is should actually be invisible due to an
override further up the hierarchy. SceneShape registers a custom
readAttribute function with LiveScene, so LiveScene is able to
correctly read the visibility overrides during its traversal.

In regards to performance, when a SceneShape is fully expanded, and
there is a deep hierarchy of visible transforms, this commit will
slightly impact the frame rate since LiveScene will be performing extra
work to ensure there are no visiblity overrides. Some of this overhead
may be reduced through the use of an extra visiblity tracking cache,
but there is also a price to pay for the extra message callbacks
necessary to keep the cache synchronized. On a fully visible robot with
~2870 locations, the frame rate dropped ~1.2 fps.

However, in practice at IE, this will not affect the performance of our
animation rigs since all SceneShapes will be expanded to maya geometry.
In this scenario, MDagPath::isVisible() will return False since
the SceneShape will be set to an intermediate object, and the LiveScene
code path will not be executed.
This commit fixes the isolate selection of SceneShape objects. An even
better improvement would be to support isolate selection of components
within a collapsed SceneShape. From an initial investigation, I
believe the issue first stems from not being able to add SceneShape
components to a maya object set. The documentation is not entirely
clear on what is involved in this process, but the "Geometry Data"
subsection of the following article may hold some clues.

https://around-the-corner.typepad.com/adn/2012/09/custom-shapes-in-the-maya-api-1.html

The crux of the situation may depend on implementing an MPxGeometryData
for SceneShape (which is a bit crude since the scene interface may
contain an entire scene, not just a single shape). However the blog
seems to indicate that "Set information for components is stored
with the geometryData".
@bradleyhenke bradleyhenke changed the title Vp2 scene shape visibility IECoreMaya : Fixed various SceneShape drawing bugs. Aug 16, 2022
@ivanimanishi ivanimanishi merged commit 355ff7a into ImageEngine:RB-10.3 Aug 17, 2022
@ivanimanishi ivanimanishi deleted the vp2_sceneShapeVisibility branch August 17, 2022 16:20
ivanimanishi added a commit that referenced this pull request Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants