Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

2.0 KB
Raw Blame
// `blender_scene_info`: read a 3D file through Blender and describe it.
//
// Wraps the runner's scene_info op: open a .blend or import any supported
// format into an empty scene, then report evaluated geometry (modifiers
// applied), materials, armatures, animation actions, and world-space bounds.

import { z } from 'zod';

import { runJob } from '../lib/blender.js';
import { resolveInput } from '../lib/paths.js';

export const def = {
	name: 'blender_scene_info',
	title: 'Describe a 3D file with Blender',
	annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
	description:
		'Open a 3D file with Blender and report what is inside it: object list with types, parents, dimensions and ' +
		'modifiers; evaluated triangle and vertex counts; materials; armature bone names; animation actions with ' +
		'their frame ranges; a texture inventory with each image\'s resolution and byte size plus the total, which is ' +
		'usually what decides whether an asset is deliverable; and world-space bounds. Accepts .blend plus every ' +
		'format this Blender can import (.glb, .gltf, .fbx, .obj, .stl, .ply, .dae, .abc, .usd*, .x3d). Counts describe ' +
		'the file AS LOADED, so a GLB reports more vertices than the .blend it came from (glTF splits vertices at UV ' +
		'and normal seams) while the triangle count is identical. Read-only: the file is never modified. Use this ' +
		'before blender_optimize or blender_convert to see what a file contains and what is making it heavy.',
	inputSchema: {
		input: z.string().min(1).describe('Path to the 3D file to inspect. Absolute, or relative to the server working directory.'),
		include_objects: z
			.boolean()
			.optional()
			.describe('Include the per-object breakdown. Set false on very large scenes to get totals only. Default true.'),
	},
	async handler(args) {
		const input = await resolveInput(args?.input);
		const payload = await runJob({
			op: 'scene_info',
			input,
			include_objects: args?.include_objects !== false,
		});
		return { ...payload, ok: true };
	},
};