Houdini 21.0 Nodes APEX nodes

dict::SetNested<T>

Sets a value into a nested dictionary.

On this page
Since 21.0

Traverses a dictionary of dictionaries using a sequence of keys and outputs an edited version of the dictionary with the entry at keys set to value.

For example, if we have the following dictionary of dictionaries:

"nested_dict": {
    "a_nested_value": 15
},
"another_nested_dict": ...

To change the value that’s currently “15”, set the keys array to ["nested_dict", "a_nested_value"].

The dict ports of this node are in-place ports, which means that the dictionary is updated without creating a copy.

Inputs

*dict: Dict Required

The dictionary where the new value is added.

keys: StringArray

The sequence of keys to traverse to get to the value you want to set. If a key is not found, a dictionary is created. This allows you to set a nested value without having to create the nested dictionary beforehand.

value: AnimChannel, AnimChannelCollection, AnimStack ApexGraphHandle, ApexNodeID, ApexPortID, Bool, ColorRamp, Dict, DynamicPath, FBIKSkeleton, FBIKSolver, FBIKTarget, Float, FloatRamp, Geometry, Int, Matrix3, Matrix4, SimRootDataId, String, Vector2, Vector3, Vector4

The value to set at the dictionary entry found by traversing the sequence of keys.

Outputs

*dict: Dict

The dict input edited with the entry at keys set to value.

See also

APEX nodes