Search by

adachsoft / blender-tool

Arkadiusz Adach

Blender tools for building, inspecting, rendering, and exporting 3D scenes through the Blender Agent API.

Package info

gitlab.com/a.adach/blender-tool

Issues

pkg:composer/adachsoft/blender-tool

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

v0.1.0 2026-11-24 21:24 UTC

This package is auto-updated.

Last update: 2026-11-24 20:24:53 UTC


README

adachsoft/blender-tool provides SPI-compatible tools for building and inspecting 3D scenes through the remote Blender Agent API. It supports workspace creation, file uploads, Blender Python scene updates, scene inspection, rendering, and GLB export. Blender runs in the remote service; this library does not launch Blender, execute shell commands, or require a shared filesystem.

Requirements

  • PHP 8.3 or later.
  • Composer.

Installation

Install the library with Composer:

composer require adachsoft/blender-tool

Usage

Create a ConfigMap from your application settings, then pass it to one of the tool factories. See the configuration and available tools below.

Configuration

Each tool factory reads its configuration from the ConfigMap passed to create():

KeyTypeRequiredDefaultDescription
base_urlstringYes—Root URL of the Blender service. Must use HTTP or HTTPS.
api_tokenstringYes—Non-empty bearer token sent in the Authorization header.
timeout_secondsintegerNo300Positive maximum duration for each HTTP request.
base_pathstringYes—Agent project root reserved for project-file operations.

Provide the token through your application's secret configuration mechanism:

use AdachSoft\AiToolCall\SPI\Collection\ConfigMap;

$config = new ConfigMap([
    'base_url' => 'https://blender.example.com',
    'api_token' => $secretToken,
    'timeout_seconds' => 300,
    'base_path' => '/workspace/project',
]);

The service is accessed only over HTTP; files are transferred through HTTP endpoints rather than a shared mount.

Available tools

  • blender_workspace_create creates a workspace and returns its workspace_id.
  • blender_file_upload uploads a reference image or other project file to a workspace. Blender scripts can open uploaded files by name from their working directory.
  • blender_scene_apply runs Blender Python (bpy) against the workspace's saved scene and returns execution status and output details. The service saves the scene only when the script succeeds.
  • blender_scene_info returns the saved scene's objects, polygon count, and bounds.
  • blender_render renders workspace views and returns images for visual inspection.
  • blender_export exports the workspace as a GLB file to a project-relative path. Existing files are preserved unless overwrite is set to true.

Each tool has a factory that validates its configuration and creates a Guzzle-backed API client. Project-file tools restrict paths to the configured base_path.