mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Toggle instances with visibility.
This commit is contained in:
parent
bd69ae2b54
commit
ee247ea58b
2 changed files with 10 additions and 0 deletions
|
|
@ -22,3 +22,12 @@ def install():
|
|||
api.register_plugin_path(
|
||||
api.Creator, os.path.join(plugins_directory, "create")
|
||||
)
|
||||
|
||||
pyblish.api.register_callback(
|
||||
"instanceToggled", on_pyblish_instance_toggled
|
||||
)
|
||||
|
||||
|
||||
def on_pyblish_instance_toggled(instance, old_value, new_value):
|
||||
"""Toggle layer visibility on instance toggles."""
|
||||
instance[0].Visible = new_value
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ class CollectInstances(pyblish.api.ContextPlugin):
|
|||
instance.data["families"] = self.families_mapping[
|
||||
layer_data["family"]
|
||||
]
|
||||
instance.data["publish"] = layer.Visible
|
||||
|
||||
# Produce diagnostic message for any graphical
|
||||
# user interface interested in visualising it.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue