API ReferenceGE Extensionsflowgraphnodesscene
Set Object Field (Flowgraph Node)
- **Node Name:** `Set Object Field`
Overview
- Node Name:
Set Object Field - Category:
repeat_instant - File:
extensions/flowgraph/nodes/scene/setObjectField.lua
Sets a field on any scene object by ID. Supports both static fields and dynamic data fields.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
objectId | number | ID of the object to modify |
fieldName | string | Name of the field to set |
fieldArrayNum | number | (Hidden) Array index for the field (default 0) |
value | any | Value to set. Tables/vectors are auto-converted to space-separated strings |
Output Pins
| Pin | Type | Description |
|---|---|---|
objectFound | bool | (Hidden) True when the object was found |
Behavior
work()- Each frame:- Finds the object via
scenetree.findObjectById(objectId). - If the value is a table, joins it with spaces (e.g.,
{1, 0, 0}→"1 0 0"). - Checks if the field exists in
obj:getFields()- if so, usessetField(). - Otherwise falls back to
setDynDataFieldbyName()for dynamic fields. - Calls
updateInstanceRenderData()if available to refresh visuals.
- Finds the object via
How It Works
- Looks up the target object in the scene tree.
- Automatically handles type conversion for vectors, quaternions, and colors passed as tables.
- Distinguishes between built-in fields and dynamic data fields to use the correct setter.
- Triggers a render data update so visual changes (like instance colors) take effect immediately.
Example Usage
-- Change the instance color of a TSStatic:
-- objectId = <some_id>
-- fieldName = "instanceColor"
-- value = {1, 0, 0, 1} -- redKey Dependencies
scenetree.findObjectById()- scene object lookupobj:setField()/obj:setDynDataFieldbyName()- field settersobj:updateInstanceRenderData()- visual refresh
See Also
- Collection Marker (Flowgraph Node) - Related reference
- Custom Lua Command (Flowgraph Node) - Related reference
- Get Object Field (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide