Nodes/ComfyUI-MorphGS/MorphGS: Export Animated Mesh
ComfyUI Node

MorphGS: Export Animated Mesh

Stop Settling for a Render — Get an Actual Animated .glb

By Yuvaraj0739X·Created 3 days ago·Updated about 21 hours ago· 0
MorphGS: Export Animated Mesh
    • mesh_path
    • log
    scene_name
    character_name
    iterations5000
    output_formatglb
    force_reexportfalse

    Everything else in this pack produces a video. Which is fine until you want the thing in Blender, or Unity, or anywhere that isn't a ComfyUI preview window. This node takes a trained experiment and writes out a real animated mesh - .glb or .fbx - with the motion MorphGS learned baked onto your character's skeleton.

    It's also the node that dodges the standard complaint about AI 3D. Generated meshes are "extremely low-quality 3D assets" - garbage topology, no rig - which is why docs/knowledge/3d-generation.md says anything that must animate needs a retopo and re-rig pass. Here you bring your own mesh and rig; the model supplies motion, not geometry. No retopo tax.

    How it works

    First it replays the trained model. extract_pose_sequence.py loads the AnimationField/SimpleDeformNet checkpoint, runs it frame by frame in inference mode using MorphGS's own forward-kinematics code - the same calc_rec_abs_T_fast the training loop uses - and writes absolute per-joint world-space transforms to a .npz. Reusing the training code rather than re-deriving the FK is the right call; getting rotation composition subtly wrong is exactly how you get a character that looks almost right.

    The frame count matters here, and the node handles it for you. MorphGS normalises per-frame time as frame_index / NF, where NF is the length of the processed multi-view sequence - not your source video's frame count. SV4D's windowed synthesis can turn 70 input frames into 66 processed ones. So the node reads demo/processed_videos/<scene>/view_0/color/ to recover NF, and probes fps from rgb.mp4, falling back to 30.

    Then it bakes, in one of two ways:

    • Your original rigged file is on disk (the _source.fbx/.glb the character node stashed, or any .fbx/.glb/.gltf sitting in the character folder) and rigging/conversion_meta.json exists - then Blender keyframes the pose onto that file's own armature, applying the same scale correction used when the character was first converted. Your materials and textures ride along automatically.
    • Otherwise, it builds a fresh skinned armature from mesh.obj plus the RigNet rig file's own joint positions and per-vertex weights. Before that it runs resolve_skinning_weights.py, because some characters' configs apply heat-diffusion smoothing to the raw rig weights before training - use the unsmoothed weights and you get a mesh that looks fine at rest and tears itself apart under motion. It also picks up UVs plus a .mtl-referenced texture, or per-vertex colours if the OBJ carries them.

    The result is copied out under ComfyUI's output folder as output/morphgs/<experiment>_00001_.glb (numbered the way image saves are), and the node returns a {"ui": {"3d": [...]}} payload - the mechanism ComfyUI's own SaveGLB node uses. That's why the mesh pops up in the native interactive 3D viewer on the node itself the moment it finishes, with no Preview 3D node hanging off it.

    Inputs and outputs

    scene_name, character_name - same values as everywhere else. Wire them.

    iterations must match the training run exactly. It's how the node finds iteration_<n>.pth under output/<experiment>/model/morphgs/deform/. Trained at 5000, ask for 8000, and you get a hard error naming the missing checkpoint rather than a wrong export.

    output_format is glb or fbx. Take glb unless something downstream demands otherwise - one self-contained file with textures embedded. FBX embeds them too, but GLB opens anywhere without a plugin conversation.

    force_reexport re-runs the pose extraction and the Blender bake over an existing export.

    Back out comes mesh_path - a real filesystem path to the saved asset - and log, which says which bake path it took and why, if it fell back.

    Install

    Manager, search ComfyUI-MorphGS, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Yuvaraj0739X/ComfyUI-MorphGS
    

    Blender 4.2+ must be on PATH (or point MORPHGS_BLENDER_BIN at it) - both bake paths are headless Blender scripts, and it's the same install ComfyUI-SkinTokens' Blender server wants, so one covers both packs.

    Where people get burned

    Run the pipeline in order. This needs a completed Preprocess Character and Train & Render run for the same pair, with the same character and scene names you pass here. Skip a step and it names exactly which of the three required files is missing - the rig, the mesh, or the deform checkpoint.

    No conversion_meta.json means a fresh armature. If the original rigged file is there but the scale-correction metadata isn't, the node logs it and falls back - sometimes fine, sometimes subtly wrong and untextured. First thing to check if the export looks unlike what you imported.

    Some character configs are explicitly unsupported on the fallback path. If a character's config enables heat-based skinning-weight recalculation rather than smoothing, the exporter raises NotImplementedError on purpose rather than guess. Read the message - that's a deliberate refusal, not a crash.

    It's a baked clip, not a rigged animation. Per-frame absolute transforms written into the file: no IK, no constraints, no nudging a curve afterwards. Great for playback and import, less great if you expected an animator-friendly file, and expect a heavyweight keyframe count on long clips.

    CategoryMorphGS

    Inputs (5)

    NameTypeDefaultDescription
    scene_nameSTRING
    character_nameSTRING
    iterationsINT5000100–100000
    output_formatCOMBOglb2 options: glb, fbx
    force_reexportBOOLEANfalse

    Outputs (2)

    NameTypeDescription
    mesh_pathSTRING
    logSTRING