@@ -1492,6 +1492,27 @@ def testGeomCoponentAssignment(self):
14921492 self .assertEqual (topSubset .GetFamilyNameAttr ().Get (), "componentTag" )
14931493 self .assertFalse (topSubset .GetPrim ().HasAPI (UsdShade .MaterialBindingAPI ))
14941494
1495+ if mayaUtils .mayaMajorVersion () == 2024 :
1496+ # We also can check the old sync counters:
1497+ counters = { "resync" : cmds .getAttr (psPathStr + '.resyncId' ),
1498+ "update" : cmds .getAttr (psPathStr + '.upid' )}
1499+
1500+ def assertIsOnlyUpdate (self , counters , shapePathStr ):
1501+ resyncCounter = cmds .getAttr (shapePathStr + '.resyncId' )
1502+ updateCounter = cmds .getAttr (shapePathStr + '.updateId' )
1503+ self .assertEqual (resyncCounter , counters ["resync" ])
1504+ self .assertGreater (updateCounter , counters ["update" ])
1505+ counters ["resync" ] = resyncCounter
1506+ counters ["update" ] = updateCounter
1507+
1508+ def assertIsResync (self , counters , shapePathStr ):
1509+ resyncCounter = cmds .getAttr (shapePathStr + '.resyncId' )
1510+ updateCounter = cmds .getAttr (shapePathStr + '.updateId' )
1511+ self .assertGreater (resyncCounter , counters ["resync" ])
1512+ self .assertGreater (updateCounter , counters ["update" ])
1513+ counters ["resync" ] = resyncCounter
1514+ counters ["update" ] = updateCounter
1515+
14951516 messageHandler = mayaUtils .TestProxyShapeUpdateHandler (psPathStr )
14961517 messageHandler .snapshot ()
14971518
@@ -1508,47 +1529,66 @@ def testGeomCoponentAssignment(self):
15081529
15091530 # We expect a resync after this assignment:
15101531 self .assertTrue (messageHandler .isResync ())
1532+ if mayaUtils .mayaMajorVersion () == 2024 :
1533+ assertIsResync (self , counters , psPathStr )
15111534
15121535 # setting a value the first time is a resync due to the creation of the attribute:
15131536 attrs = ufe .Attributes .attributes (shaderItem )
15141537 metallicAttr = attrs .attribute ("inputs:metallic" )
15151538 ufeCmd .execute (metallicAttr .setCmd (0.5 ))
15161539 self .assertTrue (messageHandler .isResync ())
1540+ if mayaUtils .mayaMajorVersion () == 2024 :
1541+ assertIsResync (self , counters , psPathStr )
15171542
15181543 # Subsequent changes are updates:
15191544 ufeCmd .execute (metallicAttr .setCmd (0.7 ))
15201545 self .assertTrue (messageHandler .isUpdate ())
1546+ if mayaUtils .mayaMajorVersion () == 2024 :
1547+ assertIsOnlyUpdate (self , counters , psPathStr )
15211548
15221549 # First undo is an update:
15231550 cmds .undo ()
15241551 self .assertTrue (messageHandler .isUpdate ())
1552+ if mayaUtils .mayaMajorVersion () == 2024 :
1553+ assertIsOnlyUpdate (self , counters , psPathStr )
15251554
15261555 # Second undo is a resync:
15271556 cmds .undo ()
15281557 self .assertTrue (messageHandler .isResync ())
1558+ if mayaUtils .mayaMajorVersion () == 2024 :
1559+ assertIsResync (self , counters , psPathStr )
15291560
15301561 # Third undo is also resync:
15311562 cmds .undo ()
15321563 self .assertTrue (messageHandler .isResync ())
1564+ if mayaUtils .mayaMajorVersion () == 2024 :
1565+ assertIsResync (self , counters , psPathStr )
15331566
15341567 # First redo is resync:
15351568 cmds .redo ()
15361569 self .assertTrue (messageHandler .isResync ())
1570+ if mayaUtils .mayaMajorVersion () == 2024 :
1571+ assertIsResync (self , counters , psPathStr )
15371572
15381573 # Second redo is resync:
15391574 cmds .redo ()
15401575 self .assertTrue (messageHandler .isResync ())
1576+ if mayaUtils .mayaMajorVersion () == 2024 :
1577+ assertIsResync (self , counters , psPathStr )
15411578
15421579 # Third redo is update:
15431580 cmds .redo ()
15441581 self .assertTrue (messageHandler .isUpdate ())
1582+ if mayaUtils .mayaMajorVersion () == 2024 :
1583+ assertIsOnlyUpdate (self , counters , psPathStr )
15451584 currentCacheId = messageHandler .getStageCacheId ()
15461585
15471586 # Changing the whole stage is a resync:
15481587 testFile = testUtils .getTestScene ("MaterialX" , "MtlxValueTypes.usda" )
15491588 cmds .setAttr ('{}.filePath' .format (psPathStr ), testFile , type = 'string' )
15501589
15511590 self .assertTrue (messageHandler .isResync ())
1591+ # The old smart signaling for Maya 2024 will not catch that.
15521592
15531593 # But that will be the last resync:
15541594 testFile = testUtils .getTestScene ("MaterialX" , "sin_compound.usda" )
@@ -1564,6 +1604,7 @@ def testGeomCoponentAssignment(self):
15641604 cmds .setAttr ('{}.filePath' .format (psPathStr ), testFile , type = 'string' )
15651605
15661606 self .assertTrue (messageHandler .isResync ())
1607+ # The old smart signaling for Maya 2024 will not catch that.
15671608
15681609 messageHandler .terminate ()
15691610
0 commit comments