Resources
Create and modify Godot resources — the building blocks that nodes reference.
Resources in Godot are data objects separate from the scene tree: PhysicsMaterial, StandardMaterial3D, BoxShape3D, CapsuleShape3D, AudioStream, and hundreds more. Nodes hold references to resources; Director can create and configure those resources.
Operations
resource_read
Read properties from an existing saved resource.
{
"op": "resource_read",
"project_path": "/home/user/my-game",
"path": "assets/materials/enemy_red.tres",
"properties": ["albedo_color", "roughness", "metallic"]
}| Parameter | Type | Required | Description |
|---|---|---|---|
depth | number | optional default: 1 | Depth for nested resource serialization. At depth 0, nested resources are returned as path strings. At depth 1 (default), top-level properties are serialized but nested resources within them are paths. Higher depths recurse. |
project_path | string | required | Absolute path to the Godot project directory. |
resource_path | string | required | Resource file to read (relative to project, e.g. "materials/ground.tres"). |
Response:
{
"op": "resource_read",
"path": "assets/materials/enemy_red.tres",
"properties": {
"albedo_color": [1.0, 0.0, 0.0, 1.0],
"roughness": 0.7,
"metallic": 0.0
}
}material_create
Create a new material resource and save it to disk.
{
"op": "material_create",
"project_path": "/home/user/my-game",
"material_type": "StandardMaterial3D",
"properties": {
"albedo_color": [0.8, 0.2, 0.2, 1.0],
"roughness": 0.7,
"metallic": 0.0
},
"save_path": "assets/materials/enemy_red.tres"
}| Parameter | Type | Required | Description |
|---|---|---|---|
material_type | string | required | Material class name. Common types: StandardMaterial3D, ORMMaterial3D, ShaderMaterial, CanvasItemMaterial, ParticleProcessMaterial. Any ClassDB Material subclass is accepted. |
project_path | string | required | Absolute path to the Godot project directory. |
properties | object | optional default: null | Optional properties to set on the material after creation. Type conversion is automatic (Color from "#ff0000" or {"r":1,"g":0,"b":0}). |
resource_path | string | required | Save path for the material relative to project (e.g. "materials/ground.tres"). |
shader_path | string | optional default: null | For ShaderMaterial: path to a .gdshader file (relative to project). Loaded and assigned as the shader property. |
Response:
{
"op": "material_create",
"save_path": "assets/materials/enemy_red.tres",
"result": "ok"
}shape_create
Create a collision shape resource.
{
"op": "shape_create",
"project_path": "/home/user/my-game",
"shape_type": "BoxShape3D",
"properties": {
"size": [2.0, 1.0, 2.0]
},
"save_path": "assets/shapes/platform_box.tres"
}| Parameter | Type | Required | Description |
|---|---|---|---|
node_path | string | optional default: null | Path to the CollisionShape node within the scene tree. Required when scene_path is set. |
project_path | string | required | Absolute path to the Godot project directory. |
save_path | string | optional default: null | Save the shape as a .tres file at this path (relative to project). |
scene_path | string | optional default: null | Attach the shape to a CollisionShape2D/3D node in a scene. Requires scene_path and node_path to also be set. The shape is assigned to the node's "shape" property. |
shape_params | object | optional default: null | Shape configuration. Keys are property names on the shape resource (e.g. "radius", "size", "height"). Type conversion is automatic. |
shape_type | string | required | Shape class name. 3D: BoxShape3D, SphereShape3D, CapsuleShape3D, CylinderShape3D, ConcavePolygonShape3D, ConvexPolygonShape3D, WorldBoundaryShape3D, SeparationRayShape3D, HeightMapShape3D. 2D: CircleShape2D, RectangleShape2D, CapsuleShape2D, SegmentShape2D, ConvexPolygonShape2D, ConcavePolygonShape2D, WorldBoundaryShape2D, SeparationRayShape2D. |
style_box_create
Create a StyleBox resource (used by UI controls).
{
"op": "style_box_create",
"project_path": "/home/user/my-game",
"style_type": "StyleBoxFlat",
"properties": {
"bg_color": [0.1, 0.1, 0.2, 1.0],
"border_width_top": 2,
"border_color": [0.5, 0.5, 1.0, 1.0]
},
"save_path": "assets/ui/panel_style.tres"
}| Parameter | Type | Required | Description |
|---|---|---|---|
project_path | string | required | Absolute path to the Godot project directory. |
properties | object | optional default: null | Optional properties to set on the StyleBox after creation. |
resource_path | string | required | Save path for the StyleBox relative to project (e.g. "ui/panel.tres"). |
style_type | string | required | StyleBox class name: StyleBoxFlat, StyleBoxTexture, StyleBoxLine, or StyleBoxEmpty. |
resource_duplicate
Duplicate an existing resource file.
{
"op": "resource_duplicate",
"project_path": "/home/user/my-game",
"source_path": "assets/materials/enemy_red.tres",
"dest_path": "assets/materials/enemy_blue.tres"
}| Parameter | Type | Required | Description |
|---|---|---|---|
deep_copy | boolean | optional default: null | Deep copy sub-resources (making them independent). Default: false (shallow copy — sub-resources are shared references). |
dest_path | string | required | Path where the duplicate will be saved (relative to project). |
project_path | string | required | Absolute path to the Godot project directory. |
property_overrides | object | optional default: null | Property overrides to apply after duplication. Keys are property names. |
source_path | string | required | Path to the source resource file (relative to project). |
Response:
{
"op": "resource_duplicate",
"source_path": "assets/materials/enemy_red.tres",
"dest_path": "assets/materials/enemy_blue.tres",
"result": "ok"
}Common resource types
Shape resources
Used by CollisionShape3D and CollisionPolygon3D:
{ "type": "BoxShape3D", "properties": { "size": [2.0, 1.0, 2.0] } }
{ "type": "SphereShape3D", "properties": { "radius": 0.5 } }
{ "type": "CapsuleShape3D", "properties": { "radius": 0.4, "height": 1.8 } }
{ "type": "CylinderShape3D", "properties": { "radius": 0.5, "height": 2.0 } }Physics materials
Used by PhysicsBody3D for surface friction/bounce:
{
"type": "PhysicsMaterial",
"properties": {
"friction": 0.8,
"rough": true,
"bounce": 0.1,
"absorbent": false
}
}Standard materials
Used by MeshInstance3D.material_override or surface materials:
{
"type": "StandardMaterial3D",
"properties": {
"albedo_color": [0.2, 0.4, 0.8, 1.0],
"roughness": 0.5,
"metallic": 0.3,
"normal_enabled": true
}
}Example conversation
Tips
Save resources when they will be reused. A saved .tres file can be referenced by multiple scenes — better for shared materials, shapes, etc.
Read before modifying. Use resource_read to check current property values before creating or duplicating resources.
Use resource_duplicate to create variants. Duplicate an existing material, then use node_set_properties to update specific properties — faster than creating from scratch.