Skip to content

Commit

Permalink
EMSUSD-40 added unit test for instance proxy edit
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrebai-adsk committed Jun 29, 2023
1 parent 7b3e493 commit e0b676d
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions test/lib/mayaUsd/fileio/testEditAsMaya.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,19 @@ def testIllegalEditAsMaya(self):
stage = mayaUsd.lib.GetPrim(proxyShapePathStr).GetStage()
blendShape = stage.DefinePrim('/BlendShape1', 'BlendShape')
scope = stage.DefinePrim('/Scope1', 'Scope')
scope = stage.DefinePrim('/Mesh1', 'Mesh')
scope = stage.DefinePrim('/Material1', 'Material')
self.assertIsNotNone(scope)
mesh = stage.DefinePrim('/Mesh1', 'Mesh')
self.assertIsNotNone(mesh)
mat = stage.DefinePrim('/Material1', 'Material')
self.assertIsNotNone(mat)
instanced = stage.DefinePrim('/Instanced', 'Xform')
self.assertIsNotNone(instanced)
proto = stage.DefinePrim('/Proto', 'Xform')
self.assertIsNotNone(proto)
protoMesh = stage.DefinePrim('/Proto/Mesh', 'Mesh')
self.assertIsNotNone(protoMesh)
instanced.GetReferences().AddInternalReference('/Proto')
instanced.SetInstanceable(True)

blendShapePathStr = proxyShapePathStr + ',/BlendShape1'
scopePathStr = proxyShapePathStr + ',/Scope1'
Expand All @@ -398,6 +409,10 @@ def testIllegalEditAsMaya(self):
# capability.
self.assertFalse(mayaUsd.lib.PrimUpdaterManager.canEditAsMaya(proxyShapePathStr + ',/Material1'))

# Instance proxies cannot be edited as Maya: it explicitly disables this
# capability.
self.assertFalse(mayaUsd.lib.PrimUpdaterManager.canEditAsMaya(proxyShapePathStr + ',/Instanced/Proto/Mesh'))

def testSessionLayer(self):
'''Verify that the edit gets on the sessionLayer instead of the editTarget layer.'''

Expand Down

0 comments on commit e0b676d

Please sign in to comment.