Skip to content

Commit

Permalink
test for inert nodes
Browse files Browse the repository at this point in the history
Signed-off-by: Christian López Barrón <[email protected]>
  • Loading branch information
chrizzFTD committed Jan 4, 2025
1 parent dbe0b87 commit af7b305
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,19 +172,21 @@ def test_scenegraph_composition(self):
widget.deleteLater()

def test_prim_composition(self):
temp = Usd.Stage.CreateInMemory()
ancestor = temp.DefinePrim("/a")
prim = temp.DefinePrim("/b")
prim.GetReferences().AddReference(Sdf.Reference(primPath=ancestor.GetPath()))
stage = Usd.Stage.Open(str(_test_bed))
prim = stage.GetPrimAtPath("/Catalogue/Model/Buildings/Multi_Story_Building/Windows/Apartment/Geom/Floor")
widget = description.PrimComposition()
widget._include_inert_nodes.setChecked(False)
widget._compute_expanded_index.setChecked(False)
widget._complete_target_layerstack.setChecked(True)

# DotView capabilities are tested elsewhere, so mock 'setDotPath' here.
widget._dot_view.setDotPath = lambda fp: None
widget.setPrim(prim)

# cheap. prim is affected by 2 layers
# single child for this prim.
self.assertTrue(widget.composition_tree._model.invisibleRootItem().hasChildren())

widget._compute_expanded_index.setChecked(True)
widget._complete_target_layerstack.setChecked(True)
widget.setPrim(prim)
self.assertTrue(widget.composition_tree._model.invisibleRootItem().hasChildren())
Expand Down

0 comments on commit af7b305

Please sign in to comment.