hou.SopNode class

Represents a surface node.

All Methods Replaces

Inheritence: hou.Node >

Methods

Methods inherited from hou.Node: evalParm, createNode, move, clearParmAliases, inputAncestors, reorderChildrenToEnd, childTypeCategory, children, isInsideLockedHDA, appendComment, addSpareParmTuple, findNetworkBox, fileReferences, relativePathTo, color, removeSpareParmTuple, saveToGallery, __getitem__, indirectInputs, modificationTime, inputConnectors, saveOldStylePresetsFile, loadOldStylePresetsFile, findNetworkBoxes, asXML, runInitScripts, cook, permissions, hdaModule, copyNetworkBox, outputConnections, name, parmsInFolder, parmTuplesInFolder, saveCookCodeToFile, nodeGroups, creator, setNextInput, replaceSpareParmTuple, loadChildrenFromFile, loadPresets, findStickyNotes, setCurrent, moveToGoodPosition, findOrCreateMotionEffectsNetwork, selectedChildren, errors, hide, addPermissions, removePermissions, isSelected, isLocked, extractAndDelete, setPermissions, createStickyNote, isBuiltExplicitly, __ne__, expressionLanguage, stickyNotes, parmTuples, parent, matchCurrentDefinition, __setitem__, isCurrent, path, setPosition, setDeleteScript, setExpressionLanguage, messages, createDigitalAsset, asCode, comment, setSelected, outputConnectors, setInput, saveCompiledCookCodeToFile, reorderChildrenToBeginning, parms, size, parmAliases, extraInputs, reorderChildrenAfter, allowEditingOfContents, layoutChildren, deleteScript, isHidden, fileReferencePatterns, spareParms, setName, outputs, parm, extraOutputs, setCreatorState, isTimeDependent, __eq__, networkBoxes, setColor, info, type, parmToNodeReferences, creationTime, referencedNodes, removeSpareParmFolder, _getArgumentAutoComplete, motionEffectsNetworkPath, insertInput, setFirstInput, addNodeGroup, creatorState, addSpareParmFolder, nodeGroup, collapseIntoSubnet, findStickyNote, parmTuple, copyStickyNote, destroy, changeNodeType, evalParmTuple, node, inputs, digitsInName, warnings, saveChildrenToFile, glob, matchesCurrentDefinition, findParms, createNetworkBox, stampValue, reorderChildrenBefore, setBuiltExplicitly, setComment, allSubChildren, recursiveGlob, sessionId, inputConnections, position

geometry(self)hou.Geometry

Return the geometry computed by this SOP node. If the SOP has not already cooked, this method will cook the SOP.

The returned Geometry object is not frozen. See hou.Geometry.freeze for more information on frozen Geometry objects.

curPoint(self) → Point

Return this node’s current point. You would typically call this method from an expression on a node that iterates over a set of points and re-evaluates the parameter for each point.

This method lets you implement the Python equivalent of Hscript’s local variables. Many of Houdini’s SOPs iterate over a set of points, and for each point they store the current point and then evaluate a parameter. If the parameter contains a local variable, Houdini looks up the SOP’s current point when evaluating that variable. For example, the point SOP evaluates the t parameter for each point, and sets that point’s position according to the value of the parameter. If that parameter contains, say, the local variable $TX, it will evaluate to the x position of the current point.

This method gives you access to the hou.Point representation of Houdini’s current point. Using this point you could evaluate the position, an attribute value, or do more complex operations like compute the distance from the point to the origin.

Raises hou.OperationFailed if you call this method from outside a SOP parameter expression, or if the SOP does not support local variables.

The following lists Python equivalents for some point-related Hscript expression local variables. Note that you can also access local variables from Python using hou.lvar.

# $PT (Hscript expression) or lvar('PT') (Python):
pwd().curPoint().number()

# $NPT (Hscript expression) or lvar('NPT') (Python):
len(pwd().geometry().iterPoints())

# $TX (Hscript expression) or lvar('TX') (Python):
pwd().curPoint().position()[0]

# $WEIGHT (Hscript expression) or lvar('WEIGHT`) (Python):
pwd().curPoint().position()[3]

# $CR (Hscript expression) or lvar('CR') (Python):
pwd().curPoint().attribValue("Cd")[0]

# $ID (Hscript expression) or lvar('ID') (Python):
pwd().curPoint().attribValue("id")

# $LIFE (Hscript expression) or lvar('LIFE') (Python):
pwd().curPoint().attribValue("life")

# $VX (Hscript expression) or lvar('VX') (Python):
pwd().curPoint().attribValue("v")[0]

setCurPoint(self, point_or_none)

Set this node’s current point. You can only call this method from a Python-defined SOP.

See hou.SopNode.curPoint for an explanation of a SOP’s current point. You would use this method to set the current point from inside a SOP written in Python, before you evaluate a parameter containing a local variable referring to the current point. See hou.Geometry.globPoints for an example.

Note that you can set the current point to None. In this case, subsequent calls to hou.SopNode.curPoint will raise hou.OperationFailed. After a Python SOP is done cooking, Houdini will automatically set the current point back to None.

Raises hou.OperationFailed if called from outside a Python-defined SOP.

curPoint2(self) → Point

Not implemented yet

curPrim(self) → Prim

Return this node’s current primitive. You would typically call this method from an expression on a node that iterates over a set of primitives and re-evaluates the parameter for each primitive.

See hou.SopNode.curPoint for more information.

The following lists Python equivalents for some primitive-related Hscript expression local variables. Note that you can also access local variables from Python using hou.lvar.

# $PR (Hscript expression) or lvar('PR') (Python):
pwd().curPrim().number()

# $NPR (Hscript expression) or lvar('NPR') (Python):
len(pwd().geometry().iterPrims())

# $NX (Hscript expression) or lvar('NX') (Python):
pwd().curPrim().attribValue("N")[0]
pwd().curPrim().normal()[0]

# $CR (Hscript expression) or lvar('CR') (Python):
pwd().curPrim().attribValue("Cd")[0]

curPrim2(self) → Prim

Not implemented yet

setCurPrim(self, prim_or_none)

Set this node’s current primitive. You can only call this method from a Python-defined SOP. See hou.SopNode.setCurPoint for more information.

curVertex(self) → Vertex

Return this node’s current vertex. You would typically call this method from an expression on a node that iterates over a set of primitive vertices and re-evaluates the parameter for each vertex.

See hou.SopNode.curPoint for more information.

Note that hou.SopNode.curPrim returns the primitive containing this vertex returned by this method.

The following lists Python equivalents for some vertex-related Hscript expression local variables. Note that you can also access local variables from Python using hou.lvar.

# $VTX (Hscript expression) or lvar('VTX') (Python):
pwd().curVertex().number()

# $NVTX (Hscript expression) or lvar('NVTX') (Python):
pwd().curPrim().numVertices()

curVertex2(self) → Vertex

Not implemented yet

setCurVertex(self, vertex_or_none)

Set this node’s current primitive. You can only call this method from a Python-defined SOP. See hou.SopNode.setCurPoint for more information.

Note that setting the current vertex will also set the current primitive to the primitive containing the vertex.

curPointBoundingBox(self) → BoundingBox

Not implemented yet

curPointBoundingBox2(self) → BoundingBox

Not implemented yet

curPrimBoundingBox(self) → BoundingBox

Not implemented yet

curPrimBoundingBox2(self) → BoundingBox

Not implemented yet

displayNode(self) → Node

If this is a subnet SOP, return the SOP inside the subnet with its display flag on. Otherwise, return None.

renderNode(self)hou.Node

If this is a subnet SOP, return the SOP inside the subnet with its render flag on. Otherwise, return None.

isBypassed(self)bool

Return whether this node’s bypass flag is on.

bypass(self, on)

Turn this node’s bypass flag on or off, making this node have no effect.

isDisplayFlagSet(self)bool

Return whether this node’s display flag is on.

setDisplayFlag(self, on)

Turn this node’s display flag on or off.

isRenderFlagSet(self)bool

Return whether this node’s render flag is on.

setRenderFlag(self, on)

Turns this node’s render flag on or off.

isHighlightFlagSet(self)bool

Return whether this node’s highlight flag is on. When this flag is turned on, Houdini displays portions of the geometry in yellow in the viewport, to indicate the operations performed by this SOP.

setHighlightFlag(self, on)

Turn this node’s highlight flag on or off.

isTemplateFlagSet(self)bool

Returns whether this node’s template flag is on. Templated SOPs are display as wireframe in the viewport, and you cannot select geometry from them.

setTemplateFlag(self, on)

Turns this node’s template flag on or off.

isSelectableTemplateFlagSet(self)bool

Return whether this node’s selectable template flag is on. A selectable template displays like the display SOP in the viewport, and you can select it when choosing points, primitives, etc. Note that only the display SOP will be included in the containing geometry object or SOP subnet, however, so selectable templates are only visible while working inside their SOP network.

setSelectableTemplateFlag(self, on)

Turn this node’s selectable template flag on or off.

isHardLocked(self)bool

Return whether this node is hard-locked. A hard-locked node stores its data inside the node, and no longer responds to parameter or input node changes.

setHardLocked(self, on)

Turn this node’s hard-lock flag on or off. Locking a node saves its current cooked geometry into the node. If you unlock a hard-locked node, it will discard its locked geometry data and recook, computing its geometry from its inputs and parameters.

isSoftLocked(self)bool

Return whether this node is soft-locked. A soft-locked node stores position delta information , preventing all but a small set of manual modeling changes from being made.

setSoftLocked(self, on)

Turns this node’s soft-lock flag on or off, allowing a subset of manual modeling changes to be made to the locked node.

isUnloadFlagSet(self)bool

Returns whether this node’s unload flag is on.

setUnloadFlag(self, on)

Turns this node’s unload flag on or off.

memorySizeInBytes(self)

Not implemented yet

createEditSopFromThisTo(self, sop_node, look_for_deforms=False)

Not implemented yet

Replaces