Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the cycloneslider domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home2/wacggq0abkde/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the cartel domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home2/wacggq0abkde/public_html/wp-includes/functions.php on line 6114

Warning: Cannot modify header information - headers already sent by (output started at /home2/wacggq0abkde/public_html/wp-includes/functions.php:6114) in /home2/wacggq0abkde/public_html/wp-content/plugins/simple-file-downloader/simple-file-downloader.php on line 292

Warning: Cannot modify header information - headers already sent by (output started at /home2/wacggq0abkde/public_html/wp-includes/functions.php:6114) in /home2/wacggq0abkde/public_html/wp-content/plugins/simple-file-downloader/simple-file-downloader.php on line 293

Warning: Cannot modify header information - headers already sent by (output started at /home2/wacggq0abkde/public_html/wp-includes/functions.php:6114) in /home2/wacggq0abkde/public_html/wp-content/plugins/simple-file-downloader/simple-file-downloader.php on line 294

Warning: Cannot modify header information - headers already sent by (output started at /home2/wacggq0abkde/public_html/wp-includes/functions.php:6114) in /home2/wacggq0abkde/public_html/wp-content/plugins/simple-file-downloader/simple-file-downloader.php on line 295

Warning: Cannot modify header information - headers already sent by (output started at /home2/wacggq0abkde/public_html/wp-includes/functions.php:6114) in /home2/wacggq0abkde/public_html/wp-content/plugins/simple-file-downloader/simple-file-downloader.php on line 296

Warning: Cannot modify header information - headers already sent by (output started at /home2/wacggq0abkde/public_html/wp-includes/functions.php:6114) in /home2/wacggq0abkde/public_html/wp-content/plugins/simple-file-downloader/simple-file-downloader.php on line 297

Warning: Cannot modify header information - headers already sent by (output started at /home2/wacggq0abkde/public_html/wp-includes/functions.php:6114) in /home2/wacggq0abkde/public_html/wp-content/plugins/simple-file-downloader/simple-file-downloader.php on line 298

Warning: Cannot modify header information - headers already sent by (output started at /home2/wacggq0abkde/public_html/wp-includes/functions.php:6114) in /home2/wacggq0abkde/public_html/wp-content/plugins/simple-file-downloader/simple-file-downloader.php on line 299

Warning: Cannot modify header information - headers already sent by (output started at /home2/wacggq0abkde/public_html/wp-includes/functions.php:6114) in /home2/wacggq0abkde/public_html/wp-content/plugins/simple-file-downloader/simple-file-downloader.php on line 300

