Mesh, Rigging & Animation
Blender, Maya, 3ds Max - polygon modeling, sculpting, skeletal rigging, and keyframe animation through the same verb grammar.
Modeling & Sculpting
NEW MESH PRIMITIVE "sphere" SIZE 1 SET ?head
AFTER MESH ?head SUBDIVIDE LEVEL 1 SMOOTH SET ?head
AFTER MESH ?head SCULPT BRUSH "inflate" AT 0,0.5,0 RADIUS 0.3 STRENGTH 0.6
AFTER MESH ?head SCULPT BRUSH "smooth" AT 0,0.3,0.2 RADIUS 0.2 STRENGTH 0.4
A brush lands on the surface: AT is moved to the point of the mesh nearest it, and the brush works everything within RADIUS of there, most at the centre and fading to nothing at the edge. Written without SET, a stroke still changes the mesh it was given, so strokes build up one after another.
| BRUSH | What it does |
|---|---|
"draw", "clay" | Raises the surface along its average direction |
"inflate" | Pushes every point out along its own normal - swells a shape |
"deflate" | The reverse of inflate |
"smooth" | Relaxes each point toward its neighbours |
"flatten" | Presses the area toward one plane |
"pinch" | Draws the area in toward the brush centre |
"crease" | Cuts a groove: pushes in and pinches |
STRENGTH runs from 0 to 1; how far a point moves is a quarter of RADIUS at full strength.
NEW MESH PRIMITIVE "cube" SIZE 2 SET ?mesh
AFTER MESH ?mesh EXTRUDE FACES [0 AND 1] DISTANCE 0.5 SET ?mesh
AFTER NEW MESH PRIMITIVE "sphere" SIZE 1 SET ?cutout
AFTER MESH ?mesh BOOLEAN SUBTRACT WITH ?cutout SET ?mesh
AFTER EMIT ?mesh("facets")
BOOLEAN UNION, BOOLEAN SUBTRACT and BOOLEAN INTERSECT combine two meshes. Both must be closed - a mesh with a hole has no inside to keep or remove, and is refused with that reason. The result is a new mesh with its own points, facets and volume.
Rigging & Animation
NEW MESH PRIMITIVE "sphere" SIZE 0.3 SET ?head
AFTER NEW MESH ARMATURE SET ?rig
AFTER MESH ?rig BONE "neck" FROM 0,0,-0.3 TO 0,0,0 PARENT "root" SET ?neckBone
AFTER MESH ?head SKIN TO ?rig WEIGHT PAINT AUTO SET ?head
AFTER NEW MESH ANIMATION ON ?rig SET ?anim
AFTER MESH ?anim KEYFRAME ?neckBone ROTATION 0,15,0 AT FRAME 0
AFTER MESH ?anim KEYFRAME ?neckBone ROTATION 0,-15,0 AT FRAME 24
AFTER MESH ?anim INTERPOLATE "bezier" BETWEEN FRAME 0 AND 24
SKIN TO binds a mesh to a rig; WEIGHT PAINT AUTO (the default) gives each part of the mesh to the bones nearest it. A mesh modelled with the verbs above is carried into the rig as it is.
Export
A mesh goes back out as a real interchange format, not as OcaltQL text - geometry is bulk binary, so MESH EXPORT mirrors the formats MESH IMPORT already accepts.
Formats: "obj", "stl", "ply", "off", "amf" and "3mf" are written directly; "fbx", "gltf" and "glb" go out through a converter from the same geometry. MESH IMPORT reads all of them and .dae.
NEW MESH PRIMITIVE "torus" SIZE 5 SET ?donut
AFTER MESH ?donut EXPORT AS "fbx" SET ?fbx
AFTER MESH IMPORT ?fbx SET ?mesh
AFTER MESH ?mesh SUBDIVIDE LEVEL 1 SMOOTH SET ?mesh
AFTER MESH ?mesh EXPORT AS "obj" SET ?path
AFTER MESH ?mesh EXPORT AS "fbx" SET ?path2
AFTER MESH ?mesh EXPORT AS "stl" SET ?path3
AFTER MESH ?mesh EXPORT AS "gltf" SET ?path4
AFTER EMIT ?path