hou.ObjNode class

All Methods Replaces

Inheritence: hou.Node >

Subclasses: hou.LightObjNode , hou.BoneObjNode , hou.GeometryObjNode

Methods

Methods inherited from hou.Node: curChild, evalParm, createNode, move, clearParmAliases, copyNetworkBox, reorderChildrenToEnd, allSubChildrenOfType, deleteChild, childTypeCategory, children, isInsideLockedHDA, appendComment, removeColorRampKey, addSpareParmTuple, findNetworkBox, fileReferences, relativePathTo, setSelected, removeSpareParmTuple, addSpareParmFolder, indirectInputs, childrenOfType, inputConnectors, modificationTime, findNetworkBoxes, isNetwork, asXML, runInitScripts, cook, permissions, hdaModule, inputAncestors, outputConnections, name, parmsInFolder, subpathUpToNonSubnet, parmTuplesInFolder, saveCookCodeToFile, nodeGroups, creator, setNextInput, loadPresets, nodeGroup, parmTuple, extraOutputs, selectedChildren, errors, hide, saveDefinition, addPermissions, removePermissions, setColorRampKey, isSelected, isLocked, extractAndDelete, setPermissions, findNodes, expressionLanguage, parmTuples, parent, matchesDefinition, matchCurrentDefinition, isCurrent, path, setPosition, setDeleteScript, pickedChildrenRecursively, __ne__, setColor, pickedChildren, createDigitalAsset, asCode, inputs, comment, color, outputConnectors, __getitem__, setInput, saveCompiledCookCodeToFile, reorderChildrenToBeginning, parms, size, parmAliases, findParms, allowEditingOfContents, reorderChildrenAfter, extraInputs, layoutChildren, deleteScript, isHidden, fileReferencePatterns, spareParms, setName, unsetInput, outputs, parm, setCreatorState, __eq__, networkBoxes, setExpressionLanguage, info, showFloatingDetailsViewWindow, type, parmToNodeReferences, creationTime, showFloatingParmWindow, referencedNodes, removeSpareParmFolder, _getArgumentAutoComplete, insertInput, creatorState, addNodeGroup, setFirstInput, saveOldStylePresetsFile, stampValue, collapseIntoSubnet, setCurrent, destroy, changeNodeType, evalParmTuple, node, moveToGoodPosition, digitsInName, warnings, glob, position, loadOldStylePresetsFile, createNetworkBox, savePresets, reorderChildrenBefore, colorRampKeys, setComment, allSubChildren, sessionId, inputConnections, matchesCurrentDefinition

buildLookatRotation(self, to_node, up_vector=None)hou.Matrix4

Returns a matrix that will rotate this object to look at the specified object.

The hou.Matrix4 object that is returned transforms this object from its current position in world space so that its negative z axis points at the origin of the to_node object.

up_vector can either be a hou.Vector3 object or None. If it is None, this method uses an up vector of hou.Vector3(0, 1, 0).

You can extract the rotation values from the return value with hou.Matrix4.extractRotates. You can set an object’s transformation with hou.ObjNode.setWorldTransform.

# Set the cam1 object's transform so it points at geo1.
cam1 = hou.node("/obj/cam1")
lookat_obj = hou.node("/obj/geo1")
cam1.setWorldTransform(cam1.buildLookatRotation(lookat_obj))

See also the setWorldTransform() method.

combine(self, nodes)

Combines the geometry from the given list of hou.ObjNode’s into this object. After this operation, the old objects will be deleted.

This function will raise hou.ObjectWasDeleted if any of nodes no longer exist in Houdini. It will raise a HOM_TypeError if any of the nodes are not of type hou.ObjNode. These exceptions are raised prior to performing the combine operation to avoid partial results.

displayNode(self)hou.Node or None

Not documented yet

getTransformFromPointToPoint(self, pos3, other_node, other_pos3)hou.Matrix4

Returns the transformation matrix that rotates the point pos3 (in this object node’s transform space) node to the point other_pos3 (in another object node’s transform space).

obj1.getTransformFromPointToPoint(pos1, obj2, pos2)

…is equivalent to…

obj1.worldTransform().inverted() \
* hou.hmath.buildTranslate(-pos1) \
* hou.hmath.buildTranslate(pos2) \
* obj2.worldTransform()

See also the getTransformToNode() and worldTransform() methods, and the functions in the hou.hmath module.

getTransformToNode(self, obj_node)hou.Matrix4

Returns a matrix that transforms this node to line up with the other node.

node1.getTransformToNode(node2) is equivalent to node1.worldTransform().inverted() * node2.worldTransform().