Warning: Cannot modify header information - headers already sent by (output started at /home2/wacggq0abkde/public_html/wp-includes/functions.php:6114) in /home2/wacggq0abkde/public_html/wp-content/plugins/simple-file-downloader/simple-file-downloader.php on line 301
####################################################################################################################### __author__ = "Boris Martinez Castillo" __version__ = "1.0.1" __maintainer__ = "Boris Martinez Castillo" __email__ = "boris.vfx@outlook.com" ####################################################################################################################### import nuke import nukescripts import itertools import re ####################################################################################################################### # GLOBALS DOT_COUNT = 0 # HELPER FUNCTION DEFINITIONS def select_node(node_class): """ This function makes sure you select a node of a given class. :param node_class: passed class node. :return: selected node of class node_class. """ class_ = node_class try: node = nuke.selectedNode() if node.Class() == class_: node['selected'].setValue(False) return node else: message = "Please, select a {} Node".format(class_) nuke.message(message) except ValueError: message = "Please, select a {} Node".format(class_) nuke.message(message) def find_dependencies(node_class): """ This function will return a list with the dependencies of the selected node. :param node_class: passed class node. :return: dependencies of a selected node of class node_class. """ node = select_node(node_class) dep_node = nuke.dependencies(node) return dep_node def get_node_position(node): """ This function will return the position of a node. :param node: a nuke node object. :return: return a set of coordinates. """ pos_dict = {"x_pos": node.xpos(),"y_pos": node.ypos()} return pos_dict def get_righthandside_position(node_list): """ This function will return the position of the right hand side node of a selection of nodes. :param node_list: a list of nuke nodes. :return: return a set of coordinates. """ x_pos_list = [] y_pos_list = [] for node in node_list: pos = get_node_position(nuke.toNode(node)) x_pos_list.append(pos["x_pos"]) y_pos_list.append(pos["y_pos"]) max_x_pos = max(x_pos_list) min_x_pos = min(x_pos_list) avg_y_pos = sum(y_pos_list) / len(y_pos_list) return min_x_pos,max_x_pos,avg_y_pos def create_node_with_position(nodename,connect_node,x=0,y=0): """ This function will create a node in a given position and connect it to a given node. :param nodename: nuke node class to be created. :param connect_node: node to connect the created node to. :param x: x coordinate. :param y: y coordinate. :return: created node object. """ node = nuke.createNode(nodename,inpanel=False) node['selected'].setValue(False) node.setXpos(int(x)) node.setYpos(int(y)) node.setInput(0,connect_node) return node def create_node_with_position_simple(nodename,x=0,y=0): """ This function will create a node in a given position. :param nodename: nuke node class to be created. :param x: x coordinate. :param y: y coordinate. :return: created node. """ node = nuke.createNode(nodename,inpanel=False) node['selected'].setValue(False) node.setXpos(int(x)) node.setYpos(int(y)) return node def d_dot_parent(parentname,nodename,connect_node,x=0,y=0): """ This functions will create a custom "dDot" node. :param parentname: name of the dDot. :param nodename: nuke node class to be created. :param connect_node: node to connect the created node to. :param x: x coordinate. :param y: y coordinate. :return: created dDot node object. """ parentName = parentname parentKnob = nuke.Text_Knob('parent', 'parent') newDot = create_node_with_position(nodename,connect_node,x,y) newDot.knob('label').setValue('[value name]') newDot.knob('name').setValue(parentName) newDot.knob('tile_color').setValue(0) newDot.knob('note_font_size').setValue(33) newDot.addKnob(parentKnob) return newDot def build_depth_setup(node_list): """ This functions will create a custom depth from deep setup. :param node_list: a list of nuke nodes. :return: none. """ positions = get_righthandside_position(node_list) deep_merge = create_node_with_position_simple("DeepMerge",positions[1] + 500, positions[2]+100) deep_merge['selected'].setValue(True) deep_to_image = nuke.createNode("DeepToImage") deep_to_image_pos = get_node_position(deep_to_image) deep_to_image.setYpos(deep_to_image_pos["y_pos"] + 50) unpremult = nuke.createNode("Unpremult") unpremult['channels'].setValue("Zdepth") deep_to_image_pos = get_node_position(unpremult) unpremult.setYpos(deep_to_image_pos["y_pos"] + 25) expression = nuke.createNode("Expression") expression['channel3'].setValue("depth") expression['expr3'].setValue("Zdepth.red == 0 ? inf : Zdepth.red") expression_pos = get_node_position(expression) expression.setYpos(expression_pos["y_pos"] + 25) remove = nuke.createNode("Remove") remove["operation"].setValue("keep") remove["channels"].setValue("rgba") remove["channels2"].setValue("depth") remove_pos = get_node_position(remove) remove.setYpos(remove_pos["y_pos"] + 25) deep_write = create_node_with_position("Write",remove,get_node_position(remove)["x_pos"],get_node_position(remove)["y_pos"] + 200) counter = 0 for node in node_list: deep_merge.setInput(counter,nuke.toNode(node)) counter += 1 return def get_asset_name(sourcenode): """ This functions will retrieve the dDot connected to the deepRead name. :param sourcenode: :return: """ source_node = nuke.toNode(sourcenode) target_class = "Dot" dep_nodes = nuke.dependencies(source_node) for node in dep_nodes: if node.Class() == target_class: asset_name = node["name"].value() pattern = re.compile(r"(\w+)_(\w+)") if not pattern.match(asset_name): return None else: split_name = asset_name.split("_") asset_name = split_name[0] return asset_name else: print "no Dot nodes found, Autocomp will not work here!!" return None def check_upstream_match(sourcenode,targetnode): """ This function will try to match a given upstream node class match. :param sourcenode: a source nuke node. :param targetnode: a target nuke node. :return: """ source_node = nuke.toNode(sourcenode) target_node = nuke.toNode(targetnode) dep_nodes = nuke.dependencies(source_node) if target_node in dep_nodes: return True else: for node in dep_nodes: return check_upstream_match(node.name(),targetnode) def create_deep_holdout_setup(node_class): """ This functions will create a custom deep holdout setup. :param node_class: a nuke class node. :return: """ global DOT_COUNT deep_node = nuke.selectedNode() dependencies = find_dependencies(node_class) asset_name = get_asset_name(deep_node.name()) pos1 = get_node_position(deep_node) pos2 = get_node_position(dependencies[1]) deep_holdout = create_node_with_position("DeepHoldout2",deep_node,pos1["x_pos"],pos1["y_pos"] + 100) dot = create_node_with_position("Dot",dependencies[1],pos2["x_pos"],pos2["y_pos"]+ 200) pos3 = get_node_position(deep_holdout) pos4 = get_node_position(dot) deep_merge = create_node_with_position("DeepMerge",deep_holdout,pos3["x_pos"] + 150,pos3["y_pos"]- 50) deep_holdout.setInput(1,deep_merge) merge = create_node_with_position("Merge2",deep_holdout,pos3["x_pos"],pos3["y_pos"]+ 100) merge.setInput(1,dot) merge['operation'].setValue("difference") merge2 = create_node_with_position("Merge2",dot,pos4["x_pos"]-35,pos4["y_pos"]+ 100) merge2.setInput(1,merge) merge2['operation'].setValue("divide") pos5 = get_node_position(merge2) shuffle = create_node_with_position("Shuffle",merge2,pos5["x_pos"],pos5["y_pos"]+ 100) shuffle['label'].setValue("ALPHA TO RGB") channels = ["red","green","blue","alpha"] for channel in channels: shuffle[channel].setValue("alpha") pos6 = get_node_position(shuffle) if asset_name == None: asset_name = " " string = str.lower(asset_name + "_" + "holdout") + "_" + str(DOT_COUNT) elif asset_name != None: string = str.lower(asset_name + "_" + "holdout") + "_" + str(DOT_COUNT) if nuke.toNode(string): DOT_COUNT += 1 string = str.lower(asset_name + "_" + "holdout") + "_" + str(DOT_COUNT) switch = create_node_with_position("Switch",shuffle,pos6["x_pos"],pos6["y_pos"]+ 200) pos7 = get_node_position(switch) switch_dot = create_node_with_position_simple("Dot",pos7["x_pos"]-150,pos7["y_pos"]) switch.setInput(1,switch_dot) switch['label'].setValue("[value which]") last_dot = d_dot_parent(string,"Dot",switch,pos7["x_pos"]+35,pos7["y_pos"]+ 500) pos8 = get_node_position(last_dot) write = create_node_with_position("Write",switch,pos7["x_pos"]-155,pos8["y_pos"]- 200) return deep_holdout,last_dot # UNMODIFIED dDOT RELEVANT FUNCTIONS, PLEASE GIVE ALL dDOT FUNCIONALITY'S CREDIT TO ITS AUTHOR DANIEL BARTHA. ALSO, IT'S A VERY GOOD IDEA TO GET THE FULL VERSION FROM NUKEPEDIA def dDotParent(): parentName = nuke.getInput('ParentName','') parentKnob = nuke.Text_Knob('parent', 'parent') if parentName == None: return False if parentName == '': nuke.message('No parent name given.') return False if nuke.Root().selectedNode() == None: nuke.message('Error:Nothing is selected.') elif len(nuke.selectedNodes()) > 1: nuke.message('Error:Multiple nodes selected') elif nuke.selectedNode().Class() == 'Dot': if nuke.selectedNode().knob('child'): nuke.message("Error:It's a child.") else: nuke.selectedNode().knob('label').setValue('[value name]') nuke.selectedNode().knob('name').setValue(parentName) nuke.selectedNode().knob('tile_color').setValue(0) nuke.selectedNode().knob('note_font_size').setValue(33) if nuke.selectedNode().knob('parent'): pass else: nuke.selectedNode().addKnob(parentKnob) else: newDot = nuke.createNode('Dot') newDot.knob('label').setValue('[value name]') newDot.knob('name').setValue(parentName) newDot.knob('tile_color').setValue(0) newDot.knob('note_font_size').setValue(33) newDot.addKnob(parentKnob) def dDotConnect(): dotList = [] for node in nuke.allNodes('Dot'): if node.knob('parent'): dotList.append(node.name()) dotList.sort() p = nuke.Panel('Parent Dot List') p.addEnumerationPulldown('Parent',' '.join(dotList)) ret = p.show() if p.value('Parent') != None: selectedParent = p.value('Parent') else: return False parent = nuke.toNode(selectedParent) selectedNodes = nuke.selectedNodes() childKnob = nuke.Text_Knob('child', 'child') if len( selectedNodes ) !=0: for n in selectedNodes: if n.knob('parent'): pass elif n.Class() != 'Dot': pass else: n.connectInput(0, parent) n.knob('label').setValue(selectedParent) n.knob('tile_color').setValue(0) n.knob('hide_input').setValue(True) n.knob('note_font').setValue('italic') n.knob('note_font_size').setValue(22) parentColor = n.input(0).knob('note_font_color').getValue() parentColor = int(parentColor) n.knob('note_font_color').setValue(parentColor) childKnob = nuke.Text_Knob('child', 'child') if n.knob('child'): pass elif n.knob('parent'): pass elif n.Class() != 'Dot': pass else: n.addKnob(childKnob) else: nuke.createNode("Dot").connectInput(0, parent) nuke.selectedNode().knob('label').setValue(selectedParent) nuke.selectedNode().knob('tile_color').setValue(0) nuke.selectedNode().knob('hide_input').setValue(True) nuke.selectedNode().knob('note_font').setValue('italic') nuke.selectedNode().knob('note_font_size').setValue(22) nuke.selectedNode().addKnob(childKnob) parentColor = nuke.selectedNode().input(0).knob('note_font_color').getValue() parentColor = int(parentColor) nuke.selectedNode().knob('note_font_color').setValue(parentColor) def dDotAutoConnect(): for d in nuke.selectedNodes('Dot'): if d.knob('child'): childLabel = d.knob('label').getValue() parent = nuke.toNode(childLabel) try: parentColor = parent.knob('note_font_color').getValue() parentColor = int(parentColor) except: parentColor = 4278190335 if d.input(0) == None: d.connectInput(0, parent) d['tile_color'].setValue(0) d.knob('note_font_size').setValue(22) d.knob('note_font_color').setValue(parentColor) else: parentName = d.input(0).knob('name').getValue() if childLabel != parentName: d.connectInput(0, parent) d['tile_color'].setValue(0) d.knob('note_font_size').setValue(22) d.knob('note_font_color').setValue(parentColor) dDotCheckInput() # HOLDOUTS def iterate_deep_holdout_setup(): """ This function will iterate over a set of DeepRecolor nodes and create a holdout setup for each. :return: none """ if not nuke.selectedNodes(): nuke.message("no nodes selected, please try again!") return else: names = [] deep_holdouts = [] selected_nodes = [] dots = [] for i in nuke.selectedNodes(): if i.Class() != "DeepRecolor": nuke.message("Please, select only DeepRecolor Nodes") return else: names.append(i.name()) i['selected'].setValue(False) for e in names: node = nuke.toNode(e) class_ = node.Class() node['selected'].setValue(True) setup = create_deep_holdout_setup(class_) print "setup[1]: " , setup[1] dots.append(setup[1]) if not setup: return deep_holdouts.append(setup[0].name()) counter = 0 for ho in deep_holdouts: hold_out = nuke.toNode(ho) depp = nuke.dependencies(hold_out) deep_merge = depp[1].name() for name in names: if check_upstream_match(ho,name): print "ALELUYA" elif not check_upstream_match(ho,name): nuke.toNode(deep_merge).setInput(counter,nuke.toNode(name)) counter += 1 for i in dots: i['selected'].setValue(True) # UBER PASS ####################################################################################################### def get_middle_position(): """ This function will compute a set of coordinates of convenience. :return: a set of coordinates. """ x_pos_list = [] y_pos_list = [] for node in nuke.selectedNodes(): pos = get_node_position(node) x_pos_list.append(pos["x_pos"]) y_pos_list.append(pos["y_pos"]) max_x_pos = max(x_pos_list) min_x_pos = min(x_pos_list) avg_y_pos = sum(y_pos_list) / len(y_pos_list) diff = max_x_pos - min_x_pos offset = diff / 2 return min_x_pos,offset,avg_y_pos def create_rgba_deep_recolor(channels): """ This function will compute a set of coordinates of convenience. :param channels: :return: a colection of DeepRecolor node objects. """ new_deep_recolor_names = [] for node in nuke.selectedNodes(): dependencies = nuke.dependencies(node) deep = dependencies[0] flat = dependencies[1] pos_x = get_node_position(node)["x_pos"] pos_y = get_node_position(node)["y_pos"] deep_recolor = create_node_with_position("DeepRecolor", deep, pos_x -150,pos_y +450 ) deep_recolor.setInput(1,flat) deep_recolor['tile_color'].setValue(4278239231) deep_recolor['channels'].setValue(channels) new_deep_recolor_names.append(deep_recolor.name()) return new_deep_recolor_names def uberpass_function(): """ This function will deep merge all elemenents together, thus creating the so called uber pass. """ if not nuke.selectedNodes(): nuke.message("no nodes selected, please try again!") return else: node_list = [] for node in nuke.selectedNodes(): node_list.append(node) rgb_deep_recolor = create_rgba_deep_recolor("rgba") for node in node_list: node['selected'].setValue(True) deep_merge = create_node_with_position_simple("DeepMerge",get_middle_position()[0] + get_middle_position()[1],get_middle_position()[2] + 400) deep_to_image = create_node_with_position("DeepToImage",deep_merge,get_node_position(deep_merge)["x_pos"],get_node_position(deep_merge)["y_pos"] + 200) deep_to_image_pos = get_node_position(deep_to_image) switch = create_node_with_position("Switch",deep_to_image,deep_to_image_pos["x_pos"],deep_to_image_pos["y_pos"]+ 200) switch_pos = get_node_position(switch) switch_dot = create_node_with_position_simple("Dot",switch_pos["x_pos"]-150,switch_pos["y_pos"]) switch.setInput(1,switch_dot) switch['label'].setValue("[value which]") string = "uberpass_color_output" last_dot = d_dot_parent(string,"Dot",switch,switch_pos["x_pos"]+35,switch_pos["y_pos"]+ 100) write = create_node_with_position("Write",last_dot,get_node_position(last_dot)["x_pos"],get_node_position(last_dot)["y_pos"] + 200) write['channels'].setValue('all') for name in rgb_deep_recolor: nuke.toNode(name)['selected'].setValue(True) deep_deep_merge = create_node_with_position_simple("DeepMerge",get_middle_position()[0] + get_middle_position()[1] - 800,get_middle_position()[2] + 200) deep_deep_merge_pos = get_node_position(deep_deep_merge) string_deep = "uberpass_deep_output" last_dot_deep = d_dot_parent(string_deep,"Dot",deep_deep_merge,deep_deep_merge_pos["x_pos"]+35,deep_deep_merge_pos["y_pos"]+ 100) deep_write = create_node_with_position("DeepWrite",deep_deep_merge,get_node_position(deep_deep_merge)["x_pos"],get_node_position(deep_deep_merge)["y_pos"] + 200) # DEPTH FOR DEFOCUS ####################################################################################################### def depth_from_deep(): """ This function will create a custom depth from deep setup. """ if not nuke.selectedNodes(): nuke.message("no nodes selected, please try again!") return else: node_list = [] for node in nuke.selectedNodes(): node_list.append(node) rgb_deep_recolor = create_rgba_deep_recolor("all") for name in rgb_deep_recolor: nuke.toNode(name)['selected'].setValue(True) deep_merge = create_node_with_position_simple("DeepMerge",get_middle_position()[0] + get_middle_position()[1],get_middle_position()[2] + 400) deep_to_image = create_node_with_position("DeepToImage",deep_merge,get_node_position(deep_merge)["x_pos"],get_node_position(deep_merge)["y_pos"] + 100) unpremult = create_node_with_position("Unpremult",deep_to_image,get_node_position(deep_to_image)["x_pos"],get_node_position(deep_to_image)["y_pos"] + 100) unpremult['channels'].setValue("depth") expression = create_node_with_position("Expression",unpremult,get_node_position(unpremult)["x_pos"],get_node_position(unpremult)["y_pos"] + 100) expression['channel3'].setValue("depth") expression['expr3'].setValue("Zdepth.red == 0 ? 15000 : Zdepth.red") remove = create_node_with_position("Remove",expression,get_node_position(expression)["x_pos"],get_node_position(expression)["y_pos"] + 100) remove["operation"].setValue("keep") remove["channels"].setValue("rgba") remove["channels2"].setValue("depth") pos6 = get_node_position(remove) string = "depth_from_deep" last_dot = d_dot_parent(string,"Dot",remove,pos6["x_pos"]+35,pos6["y_pos"]+ 100) Write = create_node_with_position("Write",last_dot,get_node_position(last_dot)["x_pos"],get_node_position(last_dot)["y_pos"] + 100) Write['channels'].setValue('all') for node in node_list: node['selected'].setValue(True) # AUTO DDOT COMP ####################################################################################################### def d_dot_connect(nodename,connect_node,x=0,y=0): """ :param nodename: nuke node class to be created. :param connect_node: nuke node to connect to. :param x: x coordinate. :param y: y coordinate. :return: created node object. """ parent_node = nuke.toNode(connect_node) childKnob = nuke.Text_Knob('child', 'child') dot = create_node_with_position(nodename,parent_node,x,y) dot.knob('label').setValue(connect_node) dot.knob('tile_color').setValue(0) dot.knob('hide_input').setValue(True) dot.knob('note_font').setValue('italic') dot.knob('note_font_size').setValue(22) dot.addKnob(childKnob) return dot def gather_holdout_dot_names(): """ This function will get all names of selected Ddots. :return: a list of node names. """ holdout_dots_names = [node['name'].value() for node in nuke.selectedNodes() if node['parent']] return holdout_dots_names def find_holdout_source_elements(houldout_names): """ This function will get all names of selected Ddots. :param houldout_names: a list of node names. :return: """ houldout_processed_list = [] for name in houldout_names: _ = "_".join(name.split('_')[:-2]) if nuke.toNode(_): houldout_processed_list.append(_) else: print "no corresponding element found for {}".format(name) return houldout_processed_list def create_and_connect_child_dots(holdouts,color): """ :param holdouts: :param color: """ print holdouts, color if not color: nuke.message("Autocomp will not work here, please check your elements' dDot names") elif len(holdouts) != len(color): nuke.message("Autocomp will not work here, please check your elements' dDot names") if not holdouts: nuke.message("no nodes selected, please try again!") return else: multiply_list = [] counter = 0 adder = 0 adder_x = 0 pos_f_x = None pos_f_y = None for f,b in itertools.izip(holdouts,color): if counter == 0 : pos_f_x = get_node_position(nuke.toNode(f))["x_pos"] pos_f_y = get_node_position(nuke.toNode(f))["y_pos"] child_holdout_dot = d_dot_connect("Dot",f,pos_f_x,pos_f_y + 1000) child_color_dot = d_dot_connect("Dot",b,pos_f_x - 200,pos_f_y + 1200) multiply = create_node_with_position("Multiply",child_color_dot,pos_f_x - 35 ,pos_f_y + 1190) multiply.setInput(0,child_color_dot) multiply.setInput(1,child_holdout_dot) multiply['label'].setValue("DEEP HOLDOUT MULT BY ZERO") multiply['value'].setValue(0) multiply_list.append(multiply) counter += 1 else: adder += 1000 adder_x += - 1000 child_holdout_dot = d_dot_connect("Dot",f,pos_f_x + adder_x ,pos_f_y + 1000 + adder) child_color_dot = d_dot_connect("Dot",b,pos_f_x - 200 + adder_x ,pos_f_y + 1200 + adder) multiply = create_node_with_position("Multiply",child_color_dot,pos_f_x - 35 + adder_x ,pos_f_y + 1190 + adder ) adder_x = 0 multiply.setInput(0,child_color_dot) multiply.setInput(1,child_holdout_dot) multiply['label'].setValue("DEEP HOLDOUT MULT BY ZERO") multiply['value'].setValue(0) multiply_list.append(multiply) counter = 0 holder = [] for i in range(len(multiply_list)): if counter == 0: x = get_node_position(multiply_list[i])["x_pos"] y = get_node_position(multiply_list[i])["y_pos"] counter += 1 else: x = get_node_position(multiply_list[i])["x_pos"] y = get_node_position(multiply_list[i])["y_pos"] merge = create_node_with_position_simple("Merge2",pos_f_x,y) merge['operation'].setValue('disjoint-over') holder.append(merge) if len(holder) == 1: merge.setInput(0,multiply_list[i-1]) merge.setInput(1,multiply_list[i]) elif len(holder) > 1: print holder[i-2].name() merge.setInput(0,holder[i-2]) merge.setInput(1,multiply_list[i]) # CLASS DEFINITIONS class Panel(nukescripts.PythonPanel): def __init__(self): nukescripts.PythonPanel.__init__(self,"B_deep_survival_toolkit") self.size = self.setMinimumSize(650,160) #CREATE KNOBS self.holdouts = nuke.PyScript_Knob('holdouts','holdouts',"b_deeptoolset.iterate_deep_holdout_setup()") self.depth = nuke.PyScript_Knob('depth','deep2depth',"b_deeptoolset.depth_from_deep()" ) self.uberpass = nuke.PyScript_Knob('uberpass','uberpass',"b_deeptoolset.uberpass_function()" ) self.autocomp = nuke.PyScript_Knob('autocomp','autocomp',"b_deeptoolset.create_and_connect_child_dots(b_deeptoolset.gather_holdout_dot_names(),b_deeptoolset.find_holdout_source_elements(b_deeptoolset.gather_holdout_dot_names()))") self.author = nuke.Text_Knob("Boris Martinez 2020 - www.boris-mc.com") self.about = nuke.Text_Knob("a set of tools to make deep compositing life easier") self._help = nuke.Help_Knob("first of all, select all relevant deepRecolor Nodes. Now, you might want to create a 'deep2depth' and a 'holdouts' setups, if so, please ALWAYS click FIRST on the 'deep2depth' button and then, on the holdouts button (if you invert this order the tool will fail, sorry for that). Alternatively, if you want to create the 'uberpass' setup, please click first on the 'uberpass' button. I don't see why you would want to have all elements and their deep data collapsed into one (uberpass) and also the holdout/deep2depth setups, but if that were the case, then after creating the uberpass, create the 'deep2depth' and the 'holdouts setups', estrictly in this order. Thanks for your cooperation!","help") #ADD KNOBS for i in (self.depth,self.holdouts,self.autocomp,self.uberpass,self.author,self._help): self.addKnob(i) def main_function(): panel = Panel() if not panel.showModalDialog(): print "script aborted" return # ADDING NUKE MENUS # Add B_deepSurvivalToolkit menu mmenu = nuke.menu('Nuke') b_menu = mmenu.addMenu('b_deep_toolset') def add_b_deep_toolkit_tools(): b_menu.addCommand('launch panel','b_deeptoolset.main_function()') add_b_deep_toolkit_tools() # Add dDot fileMenu = nuke.menu('Nuke') backpackMenu = fileMenu.addMenu('dDot') #dDotParent backpackMenu.addCommand("dDot/dDotParent", "b_deeptoolset.dDotParent()", "shift+.") #dDotConnect backpackMenu.addCommand("dDot/dDotConnect", "b_deeptoolset.dDotConnect()", "ctrl+.") #dDotAutoConnect backpackMenu.addCommand("dDot/dDotAutoConnect", "b_deeptoolset.dDotAutoConnect()", "ctrl+shift+.")
Notice: ob_flush(): failed to flush buffer. No buffer to flush in /home2/wacggq0abkde/public_html/wp-content/plugins/simple-file-downloader/simple-file-downloader.php on line 325