dopfield expression function

Returns the value of a field as a float.

Replaced by: hou.DopField, hou.DopData, hou.DopDataRecord

All Usage Examples

See also: dopfields

Usage

dopfield(dop, objectSpec, subDataName, recordType, recordNum, fieldName)

This function always returns a float value. To get a string value (which you can possibly then convert to a different type, using for example vector), see dopfields.

If a field is multivalued, you can access individual parameters by adding a suffix.

For example, "ty" will access the y component of the "t" field. If the field is a quaternion, you can use "rx", "ry", and "rz" as extensions to get the euler rotations for the quaternion. In the special case of a quaternion named "orient", simply using the name "rx" will return the equivalent of "orientrx".

When accessing subdata, the name of the data field is based on the name of the node that creates it. The complete path to the subdata must be provided. See the example below.

Examples

dopfield("/obj/dopnet1", "obj0", "Position", "Options", 0, "ty")

Returns the y position of object obj0

dopfield("/obj/dopnet1", "obj0", "Position", "Options", 0, "ry")

Returns the ry component of the orientation of object obj0. This will be in degrees.

dopfield("/obj/geo1/dopnet1", "Relationships/Spring_spring_constraint1", "", "Basic", 0, "memusage")

Returns the memory usage of a dynamics relationship

dopfield("/obj/dopnet1", "obj0", "Forces/Gravity_gravity1", "Options", 0, "forcey")

Returns the y component of the gravity force created by the Gravity Force node named gravity1. Note that the full path must be given, including the relevant node name, and that this path corresponds to the folder names in the tree view of the DOP network.