To align node1 (an ObjNode object) with node2 (another ObjNode object), you don’t need to use getTransformToNode(). You can simply write: node1.setWorldTransform(node2.worldTransform()).

See also the origin(), worldTransform(), and setWorldTransform() methods.

isDisplayFlagSet(self)bool

Not documented yet

isObjectDisplayed(self) → bool

Not documented yet

isSelectableInViewport(self) → bool

Not documented yet

isShowingOrigin(self) → bool

Not documented yet

isUsingXray(self) → bool

Not documented yet

moveParmRotateIntoPreTransform(self)

Not documented yet

moveParmScaleIntoPreTransform(self)

Not documented yet

moveParmTransformIntoPreTransform(self)

Not documented yet

moveParmTranslateIntoPreTransform(self)

Not documented yet

movePreTransformIntoParmTransform(self)

Not documented yet

origin(self)hou.Vector3

Returns the object’s origin position, in world space.

obj.origin() is equivalent to obj.Vector3(0, 0, 0) * obj.worldTransform().

# To compute the world space vector from obj1's origin to obj2's origin, you
# can write:
obj2.origin() - obj1.origin()

# To compute the distance, in world space, between the origins of two objects,
# simply take the length of this vector:
(obj2.origin() - obj1.origin()).length()

# If there are no rotations or scales, the vtorigin() hscript expression
# function will return the same result as obj2.origin() - obj1.origin().
# If there are rotations or scales, though, it won't.  A Python equivalent
# of vtorigin() is defined by:
def vtorigin(obj1, obj2):
    return (obj2.worldTransform() * obj1.worldTransform().inverted()).extractTranslates()

See also the worldTransform() and getTransformToNode() methods.

parmTransform(self)hou.Matrix4

Not documented yet

preTransform(self)hou.Matrix4

Not documented yet

renderNode(self)hou.Node or None

Not documented yet

setCookTransform(self, matrix)

Sets the parameter transform for the Python object that’s cooking. Call this method from objects implemented in Python to set the result of the cook.

Note that an object implemented in Python controls the parameter transform (i.e. the result of hou.ObjNode.parmTransform). The world transform (i.e. the result of hou.ObjNode.worldTransform) is still affected by parent node’s transforms, pretransforms, etc.

This method raises hou.OperationFailed if you call it on an object that is not implemented in Python or if you call it from outside that object’s Python cook code.

See the Transforms from Disk example.

setDisplayFlag(self, on)

Not documented yet

setInputAndNeverKeepPosition(self, input_index, node_to_become_input, output_index=0)

Not implemented yet

setIsSelectableInViewport(self, on)

Not implemented yet

setParmTransform(self, matrix, fail_on_locked_parms=False)

Sets the transform controlled by this object’s parameters.

If fail_on_locked_parms is True, and any of the translate, rotate, or scale parameters of the object are locked, this method will raise hou.OperationFailed. If it is False and any of those parameters are locked, this method will change their values but leave them locked.

See also the parmTransform() and setWorldTransform() methods.

setPreTransform(self, matrix)

Not documented yet

setSelectableInViewport(self, on)

Not documented yet

setWorldTransform(self, matrix, fail_on_locked_parms=False)

Adjusts this object’s parameters to achieve the desired world tranformation.

This method will adjust the translate, rotate, and scale values of this object to achieve the desired final world transformation. It accounts for the transformations of containing networks, parent transforms, and pre-transforms.

If fail_on_locked_parms is True, and any of the translate, rotate, or scale parameters of the object are locked, this method will raise hou.OperationFailed. If it is False and any of those parameters are locked, this method will change their values but leave them locked.

node.setWorldTransform(matrix, fail_on_locked_parms) is equivalent to…

node.setParmTransform(matrix * node.worldTransform().inverted() * node.parmTransform(), fail_on_locked_parms)

See also the worldTransform(), setParmTransform(), preTransform(), and setPreTransform() methods.

showOrigin(self, on)

Not documented yet

useXray(self, on)

Not documented yet

worldTransform(self)hou.Matrix4

Returns a matrix that transforms this object’s geometry into world space.

The world transformation matrix contains the cumulative transformations of

  • The node’s pre-transform

  • The transformation defined by the node’s parameters

  • The transformations of parent nodes or containing networks

See also the parmTransform(), preTransform(), and setWorldTransform() methods.

Replaces

objcleantransform command , objextractpretransform command , objpretransform command , objresetpretransform command , opget command , opset command , opwire command , mlookat expression function , mobjlookat expression function , objpretransform expression function , opflag expression function , optransform expression function , origin expression function , originoffset expression function , vorigin expression function , vrorigin expression function , vtorigin expression function