mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
feat(nuke): upgrading collect legacy write to see new version of write
This commit is contained in:
parent
30f854e872
commit
f0618af38e
1 changed files with 20 additions and 15 deletions
|
|
@ -1,25 +1,30 @@
|
|||
import nuke
|
||||
|
||||
import pyblish.api
|
||||
|
||||
|
||||
class CollectWriteLegacy(pyblish.api.ContextPlugin):
|
||||
class CollectWriteLegacy(pyblish.api.InstancePlugin):
|
||||
"""Collect legacy write nodes."""
|
||||
|
||||
order = pyblish.api.CollectorOrder
|
||||
label = "Collect Write Legacy"
|
||||
order = pyblish.api.CollectorOrder + 0.0101
|
||||
label = "Collect Write node Legacy"
|
||||
hosts = ["nuke", "nukeassist"]
|
||||
|
||||
def process(self, context):
|
||||
def process(self, instance):
|
||||
self.log.info(instance[:])
|
||||
node = instance[0]
|
||||
|
||||
for node in nuke.allNodes():
|
||||
if node.Class() != "Write":
|
||||
continue
|
||||
if node.Class() not in ["Group", "Write"]:
|
||||
return
|
||||
|
||||
if "avalon" not in node.knobs().keys():
|
||||
continue
|
||||
family_knobs = ["ak:family", "avalon:family"]
|
||||
test = [k for k in node.knobs().keys() if k in family_knobs]
|
||||
self.log.info(test)
|
||||
|
||||
instance = context.create_instance(
|
||||
node.name(), family="write.legacy"
|
||||
)
|
||||
instance.append(node)
|
||||
if len(test) == 1:
|
||||
if "render" in node[test[0]].value():
|
||||
self.log.info("render")
|
||||
return
|
||||
|
||||
instance.data.update(
|
||||
{"family": "write.legacy",
|
||||
"families": []}
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue