import nuke
DELETE_AFTER = False
COLOR_CODE = True
COLOR_CODE_COL = 4282078975
NUKE_VERSION = nuke.NUKE_VERSION_MAJOR + nuke.NUKE_VERSION_MINOR/10
DEFAULT_MAPPINGS = "4 rgba.red 0 0 rgba.red 0 0 rgba.green 0 1 rgba.green 0 1 rgba.blue 0 2 rgba.blue 0 2 rgba.alpha 0 3 rgba.alpha 0 3"
KNOB_LIST = ["red", "green", "blue", "alpha", "black", "white", "red2", "green2"]
VALUE_LIST = KNOB_LIST+["blue2", "alpha2"]
CONVERTED_SUFFIX = "conv"
def get_dependents(node):
output = []
for dep in node.dependent():
for i in range(dep.inputs()):
if dep.input(i) == node:
output.append((i, dep))
return output
def get_conversion_list(selected=False, shuffle_copy=False, disabled=False):
node_list = nuke.selectedNodes("Shuffle2") if selected else nuke.allNodes("Shuffle2")
if not disabled:
node_list = [s for s in node_list if s["disable"].getValue() != 1]
if shuffle_copy:
return node_list
return [s for s in node_list if s.inputs()==1]
def get_mappings_str(node):
m_string = [i for i in node["knobs"].value().splitlines() if i.startswith(" mappings")]
if m_string:
m_string = m_string[0].split("\"
NUKE Shuffle2转换Shuffle
最新推荐文章于 2024-06-03 15:07:18 发布