Three Import Object
Pull pre-built rigs and objects out of a Script Module
- module
- object
Custom geometry and materials are one thing; a whole object - a rig, an assembly of parts, a group of meshes with shared logic - is another. Three Import Object is the adapter that pulls a single named Object3D out of a Three Script Module and puts it on a normal object wire, so a group or a scene can hold it without knowing it came from JavaScript. It's the highest-level of the three Import siblings, and it's where the module pattern really starts to shine.
The pattern is identical to its siblings: module takes a THREE_MODULE from a Three Script Module, and export_name names the key you want. The module's default body returns materials and a torus geometry, but the node's own default key is rig - a nod to the intended use, building an articulated assembly in code and importing it whole. The two rules that govern every Import node apply: the name must match a key the module returned, and the value behind it must actually be an Object3D. Miss either and the viewer names the problem rather than failing silently.
What makes this more than a convenience is that a module runs once per viewer load and can build named objects that carry their own logic. A module can construct a group, attach a custom per-frame behaviour, wire up children, and return the finished rig as one key - and this node hands that whole assembly to the rest of your graph as a single THREE_OBJECT. From there it's normal wiring: into Three Group or straight onto Three Scene's root, animatable and groupable like anything else. Downstream, nothing can tell it came from code, which is exactly the point.
Use it when a scene has a chunk of repeated structure - a fixture, a stand, a vehicle, a pattern of meshes that appears in several spots. Build it once in the module, import it twice, and both copies stay in sync when you edit the original. For a single custom object with no sharing, Three Custom Object is the simpler door; reach for the module-plus-import route when the same built object appears across the scene or you want the graph to stay readable.
And the standing warning, at one remove: the object's code runs in your browser with the reach of any frontend extension, so only import from modules whose code you trust. The Import node doesn't sanitise anything - it just fetches a named object from code that already ran.
Installing it
Part of WAS Node Suite v3. Install via ComfyUI Manager (search WAS Node Suite v3) or:
cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui.git
Restart; needs ComfyUI 0.14.0+ / Python 3.10+. If the Three menu's missing, set features.threejs: true in <ComfyUI user dir>/was-node-suite/config.yaml.
If it reports an error
Same story as the other Imports: a key that isn't in the module, or a key whose value isn't an Object3D, gets named in the viewer. If every Import from one module comes up empty at once, the module's JavaScript failed to load - check the browser console, not the ComfyUI log.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| module | THREE_MODULE | The named resources to pick from, from Three Script Module. | |
| export_name | STRING | rig | Which key to take, as `rig`. It must match a key the module returned. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| object | THREE_OBJECT | The named object, for Three Group or the root socket on Three Scene. |