Nodes/ComfyUI libigl/Load Mesh Batch (Glob)
ComfyUI Node

Load Mesh Batch (Glob)

Load a batch of meshes with one wildcard string

By PozzettiAndrea·Created 10 months ago·Updated 4 days ago· 218
Load Mesh Batch (Glob)
    • meshes
    • textures
    • file_paths
    glob_pattern
    sort_byname

    Load Mesh Batch (Glob) is the batch loader for people who don't want to reorganize their hard drive to suit their node graph. Instead of "point me at a folder and load everything in it," you give it a glob pattern like /path/to/export/*.glb and it loads whatever matches - even across subfolders, with **. If you have models scattered across a project tree and you don't want to copy them all into ComfyUI/input/3d, this is the node.

    It's part of ComfyUI-GeometryPack ("ComfyUI libigl"), Andrea Pozzetti's 3D geometry toolkit for ComfyUI. Like every loader in the pack it produces the shared TRIMESH type, so the output plugs straight into any of the pack's processing, analysis, or preview nodes.

    How it works

    One input does the real work: glob_pattern, which uses Python's glob with recursive=True. That means *.glb grabs a directory's worth, and **/*.obj walks the whole tree. The ** is the superpower here - folder-based loaders can't reach into subdirectories, this one can. Whatever matches gets loaded through the pack's mesh_io (.obj, .ply, .stl, .off, .gltf, .glb, .fbx, .dae, .3ds, .vtp), sorted, and returned as a list.

    The secondary input, sort_by, is a combo with name (alphabetical) or modified_time as options - pick the latter when you want "most recently exported first" so the newest scan is at the front of your batch. The node also fingerprints matched files by their modification times, so editing a file on disk triggers a re-run instead of silently reusing cached output.

    Inputs and outputs

    • glob_pattern - the pattern; the author's own tooltip example is /path/to/folder/*.glb.
    • sort_by - name or modified_time, defaults to name.

    Outputs, all lists of the same length:

    • meshes - the loaded TRIMESH objects.
    • textures - IMAGE per mesh, extracted from the material (base color for GLB/GLTF, MTL images for OBJ). No texture → a small black placeholder, so the lists stay aligned.
    • file_paths - the full path strings. This is the sneaky-useful one: wire it into the pack's filename/save nodes and you can write results back next to their sources.

    A pattern that matches nothing returns empty lists with a console warning rather than crashing - convenient when a folder legitimately has zero files yet, annoying when you wanted to know you typo'd the path.

    Installing

    Standard for the pack: search "GeometryPack" in ComfyUI Manager, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/PozzettiAndrea/ComfyUI-GeometryPack.git
    cd ComfyUI-GeometryPack
    pip install -r requirements.txt --upgrade
    python install.py
    

    Restart after. Heads-up: the pack installs via the experimental comfy-env package and drags in pixi plus a heavy isolated environment (Blender, CGAL, libigl, VTK) on first launch, so the initial startup is slow. The author openly calls the pack WIP with fast development, and the README asks for bug reports via GitHub Discussions - if a batch loader does something weird, that's the place to report it.

    The usual traps

    • Pattern that silently matches nothing - you get empty lists, no error. Check the pattern against ls first.
    • Mixing file types in one pattern - *.glb and *.obj in the same folder means a mixed batch; fine for analysis, messy if downstream nodes assume consistent topology.
    • Absolute vs relative patterns - absolute paths are the reliable default. Relative patterns resolve against the ComfyUI process's working directory, which is easier to get wrong than you'd think.

    If you just want "everything in this one folder, alphabetically," the plain Load Mesh Batch node is simpler. This one earns its keep the moment your meshes live in nested project folders.

    Categorygeompack/io

    Inputs (2)

    NameTypeDefaultDescription
    glob_patternSTRINGGlob pattern to match mesh files (e.g., /path/to/folder/*.glb)
    sort_byoptCOMBOnameHow to sort matched files

    Outputs (3)

    NameTypeDescription
    meshesTRIMESH
    texturesIMAGE
    file_pathsSTRING