x3d_extract_node
Extract a specific node from an X3D scene as XML by its DEF name or node type with index. Returns the full XML subtree for the matched node, enabling focused inspection and reuse.
Instructions
Extract a specific node (and its children) from an X3D scene as XML.
Identify the target node by its DEF name, or by node type + index. Returns
the full XML subtree of the matched node. If both def_name and node_type
are given, def_name takes precedence.
Args:
x3d_source: Either an absolute file path to a .x3d file, or a complete
X3D XML document string.
def_name: The DEF name of the node to extract (e.g., "RedSphere").
Use x3d_list_defs to see available names.
node_type: The X3D node type to extract (e.g., "Material", "Transform").
Combined with index to select which instance.
index: 0-based index when extracting by node_type. Default 0 (first match).
Use x3d_scene_stats to see how many of each type exist.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | No | ||
| def_name | No | ||
| node_type | No | ||
| x3d_source | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |