Skip to content

Addon commands

The addon registers commands via @command(name, gate=...) on per-domain mixins. The composed BlenderCommandExecutor exposes the union. executor is in scope inside every job_dispatch script, so anything below is callable as executor.<name>(...).

23 commands across 8 domains. Commands with a Gate column entry are only dispatchable when the matching AddonPreferences flag is true.

CommandParametersReturnsGate
get_scene_info{name, object_count, objects[<=10], materials_count}
get_object_infoname: strfull object descriptor with mesh stats and material slots
browse_datacollection, item_name, page=1, page_size=50, detail_level="summary"paginated bpy.data.<collection> listing or single-item detail

get_object_info raises ValueError if the object name doesn’t exist. browse_data with no collection returns the list of available collections.

viewport (addon/executor/handlers/viewport.py)

Section titled “viewport (addon/executor/handlers/viewport.py)”
CommandParametersReturnsGate
get_viewport_screenshotmax_size=800, filepath, format="png"{success, width, height, filepath}

filepath is required despite the default-looking signature — the handler returns {"error":"No filepath provided"} if it’s empty.

code_exec (addon/executor/handlers/code_exec.py)

Section titled “code_exec (addon/executor/handlers/code_exec.py)”
CommandParametersReturnsGate
execute_codecode: str{executed: true, result: <stdout>}

console (addon/executor/handlers/console.py)

Section titled “console (addon/executor/handlers/console.py)”
CommandParametersReturnsGate
console_operationsoperation="get_info", params=Nonevaries by operation
get_console_outputlevel="all", page=1, page_size=50paginated console scrollback with classified line types

console_operations supports: create, execute, autocomplete, clear, clear_line, copy, copy_as_script, paste, history_cycle, history_append, insert, indent, unindent, select_all, select_word, scrollback_append, get_info.

get_console_output levels: all, info, warning, error, output, input.

msgbus (addon/executor/handlers/msgbus.py)

Section titled “msgbus (addon/executor/handlers/msgbus.py)”

Blender’s bpy.msgbus RNA property change system, exposed as five commands.

CommandParametersReturnsGate
msgbus_clear_by_ownerowner_id="default"{success, message}
msgbus_publish_rnadata_path=None, key=None{success, message}
msgbus_subscribe_rnaowner_id="default", data_path, notify_type="UPDATE", persistent=True{success, subscription_id, key}
msgbus_get_notificationsowner_id=None, clear=False{success, notifications, count}
msgbus_list_subscriptionsowner_id=None{success, subscriptions, count, owners}

Supported data_path values for subscribe/publish: frame_current, active_object, selected_objects, active_material, plus scene.<prop> and object.<prop> patterns.

polyhaven (addon/executor/handlers/polyhaven.py)

Section titled “polyhaven (addon/executor/handlers/polyhaven.py)”

Poly Haven assets — HDRIs, textures, models.

CommandParametersReturnsGate
get_polyhaven_status{enabled, message}
get_polyhaven_categoriesasset_type (hdris/textures/models/all){categories: {...}}use_polyhaven
search_polyhaven_assetsasset_type=None, categories=Nonefirst 20 assets + total countuse_polyhaven
download_polyhaven_assetasset_id, asset_type, resolution="1k", file_format=None{success, message, ...}use_polyhaven
set_textureobject_name, texture_idfull material info including AO/ARM mixing diagnosticsuse_polyhaven

download_polyhaven_asset defaults: HDRI → hdr, texture → jpg, model → gltf. Textures construct a Principled BSDF node graph with normal, displacement, AO/ARM packing. Models stream a temp dir and import via bpy.ops.import_scene.*.

hyper3d (addon/executor/handlers/hyper3d.py)

Section titled “hyper3d (addon/executor/handlers/hyper3d.py)”

Text/image-to-3D model generation via Hyper3D Rodin. Two backends: MAIN_SITE (hyperhuman.deemos.com) and FAL_AI (fal.ai). Selected by AddonPreferences.hyper3d_mode.

CommandParametersReturnsGate
get_hyper3d_status{enabled, message}
create_rodin_jobtext_prompt, images, bbox_conditionbackend-specific job descriptoruse_hyper3d
poll_rodin_job_statussubscription_key (MAIN_SITE) or request_id (FAL_AI){status_list} or backend-specificuse_hyper3d
import_generated_assettask_uuid or request_id, nameimported object descriptor with AABBuse_hyper3d

Each command dispatches internally to *_main_site or *_fal_ai based on prefs.hyper3d_mode. The free-trial API key works against MAIN_SITE by default.

sketchfab (addon/executor/handlers/sketchfab.py)

Section titled “sketchfab (addon/executor/handlers/sketchfab.py)”

Sketchfab model search + download.

CommandParametersReturnsGate
get_sketchfab_status{enabled, message} — pings /v3/me if a key is set
search_sketchfab_modelsquery, categories=None, count=20, downloadable=Trueraw Sketchfab v3 search responseuse_sketchfab
download_sketchfab_modeluid{success, imported_objects}use_sketchfab

download_sketchfab_model extracts the GLTF zip with zip-slip protection (rejects paths containing .. or anything that escapes the temp dir) before calling bpy.ops.import_scene.gltf.

All 23 commands run in Blender’s main thread via the drainer (addon/client/drainer.py). A dispatched job_dispatch script gets executor in its globals; calling any command above is direct:

# inside a dispatched script
info = executor.get_scene_info()
print(info)

The drainer captures stdout, then calls blender_job_update with the captured text as result. So print(info) is the canonical way to surface a return value back to the originator.