Models: .fmdl
Skill ferret-models · download all skills · SKILL.md
When to use#
Making, checking, packing, finding, placing or running a model; giving an agent the models to build with (molecules, vehicles, scenery); turning glTF, library items, generated rocks, plants, people or cars into models.
What exists#
- Files. A model package (
ferret.jsonkindmodel,model.json,description.json,levels/N.glb,motions/*.fm). The whole spec isreference/SPEC.md: read sections 3 to 9 before writing one. - Command line (no release folder):
ferret fmdl check | resolve | info | describe | measure | pack | unpack | import.packmeasures the levels, computes mass and charge, and writesdescription.jsonanddescription.md. - Make from a glTF:
ferret fmdl import level.glb --id .. --summary .. --kind .. --mass .. --material <glTF name>=<physical> --out dir, thenferret fmdl pack dir id.fmdl. From code:modelFilesFromGlb(assets) and@ferret/fmdl-import:libraryModelFiles(library items, the Unreal export),rockModelFiles,plantModelFiles,figureModelFiles,carModelFiles. - Resolve:
resolveModel(source, loader)merges the chain of parents and the includes, checks the result, and gives the resolved model, its files and its hash. - Library: a
.fmdlgoes into the library on the server as it is, with an item of typefmdl(rubric and tags from its description):node tools/asset-lib/build.mjs --fmdl <folder> --out <dir>, thenpublish.mjs --from <dir>; a rubric rule per kind inrubrics.mjs.library.model()is for typemodel(glTF tiers), not for these. - Run:
ModelStage(actors, moving parts, clips),ModelPrograms(a model's motions by<model>/<name>),ModelDocks(dock, undock, joints, save),ModelCatalogue. An agent's commands:fmdl.models(find by words),fmdl.describe,fmdl.appear,fmdl.vanish,fmdl.actors,fmdl.docks,fmdl.dock,fmdl.undock,motion.run. - Edit:
FmdlSession(editor): open a folder,makeChild, set description, parent, includes, docks, parts, materials, moving parts, physics, motions; every change is checked and refused when it breaks the model; undo,pack. Commandsfmdl.edit.open | child | describe | parent | include | dock | part | material | physics | moving | motion | patch | check | resolve | undo | redo | pack | save | run | show; page?fmdl. - Atoms: a model with
physics.modules.atomis an atom ofphysics-atomicwhen it appears (bindAtomModels); docking bonds it (atomicDocks).
Steps#
- Give the model its description (summary, kind, what each dock and motion is for): an agent reads nothing else.
ferret fmdl check dir, thenferret fmdl pack dir id.fmdlandcheckthe file.- Test with in-memory packages (
modelSourceOfFiles,memoryLoader) and an agent that uses only commands.
What usually goes wrong#
- A mass or a physical material guessed: the importer refuses, give the numbers.
- A motion's forms missing from
requires.formsof the model, or from the runtime: the model is refused before it runs. - A world matrix read before the parent's is recomputed: call
computeWorldMatrix(true)on the node you read. - A part named in
model.jsonthat a lower level does not draw. - A model's fans must blow what is below them: declare
physics.propulsors(kind, position, axis, diameter); the effects areferret-physics-response.
Files#
reference/SPEC.md— fmdl/SPEC.mdreference/api-assets.md— every export of@ferret/assetswith signature and doc commentreference/api-assets-2.md— every export of@ferret/assetswith signature and doc commentreference/api-assets-3.md— every export of@ferret/assetswith signature and doc commentreference/api-levels.md— every export of@ferret/levelswith signature and doc commentreference/api-levels-2.md— every export of@ferret/levelswith signature and doc commentreference/api-levels-3.md— every export of@ferret/levelswith signature and doc commentreference/api-levels-4.md— every export of@ferret/levelswith signature and doc commentreference/api-levels-5.md— every export of@ferret/levelswith signature and doc commentreference/api-editor.md— every export of@ferret/editorwith signature and doc commentreference/api-fmdl-import.md— every export of@ferret/fmdl-importwith signature and doc commentreference/api-physics-atomic.md— every export of@ferret/physics-atomicwith signature and doc commentreference/commands.md— 181 commands of these packages with their arguments