You can cook a cable output using hou.CopNode.cable, or you can evaluate a cable data parameter using hou.Parm.evalAsCopCable. A CopCable returned by either of these functions is not tied to the node or parameter it was cooked from. All CopCable objects are writable; there’s no notion of a frozen CopCable. However, all the objects in a CopCable are frozen, so the only way to modify them in a CopCable is by replacing them.
Methods ¶
wireCount()
→ int
Returns the count of objects (“wires”).
appearanceToIndex(name, appearance=0)
→ int
Returns the flat index in this cable at which the wire name name appears for the appearance-th time.
indexToAppearance(idx)
→ int
Returns the count of times the wire name at index idx appears as a wire name before index idx. In other words, converts a flat index to an “appearance index”.
wireName(idx)
→ str
Returns the name of the wire at index idx.
wireDataTypeByIndex(idx)
→ str
Returns a string representation of the COP object at flat index idx.
wireDataType(name, idx)
→ str
Returns a string representation of the COP object at the idx-th appearance of the wire name name.
wireNames()
→ tuple[str]
Returns a tuple of all the wire names contained in the cable. Duplicates can occur as a cable can have wires with the same name.
layerByIndex(idx)
→ hou.ImageLayer
Gets the object at flat index idx. If it’s a layer, returns it. Otherwise, returns None.
layer(name, appearance=0)
→ hou.ImageLayer
Gets the object at the appearance-th appearance of the wire name name. If it’s a layer, returns it. Otherwise, returns None.
geometryByIndex(idx)
→ hou.Geometry
Gets the object at flat index idx. If it’s a geometry, returns it. Otherwise, returns None.
geometry(name, appearance=0)
→ hou.Geometry
Gets the object at the appearance-th appearance of the wire name name. If it’s a geometry, returns it. Otherwise, returns None.
vdbByIndex(idx)
→ hou.NanoVDB
Gets the object at flat index idx. If it’s a NanoVDB, returns it. Otherwise, returns None.
vdb(name, appearance=0)
→ hou.NanoVDB
Gets the object at the appearance-th appearance of the wire name name. If it’s a NanoVDB, returns it. Otherwise, returns None.
attribByIndex(idx)
→ hou.DetachedAttrib
Gets the object at flat index idx. If it’s a detached attribute, returns it. Otherwise, returns None.
attrib(name, appearance=0)
→ hou.DetachedAttrib
Gets the object at the appearance-th appearance of the wire name name. If it’s a detached attribute, returns it. Otherwise, returns None.
addLayer(name, layer)
Adds ImageLayer layer to the end of the CopCable, with wire name name.
addGeometry(name, geometry)
Adds Geometry geometry to the end of the CopCable, with wire name name.
addVDB(name, vdb)
Adds NanoVDB vdb to the end of the CopCable, with wire name name.
addAttrib(name, HOM_DetachedAttrib)
Adds DetachedAttrib vdb to the end of the CopCable, with wire name name.
removeByIndex(idx)
Removes the wire at flat index idx from the list. The wires after the removed one are shifted over to take its place.
remove(name, appearance=0)
Removes the wire at the appearance-th appearance of wire name name from the list. The wires after the removed one are shifted over to take its place.
setWireName(idx, name)
Sets the name of the wire at flat index idx to name.
setDataByIndex(idx, layer)
Sets the idx-th wire to hold ImageLayer layer.
setData(name, HOM_ImageLayer)
Sets the initial appearance of wire name name to store ImageLayer layer.
setData(name, appearance, HOM_ImageLayer)
Sets the appearance-th appearance of wire name name to store ImageLayer layer.
setDataByIndex(idx, geometry)
Sets the idx-th wire to hold Geometry geometry.
setData(name, geometry)
Sets the initial appearance of wire name name to store Geometry geometry.
setData(name, appearance)
Sets the appearance-th appearance of wire name name to store Geometry geometry.
setDataByIndex(idx, vdb)
Sets the idx-th wire to hold NanoVDB vdb.
setData(name, vdb)
Sets the initial appearance of wire name name to store NanoVDB vdb.
setData(name, appearance, vdb)
Sets the appearance-th appearance of wire name name to store NanoVDB vdb.
setDataByIndex(idx, attrib)
Sets the idx-th wire to hold DetachedAttrib attrib.
setData(name, attrib)
Sets the initial appearance of wire name name to store DetachedAttrib attrib.
setData(name, appearance, HOM_DetachedAttrib)
Sets the appearance-th appearance of wire name name to store DetachedAttrib attrib.