mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
Clean up of placeholder.
This commit is contained in:
parent
f6c32300c2
commit
f4117a7a5c
2 changed files with 17 additions and 0 deletions
|
|
@ -242,6 +242,10 @@ class MayaPlaceholderLoadPlugin(PlaceholderPlugin, PlaceholderLoadMixin):
|
|||
cmds.hide(node)
|
||||
cmds.setAttr(node + ".hiddenInOutliner", True)
|
||||
|
||||
def delete_placeholder(self, placeholder):
|
||||
"""Remove placeholder if building was successful"""
|
||||
cmds.delete(placeholder._scene_identifier)
|
||||
|
||||
def load_succeed(self, placeholder, container):
|
||||
self._parent_in_hierarchy(placeholder, container)
|
||||
|
||||
|
|
|
|||
|
|
@ -1555,6 +1555,15 @@ class PlaceholderLoadMixin(object):
|
|||
self.load_succeed(placeholder, container)
|
||||
self.cleanup_placeholder(placeholder, failed)
|
||||
|
||||
if failed:
|
||||
self.log.debug(
|
||||
"Placeholder cleanup skipped due to failed placeholder "
|
||||
"population."
|
||||
)
|
||||
return
|
||||
if not placeholder.data["keep_placeholder"]:
|
||||
self.delete_placeholder(placeholder)
|
||||
|
||||
def load_failed(self, placeholder, representation):
|
||||
if hasattr(placeholder, "load_failed"):
|
||||
placeholder.load_failed(representation)
|
||||
|
|
@ -1577,6 +1586,10 @@ class PlaceholderLoadMixin(object):
|
|||
|
||||
pass
|
||||
|
||||
def delete_placeholder(self, placeholder, failed):
|
||||
"""Called when all item population is done."""
|
||||
self.log.debug("Clean up of placeholder is not implemented.")
|
||||
|
||||
|
||||
class PlaceholderCreateMixin(object):
|
||||
"""Mixin prepared for creating placeholder plugins.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue