Nuke: Legacy convertor skips deprecation warnings (#4846)

* convert legacy checks for AVALON_TAB to avoid deprecation warnings

* simplify 'get_avalon_knob_data'
This commit is contained in:
Jakub Trllo 2023-04-21 11:31:52 +02:00 committed by GitHub
parent 452b4623ba
commit 843fd5f1b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 9 deletions

View file

@ -495,17 +495,17 @@ def get_avalon_knob_data(node, prefix="avalon:", create=True):
data (dict)
"""
data = {}
if AVALON_TAB not in node.knobs():
return data
# check if lists
if not isinstance(prefix, list):
prefix = list([prefix])
data = dict()
prefix = [prefix]
# loop prefix
for p in prefix:
# check if the node is avalon tracked
if AVALON_TAB not in node.knobs():
continue
try:
# check if data available on the node
test = node[AVALON_DATA_GROUP].value()
@ -516,8 +516,7 @@ def get_avalon_knob_data(node, prefix="avalon:", create=True):
if create:
node = set_avalon_knob_data(node)
return get_avalon_knob_data(node)
else:
return {}
return {}
# get data from filtered knobs
data.update({k.replace(p, ''): node[k].value()