mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Cleanup fix_incompatile_containers
- Do not just print all loader names always :) - Define invalid names ones - Use a set for faster lookups - Log some decent info message whenever it does trigger on legacy scene
This commit is contained in:
parent
bc15989b2e
commit
667e8373b9
1 changed files with 13 additions and 10 deletions
|
|
@ -2811,19 +2811,22 @@ def get_attr_in_layer(attr, layer):
|
||||||
|
|
||||||
def fix_incompatible_containers():
|
def fix_incompatible_containers():
|
||||||
"""Backwards compatibility: old containers to use new ReferenceLoader"""
|
"""Backwards compatibility: old containers to use new ReferenceLoader"""
|
||||||
|
old_loaders = {
|
||||||
|
"MayaAsciiLoader",
|
||||||
|
"AbcLoader",
|
||||||
|
"ModelLoader",
|
||||||
|
"CameraLoader",
|
||||||
|
"RigLoader",
|
||||||
|
"FBXLoader"
|
||||||
|
}
|
||||||
host = registered_host()
|
host = registered_host()
|
||||||
for container in host.ls():
|
for container in host.ls():
|
||||||
loader = container['loader']
|
loader = container['loader']
|
||||||
|
if loader in old_loaders:
|
||||||
print(container['loader'])
|
log.info(
|
||||||
|
"Converting legacy container loader {} to "
|
||||||
if loader in ["MayaAsciiLoader",
|
"ReferenceLoader: {}".format(loader, container["objectName"])
|
||||||
"AbcLoader",
|
)
|
||||||
"ModelLoader",
|
|
||||||
"CameraLoader",
|
|
||||||
"RigLoader",
|
|
||||||
"FBXLoader"]:
|
|
||||||
cmds.setAttr(container["objectName"] + ".loader",
|
cmds.setAttr(container["objectName"] + ".loader",
|
||||||
"ReferenceLoader", type="string")
|
"ReferenceLoader", type="string")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue