soptoolutils module

soptoolutils.addBooleanTool(kwargs)
soptoolutils.addUVTool(kwargs, nodetype, uvattribparm)

Generically adds the given nodetype, returning the resulting SOP. The uvattribparm is a parameter that can be filled in with the viewer’s current UV selection if this was put down in the viewport.

soptoolutils.buildBlockBeginCompile(node)

Creates a begin compile block node next to ourself.

soptoolutils.buildBlockMetadata(node)

Creates a metadata import node pointed to ourself next to ourself.

soptoolutils.buildBlockPair(scriptargs, name, begintype, endtype, wire_to_end)

Builds a pair of block nodes, a begin and an end, and links them together nicely.

wire_to_end means to wire to second input on node creation.

soptoolutils.buildPaintNode(previtem, nextnode, parms, props, node_output_index=0, move_new_nodes=True, use_existing=True)

Finds a paint node at or prior to node which matches parms. If not found, builds one. If the attribute does not exist, creates the attribute to paint. It will be inserted prior to nextnode if not none.

soptoolutils.chooseAndApplyTexture(scriptargs, attribname, props, prompt=None, objfilter=None)

Interactively selects an object to apply fluid map operator on

soptoolutils.chooseAndOpenGeoFile(scriptargs, click_to_place)

Opens a file chooser that allows the user to select a geometry file(s). For each chosen file, a File SOP node is created to open that file. The ‘click_to_place’ determines whether the user needs to click on the construction plane to place the geometry, or whether it will be placed automatically at the world origin.

soptoolutils.chooseAndPaintEaseInObject(scriptargs, attribname, props, prompt=None, objfilter=None)

Interactively selects an object in which to paint an attribute with ease-in and ease-out properties.

soptoolutils.chooseAndPaintObject(scriptargs, attribname, props, prompt=None, objfilter=None)

Interactively selects an object in which to paint an attribute and enters the paint state. Existing Paint SOPs will be reused. Otherwise, an Attribute Create SOP (if necessary) and a Paint SOP will be appended.

soptoolutils.createCustomSelectionSopNodeFilterTool(scriptargs, nodetypename, nodename, selection_queries, exact_node_type=True)

Creates sop nodes(s) for the given node type and selection queries. selection_queries is a list of dictionaries, where each dictionary corresponds to the argument list of SceneViewer.selectGeometry plus the additional keys ‘parm_name’, which is the name of the group parameter corresponding to the selection, and ‘is_required’, which specifies if the selection is required. Returns the list of sop nodes created.

soptoolutils.createSopNodeContainer(sceneviewer, newobjectname, merge_context=False, merge_creator=None)

Creates a scene level object node to contain a new SOP node. This function may return an existing object node if the Model in Context option is turned on, or the merge_context parameter is set to True.

soptoolutils.createSopNodeFilter(container, nodetypename, nodename, exact_node_type)

Creates a SOP node that takes an input.

soptoolutils.createSopNodeGenerator(container, nodetypename, nodename, merge_context=False, exact_node_type=True)

Creates a SOP node that doesn’t require an input. If the container already has nodes, this new SOP may be merged with the existing SOPs.

soptoolutils.customSopNodeFilterTool(scriptargs, activepane, nodetypename, prompt=None, exact_node_type=True)
soptoolutils.customStateTool(scriptargs, nodetypename, nodename=None)

Invokes a custom SOP tool. This differs from genericTool() in that the custom state has custom selectors. For filters, we prompt for a single object, then enter into it before entering the custom state.

soptoolutils.findDeformTypeInputSop(endnode)

This function does a depth first traversal of the node input hierarchy to find the first deform-type node. Returns the deform-type node. Returns None if no such node exists.

soptoolutils.findViewersUV(kwargs)

Find the active viewer and return its uv attribute name. If no viewer, return ‘uv’

soptoolutils.genericCaptureTool(scriptargs, nodetypename, nodename=None)

Invokes a generic capture-type SOP tool.

soptoolutils.genericReusableTool(scriptargs, nodetypename, nodename=None, iscapture=False)

Invokes a generic reusable SOP tool. If iscapture is True, then the tool is considered to be a capture-type tool. Capture-type tools will attempt to create new nodes before any deform-type SOPs in the network.

soptoolutils.genericSopNodeFilterTool(scriptargs, nodetypename, nodename, isreusable=False, iscapture=False, allow_obj_sel=True, selector_indices=(), exact_node_type=True)

A generic tool for creating a SOP node that takes another SOP node as input. The user is prompted for selections based on the selector bindings set in the OPbindings file.

soptoolutils.genericSopNodeGeneratorTool(scriptargs, nodetypename, nodename, merge_context=False, prompt=None, exact_node_type=True)

A generic tool for instantiating SOP generator nodes such as Box and Sphere. The user is prompted to select a location in the viewport if the tool was not invoked with the Ctrl key. The new SOP may be merged into an existing scene level object depending onthe merge_context parameter value.

soptoolutils.getGeometrySelections(sceneviewer, selectors, allow_obj_selection=True, prompt=None)

This function invokes a geometry selection for each selector in “selectors”. The selector is not started, but its properties are used when calling sceneviewer.selectGeometry().

soptoolutils.getItemGeometry(item, outputindex=0)

Gets the geometry from the specified item’s output index.

If ‘item’ is a hou.SubnetIndirectInput, the parent subnet’s connections are traversed until we find an actual node. We return None if we end up at an unconnected input.

In the case of indirect inputs, the specified ‘outputindex’ is ignored, since the is no such concepts with indirect inputs. However, the traversal of the parent subnet’s input connections may arrive at a node via an outputindex other than 0, in which case the geometry corresponding to that output is returned.

soptoolutils.initNewSopFilterNode(branch, newnode, selections, container, force_keep_original_objects=False)
soptoolutils.initNewSopFilterNodeWithOutput(branch, newnode, selections, container, outputnode, force_keep_original_objects=False)
soptoolutils.initReusedSopFilterNode(reusednode, selections, container)
soptoolutils.paintObject(scriptargs, object_nodes, attribname, props, objfilter=None)

Paints an attribute on an object node. Loops through object_nodes and uses the first paintable object (it must have a valid display node). Existing Paint SOPs will be reused. If none is found, an Attribute Create SOP (if necessary) and a Paint SOP will be appended.

soptoolutils.scriptSopFilterTool(scriptargs, nodetypename, nodename=None, center_on_selection=False, translate_parm_name=None, connected_selection=True, orient=None, exact_node_type=True)

Creates a new script operator (OTL) that operates on existing geometry. This can be used when no generic tool exists for the desired operator.

soptoolutils.setGroupParmsOnSopNode(node, selector, selection)

Sets the group type and group parameters on the given node based on the selection info.

soptoolutils.setupBendRegions(scriptargs, node)

Cooks the input to node to find its bounding box and sets the capture region of node to encompass that.