Esempio n. 1
0
    def testPreserveSceneNotModified(self):
        """
        Tests that making scene modifications using a
        UsdMayaBlockSceneModificationContext on a scene that has not been
        modified correctly maintains the modification status after the context
        exits.
        """

        with UsdMaya.BlockSceneModificationContext():
            # Create a cube inside the context manager.
            cmds.polyCube()

        # The scene should NOT be modified.
        self._AssertSceneIsModified(False)
Esempio n. 2
0
    def testPreserveSceneModified(self):
        """
        Tests that making scene modifications using a
        UsdMayaBlockSceneModificationContext on a scene that has already been
        modified correctly maintains the modification status after the context
        exits.
        """

        # Create a cube to dirty the scene.
        cmds.polyCube()
        self._AssertSceneIsModified(True)

        with UsdMaya.BlockSceneModificationContext():
            # Create a cube inside the context manager.
            cmds.polyCube()

        # The scene should still be modified.
        self._AssertSceneIsModified(True)