diff --git a/openpype/hosts/maya/api/__init__.py b/openpype/hosts/maya/api/__init__.py index 9ea798e927..0eea8c4a53 100644 --- a/openpype/hosts/maya/api/__init__.py +++ b/openpype/hosts/maya/api/__init__.py @@ -10,12 +10,6 @@ from .pipeline import ( ls, containerise, - - lock, - unlock, - is_locked, - lock_ignored, - ) from .plugin import ( Creator, @@ -54,11 +48,6 @@ __all__ = [ "ls", "containerise", - "lock", - "unlock", - "is_locked", - "lock_ignored", - "Creator", "Loader", diff --git a/openpype/hosts/maya/api/pipeline.py b/openpype/hosts/maya/api/pipeline.py index 476ceb840b..2c6335b87b 100644 --- a/openpype/hosts/maya/api/pipeline.py +++ b/openpype/hosts/maya/api/pipeline.py @@ -187,76 +187,6 @@ def uninstall(): menu.uninstall() -def lock(): - """Lock scene - - Add an invisible node to your Maya scene with the name of the - current file, indicating that this file is "locked" and cannot - be modified any further. - - """ - - if not cmds.objExists("lock"): - with lib.maintained_selection(): - cmds.createNode("objectSet", name="lock") - cmds.addAttr("lock", ln="basename", dataType="string") - - # Permanently hide from outliner - cmds.setAttr("lock.verticesOnlySet", True) - - fname = cmds.file(query=True, sceneName=True) - basename = os.path.basename(fname) - cmds.setAttr("lock.basename", basename, type="string") - - -def unlock(): - """Permanently unlock a locked scene - - Doesn't throw an error if scene is already unlocked. - - """ - - try: - cmds.delete("lock") - except ValueError: - pass - - -def is_locked(): - """Query whether current scene is locked""" - fname = cmds.file(query=True, sceneName=True) - basename = os.path.basename(fname) - - if self._ignore_lock: - return False - - try: - return cmds.getAttr("lock.basename") == basename - except ValueError: - return False - - -@contextlib.contextmanager -def lock_ignored(): - """Context manager for temporarily ignoring the lock of a scene - - The purpose of this function is to enable locking a scene and - saving it with the lock still in place. - - Example: - >>> with lock_ignored(): - ... pass # Do things without lock - - """ - - self._ignore_lock = True - - try: - yield - finally: - self._ignore_lock = False - - def parse_container(container): """Return the container node's full container data.