Nodes/ComfyUI-Panda3d/Panda3dTextureMerge
ComfyUI Node

Panda3dTextureMerge

How the carousel gets its blinking lights

By chaojie·Created 3 years ago·Updated 2 years ago· 17
Panda3dTextureMerge
  • texture1
  • texture2
  • textures

Panda3dTextureMerge is a two-into-one utility in the chaojie/ComfyUI-Panda3d pack: it takes two Panda3dTexture outputs and hands you a single textures output containing both. Alone it does nothing visible. Wired into Panda3dTest, it's the reason the demo's carousel lights actually blink.

How it works

The implementation is short and - refreshingly, given this pack's track record - actually correct. It checks whether each input is already a list; if not, it wraps it in one, then concatenates:

if type(texture1) is not list:
    texture1 = [texture1]
if type(texture2) is not list:
    texture2 = [texture2]
return (texture1 + texture2,)

That list-guard is the whole trick, and it's the exact thing its model counterpart (Panda3dModelMerge) skips. The result is a list of textures, which is precisely the shape Panda3dTest expects at its textures input.

Then the test node does the fun part. Its animation JSON supports a "texture" key that indexes into that list per frame. The demo workflow loads carousel_lights_on.jpg and carousel_lights_off.jpg with two Panda3dLoadTexture nodes, merges them here, and animates {"texture": [0, 1, 0, 1]} so the light rings flicker on and off as the carousel spins. That's a genuinely neat capability for a pack this small: swapping materials on a model mid-render, frame by frame, from inside the node graph.

The inputs

  • texture1 (Panda3dTexture) - from a Panda3dLoadTexture output.
  • texture2 (Panda3dTexture) - same.

Output is textures (Panda3dTexture), which feeds Panda3dTest's textures input.

Installing it

Standard for the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/chaojie/ComfyUI-Panda3d
cd ComfyUI-Panda3d
pip install -r requirements.txt

Or ComfyUI Manager, search ComfyUI-Panda3d, then restart. The two demo light textures ship in the repo's models/ folder - no downloads.

Notes and gotchas

  • It only matters if the renderer uses it. A merged texture list floating in the graph does nothing. The whole point is the texture key in Panda3dTest's animation JSON.
  • Order is preserved. texture1 stays index 0, texture2 stays index 1 - which is what makes the [0, 1, 0, 1] pattern work. Wire them in the order you want to reference them.
  • The index must exist. Ask the test node for texture[3] with only two merged textures and the animation just won't apply for that frame. No error, no highlight - silent no-op.

Of the two merge nodes in this pack, this is the one with an actual job, and it does it. Small, correct, and demonstrably useful.

CategoryPanda3d

Inputs (2)

NameTypeDefaultDescription
texture1Panda3dTexture
texture2Panda3dTexture

Outputs (1)

NameTypeDescription
texturesPanda3dTexture