x3d_animate
Animate any X3D node field by generating a complete animation chain (TimeSensor, interpolator, ROUTEs) and inserting it into the scene.
Instructions
Generate a complete X3D animation chain and insert it into a scene.
Creates a TimeSensor, the appropriate Interpolator (auto-selected based
on the target field's type), and ROUTE statements to wire them together.
Inserts all nodes into the scene and returns the modified X3D document.
Args:
x3d_source: Complete X3D XML document string or file path.
target_def: DEF name of the node to animate (e.g., "MyTransform").
field_name: Field to animate. Examples:
- "rotation" → OrientationInterpolator
- "translation" → PositionInterpolator
- "diffuseColor" → ColorInterpolator
- "transparency" → ScalarInterpolator
from_value: Starting value as a space-separated string (e.g., "0 1 0 0").
to_value: Ending value as a space-separated string (e.g., "0 1 0 6.283").
duration: Animation cycle duration in seconds. Default 5.0.
loop: Whether the animation loops continuously. Default True.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"x3d_source": "<x3d_source>",
"target_def": "<target_def>",
"field_name": "<field_name>",
"from_value": "<from_value>",
"to_value": "<to_value>"
},
"name": "x3d_animate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| loop | No | ||
| duration | No | ||
| to_value | Yes | ||
| field_name | Yes | ||
| from_value | Yes | ||
| target_def | Yes | ||
| x3d_source | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |