topotopo 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +10 -10
- package/README.md +460 -117
- package/dist/cli.js +323 -146
- package/dist/config.d.ts +48 -0
- package/dist/config.js +170 -0
- package/dist/core/bake.d.ts +14 -3
- package/dist/core/bake.js +153 -4
- package/dist/core/bevel.d.ts +3 -1
- package/dist/core/bevel.js +76 -3
- package/dist/core/decimate.d.ts +65 -0
- package/dist/core/decimate.js +409 -3
- package/dist/core/erosion.d.ts +37 -0
- package/dist/core/erosion.js +41 -1
- package/dist/core/geometry.d.ts +5 -1
- package/dist/core/geometry.js +203 -3
- package/dist/core/heightfield.d.ts +27 -4
- package/dist/core/heightfield.js +54 -16
- package/dist/core/intrinsics.d.ts +7 -0
- package/dist/core/intrinsics.js +94 -0
- package/dist/core/manifold.d.ts +12 -1
- package/dist/core/manifold.js +78 -6
- package/dist/core/materials.d.ts +7 -0
- package/dist/core/materials.js +45 -0
- package/dist/core/noise.d.ts +9 -0
- package/dist/core/noise.js +10 -1
- package/dist/core/polymerge.d.ts +21 -0
- package/dist/core/polymerge.js +327 -0
- package/dist/core/repair.d.ts +2 -0
- package/dist/core/repair.js +2 -0
- package/dist/core/report.d.ts +70 -0
- package/dist/core/report.js +275 -0
- package/dist/core/scene.js +2 -1
- package/dist/core/sha256.d.ts +4 -0
- package/dist/core/sha256.js +69 -0
- package/dist/core/shapes.d.ts +3 -0
- package/dist/core/shapes.js +34 -0
- package/dist/core/snippet-lib.d.ts +14 -1
- package/dist/core/snippet-lib.js +39 -13
- package/dist/core/tangents.d.ts +2 -0
- package/dist/core/tangents.js +5 -1
- package/dist/core/texnoise.d.ts +6 -1
- package/dist/core/texnoise.js +6 -2
- package/dist/core/texsdf.d.ts +131 -0
- package/dist/core/texsdf.js +637 -0
- package/dist/core/texture.d.ts +163 -9
- package/dist/core/texture.js +844 -20
- package/dist/core/topology.d.ts +10 -0
- package/dist/core/topology.js +168 -0
- package/dist/core/unwrap.d.ts +72 -0
- package/dist/core/unwrap.js +800 -0
- package/dist/core/usercode.d.ts +27 -0
- package/dist/core/usercode.js +87 -0
- package/dist/core/uv.d.ts +4 -18
- package/dist/core/uv.js +35 -188
- package/dist/core/uvislands.d.ts +62 -0
- package/dist/core/uvislands.js +574 -0
- package/dist/core/uvoverlap.d.ts +58 -0
- package/dist/core/uvoverlap.js +220 -0
- package/dist/core/uvpack.d.ts +64 -0
- package/dist/core/uvpack.js +628 -0
- package/dist/core/uvreport.d.ts +61 -0
- package/dist/core/uvreport.js +207 -143
- package/dist/core/wrangle.d.ts +6 -1
- package/dist/core/wrangle.js +27 -16
- package/dist/core/xatlas.d.ts +16 -1
- package/dist/core/xatlas.js +66 -62
- package/dist/engines.d.ts +63 -0
- package/dist/engines.js +180 -0
- package/dist/explain.d.ts +4 -3
- package/dist/explain.js +129 -12
- package/dist/graph/engine.d.ts +92 -29
- package/dist/graph/engine.js +298 -148
- package/dist/graph/expr.d.ts +6 -3
- package/dist/graph/expr.js +18 -8
- package/dist/graph/outputs.d.ts +23 -0
- package/dist/graph/outputs.js +41 -0
- package/dist/graph/packages.d.ts +72 -0
- package/dist/graph/packages.js +261 -0
- package/dist/graph/parallel.d.ts +3 -1
- package/dist/graph/parallel.js +4 -1
- package/dist/graph/params.d.ts +6 -0
- package/dist/graph/params.js +34 -7
- package/dist/graph/scope.d.ts +55 -0
- package/dist/graph/scope.js +14 -0
- package/dist/graph/types.d.ts +75 -12
- package/dist/graph/types.js +4 -2
- package/dist/graph/vars.d.ts +16 -0
- package/dist/graph/vars.js +80 -0
- package/dist/host/artifacts.d.ts +10 -1
- package/dist/host/artifacts.js +37 -6
- package/dist/host/cook.d.ts +241 -0
- package/dist/host/cook.js +844 -0
- package/dist/host/export-targets.d.ts +42 -5
- package/dist/host/export-targets.js +72 -13
- package/dist/host/godot-commands.d.ts +4 -0
- package/dist/host/godot-commands.js +21 -0
- package/dist/host/godot.d.ts +183 -0
- package/dist/host/godot.js +916 -0
- package/dist/host/node.d.ts +12 -7
- package/dist/host/node.js +27 -9
- package/dist/host/pool.js +51 -2
- package/dist/host/sidecars.d.ts +8 -0
- package/dist/host/sidecars.js +50 -0
- package/dist/host/types.d.ts +19 -6
- package/dist/host/version.d.ts +1 -0
- package/dist/host/version.js +3 -0
- package/dist/host/worker.js +5 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/inspect.d.ts +80 -2
- package/dist/inspect.js +265 -30
- package/dist/io/common.d.ts +25 -5
- package/dist/io/export.js +2 -1
- package/dist/io/files.d.ts +23 -4
- package/dist/io/files.js +60 -8
- package/dist/io/gltf.js +134 -47
- package/dist/io/heightmap.d.ts +3 -0
- package/dist/io/heightmap.js +1 -0
- package/dist/io/import.js +10 -0
- package/dist/io/inspect-scene.d.ts +55 -0
- package/dist/io/inspect-scene.js +155 -0
- package/dist/io/kinds.d.ts +81 -0
- package/dist/io/kinds.js +163 -0
- package/dist/io/points.d.ts +2 -1
- package/dist/io/points.js +3 -1
- package/dist/io/sidecars.d.ts +24 -0
- package/dist/io/sidecars.js +57 -0
- package/dist/io/source.d.ts +65 -0
- package/dist/io/source.js +112 -0
- package/dist/io/targets.d.ts +47 -3
- package/dist/io/targets.js +148 -13
- package/dist/io/textures.js +21 -1
- package/dist/io/unreal.js +5 -1
- package/dist/mcp/docs.d.ts +10 -1
- package/dist/mcp/docs.js +786 -143
- package/dist/mcp/inputs.d.ts +12 -5
- package/dist/mcp/inputs.js +50 -13
- package/dist/mcp/server.js +56 -27
- package/dist/mcp/tools.d.ts +14 -7
- package/dist/mcp/tools.js +196 -103
- package/dist/mcp/verify.d.ts +2 -2
- package/dist/mcp/verify.js +1 -1
- package/dist/mcp/workspace.d.ts +15 -0
- package/dist/mcp/workspace.js +349 -0
- package/dist/nodes/attributes.js +198 -1
- package/dist/nodes/bake.js +151 -47
- package/dist/nodes/beam.d.ts +1 -0
- package/dist/nodes/beam.js +201 -0
- package/dist/nodes/bevel.js +51 -3
- package/dist/nodes/cloth.js +2 -0
- package/dist/nodes/code.js +21 -9
- package/dist/nodes/curves.js +433 -93
- package/dist/nodes/flow.js +53 -33
- package/dist/nodes/generate.js +12 -38
- package/dist/nodes/heightfield.js +248 -77
- package/dist/nodes/imageops.js +16 -19
- package/dist/nodes/index.d.ts +1 -0
- package/dist/nodes/index.js +1 -0
- package/dist/nodes/material.js +89 -24
- package/dist/nodes/measure.js +43 -17
- package/dist/nodes/particles.js +2 -0
- package/dist/nodes/pcg.js +6 -5
- package/dist/nodes/procedural.js +4 -3
- package/dist/nodes/remesh.js +71 -15
- package/dist/nodes/scene.js +4 -2
- package/dist/nodes/sdf.js +10 -5
- package/dist/nodes/solid.js +20 -5
- package/dist/nodes/splines.d.ts +15 -1
- package/dist/nodes/splines.js +112 -105
- package/dist/nodes/texture.d.ts +21 -6
- package/dist/nodes/texture.js +1318 -185
- package/dist/nodes/topology.d.ts +7 -0
- package/dist/nodes/topology.js +133 -6
- package/dist/nodes/transform.js +6 -2
- package/dist/nodes/uv.js +192 -174
- package/dist/nodes/wasmcall.js +5 -1
- package/dist/open.d.ts +19 -0
- package/dist/open.js +12 -0
- package/dist/package.d.ts +288 -0
- package/dist/package.js +772 -0
- package/dist/packages/check.d.ts +32 -0
- package/dist/packages/check.js +169 -0
- package/dist/packages/commands.d.ts +57 -0
- package/dist/packages/commands.js +537 -0
- package/dist/packages/registry.d.ts +796 -0
- package/dist/packages/registry.js +2998 -0
- package/dist/packages/update.d.ts +124 -0
- package/dist/packages/update.js +476 -0
- package/dist/render/options.d.ts +2 -0
- package/dist/render/options.js +44 -5
- package/dist/render/preview.d.ts +15 -4
- package/dist/render/preview.js +6 -4
- package/dist/render/raster.d.ts +66 -5
- package/dist/render/raster.js +506 -138
- package/dist/render/texview.d.ts +6 -0
- package/dist/render/texview.js +27 -0
- package/dist/scan.d.ts +61 -0
- package/dist/scan.js +228 -0
- package/dist/session.d.ts +311 -0
- package/dist/session.js +849 -0
- package/dist/viewer/app/api.js +48 -6
- package/dist/viewer/app/cooking.js +78 -0
- package/dist/viewer/app/embed.js +27 -7
- package/dist/viewer/app/export-popover.js +118 -16
- package/dist/viewer/app/grid.js +5 -1
- package/dist/viewer/app/guides.js +122 -0
- package/dist/viewer/app/keymap.js +6 -3
- package/dist/viewer/app/layers.js +4 -4
- package/dist/viewer/app/main.js +185 -52
- package/dist/viewer/app/markers.js +60 -0
- package/dist/viewer/app/outliner.js +72 -27
- package/dist/viewer/app/output-info.js +45 -0
- package/dist/viewer/app/outputs.css +147 -8
- package/dist/viewer/app/outputs.js +168 -54
- package/dist/viewer/app/packages.js +614 -0
- package/dist/viewer/app/props.js +176 -52
- package/dist/viewer/app/scene.js +30 -5
- package/dist/viewer/app/select.js +4 -3
- package/dist/viewer/app/status.js +12 -15
- package/dist/viewer/app/style.css +65 -7
- package/dist/viewer/app/vars.js +47 -0
- package/dist/viewer/app/welcome.js +72 -0
- package/dist/viewer/graph-file.d.ts +62 -0
- package/dist/viewer/graph-file.js +175 -0
- package/dist/viewer/index.html +23 -10
- package/dist/viewer/json-edit.d.ts +13 -0
- package/dist/viewer/json-edit.js +274 -0
- package/dist/viewer/outputs.d.ts +49 -5
- package/dist/viewer/outputs.js +264 -56
- package/dist/viewer/packages.d.ts +121 -0
- package/dist/viewer/packages.js +584 -0
- package/dist/viewer/server.d.ts +14 -9
- package/dist/viewer/server.js +266 -28
- package/dist/web/app/web.css +419 -0
- package/dist/web/app/web.js +188 -0
- package/dist/{gallery → web}/bake.d.ts +4 -4
- package/dist/{gallery → web}/bake.js +24 -15
- package/dist/web/folder-page.d.ts +101 -0
- package/dist/web/folder-page.js +146 -0
- package/dist/web/folders.d.ts +280 -0
- package/dist/web/folders.js +970 -0
- package/dist/web/library.d.ts +91 -0
- package/dist/web/library.js +228 -0
- package/dist/web/markdown.d.ts +45 -0
- package/dist/web/markdown.js +677 -0
- package/dist/web/pages.d.ts +258 -0
- package/dist/web/pages.js +301 -0
- package/dist/web/server.d.ts +24 -0
- package/dist/web/server.js +1068 -0
- package/dist/workspace.d.ts +88 -118
- package/dist/workspace.js +358 -460
- package/integrations/godot/addons/topotopo/LICENSE +202 -0
- package/integrations/godot/addons/topotopo/README.md +57 -0
- package/integrations/godot/addons/topotopo/context_menu.gd +43 -0
- package/integrations/godot/addons/topotopo/dock.gd +266 -0
- package/integrations/godot/addons/topotopo/dock.tscn +72 -0
- package/integrations/godot/addons/topotopo/export_filter.gd +72 -0
- package/integrations/godot/addons/topotopo/gltf_instancing.gd +131 -0
- package/integrations/godot/addons/topotopo/icons/topotopo.svg +1 -0
- package/integrations/godot/addons/topotopo/inspector.gd +38 -0
- package/integrations/godot/addons/topotopo/instances_post_import.gd +111 -0
- package/integrations/godot/addons/topotopo/package.gd +23 -0
- package/integrations/godot/addons/topotopo/package_importer.gd +187 -0
- package/integrations/godot/addons/topotopo/plugin.cfg +7 -0
- package/integrations/godot/addons/topotopo/plugin.gd +970 -0
- package/integrations/godot/addons/topotopo/record.gd +435 -0
- package/integrations/godot/addons/topotopo/runner.gd +458 -0
- package/integrations/godot/addons/topotopo/tools/check.gd +42 -0
- package/integrations/godot/addons/topotopo/watcher.gd +199 -0
- package/kernels/pkg/README.md +2 -1
- package/kernels/pkg-simd/README.md +2 -1
- package/library/architecture/versions/1.0/architecture.topo +12 -0
- package/{shelf → library/architecture/versions/1.0/graphs}/arch.json +3 -3
- package/{shelf → library/architecture/versions/1.0/graphs}/beam_truss.json +6 -6
- package/{shelf → library/architecture/versions/1.0/graphs}/brick_wall.json +8 -8
- package/{shelf → library/architecture/versions/1.0/graphs}/door_frame.json +3 -3
- package/{shelf → library/architecture/versions/1.0/graphs}/hex_grid_floor.json +3 -2
- package/{shelf → library/architecture/versions/1.0/graphs}/house.json +8 -8
- package/library/architecture/versions/1.0/graphs/lineup.json +42 -0
- package/{shelf → library/architecture/versions/1.0/graphs}/pillar.json +3 -2
- package/{shelf → library/architecture/versions/1.0/graphs}/railing.json +5 -5
- package/{shelf → library/architecture/versions/1.0/graphs}/roof_gable.json +2 -2
- package/{shelf → library/architecture/versions/1.0/graphs}/roof_hip.json +2 -2
- package/{shelf → library/architecture/versions/1.0/graphs}/roof_skeleton.json +2 -1
- package/{shelf → library/architecture/versions/1.0/graphs}/scaffold.json +4 -4
- package/{shelf → library/architecture/versions/1.0/graphs}/spiral_stairs.json +3 -2
- package/{shelf → library/architecture/versions/1.0/graphs}/stairs.json +6 -6
- package/{shelf → library/architecture/versions/1.0/graphs}/tile_floor.json +3 -2
- package/{shelf → library/architecture/versions/1.0/graphs}/wall_segment.json +10 -10
- package/{shelf → library/architecture/versions/1.0/graphs}/window_frame.json +2 -2
- package/library/architecture/versions/1.0/version.json +1119 -0
- package/{shelf → library/nature/versions/1.0/graphs}/bush.json +2 -2
- package/{shelf → library/nature/versions/1.0/graphs}/cliff_block.json +4 -3
- package/{shelf → library/nature/versions/1.0/graphs}/forest_patch.json +5 -5
- package/{shelf → library/nature/versions/1.0/graphs}/grass_clumps.json +2 -2
- package/library/nature/versions/1.0/graphs/lineup.json +24 -0
- package/{shelf → library/nature/versions/1.0/graphs}/log.json +6 -6
- package/{shelf → library/nature/versions/1.0/graphs}/rock.json +5 -4
- package/{shelf → library/nature/versions/1.0/graphs}/scatter_rocks.json +5 -5
- package/{shelf → library/nature/versions/1.0/graphs}/tree_lowpoly.json +3 -2
- package/library/nature/versions/1.0/nature.topo +12 -0
- package/library/nature/versions/1.0/version.json +534 -0
- package/{shelf → library/props/versions/1.0/graphs}/barrel.json +5 -4
- package/{shelf → library/props/versions/1.0/graphs}/crate.json +3 -3
- package/library/props/versions/1.0/graphs/lineup.json +18 -0
- package/{shelf → library/props/versions/1.0/graphs}/pallet.json +4 -3
- package/{shelf → library/props/versions/1.0/graphs}/pipe_run.json +3 -3
- package/{shelf → library/props/versions/1.0/graphs}/sandbag_wall.json +5 -5
- package/library/props/versions/1.0/props.topo +12 -0
- package/library/props/versions/1.0/version.json +336 -0
- package/{shelf → library/street/versions/1.0/graphs}/bench.json +5 -5
- package/{shelf → library/street/versions/1.0/graphs}/bollard.json +2 -1
- package/{shelf → library/street/versions/1.0/graphs}/cable.json +4 -4
- package/{shelf → library/street/versions/1.0/graphs}/fence.json +7 -7
- package/{shelf → library/street/versions/1.0/graphs}/lamp_post.json +2 -2
- package/library/street/versions/1.0/graphs/lineup.json +22 -0
- package/{shelf → library/street/versions/1.0/graphs}/road_strip.json +2 -2
- package/{shelf → library/street/versions/1.0/graphs}/sign_post.json +1 -1
- package/library/street/versions/1.0/street.topo +12 -0
- package/library/street/versions/1.0/version.json +421 -0
- package/package.json +17 -8
- package/dist/gallery/app/gallery.css +0 -100
- package/dist/gallery/app/gallery.js +0 -80
- package/dist/gallery/cli.d.ts +0 -4
- package/dist/gallery/cli.js +0 -157
- package/dist/gallery/library.d.ts +0 -124
- package/dist/gallery/library.js +0 -366
- package/dist/gallery/pages.d.ts +0 -94
- package/dist/gallery/pages.js +0 -148
- package/dist/gallery/server.d.ts +0 -21
- package/dist/gallery/server.js +0 -391
- package/dist/graph/migrate.d.ts +0 -23
- package/dist/graph/migrate.js +0 -58
- package/dist/mcp/library.d.ts +0 -12
- package/dist/mcp/library.js +0 -159
- package/shelf/index.json +0 -190
package/dist/mcp/docs.js
CHANGED
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
import { CATEGORY_ORDER } from '../graph/registry.js';
|
|
2
|
+
import { PACKAGE_COMMANDS } from '../packages/commands.js';
|
|
3
|
+
import { GODOT_COMMANDS } from '../host/godot-commands.js';
|
|
2
4
|
export const INSTRUCTIONS = `TopoTopo: a procedural geometry engine (Houdini-SOP style) you drive with JSON node graphs.
|
|
3
5
|
|
|
4
6
|
WORKFLOW
|
|
5
|
-
0. inputs {action:"list"} → the person's own files in the
|
|
6
|
-
1. catalog → see node types (100+, Houdini names work as aliases: copytopoints, attribwrangle, polyextrude, mountain…).
|
|
7
|
+
0. inputs {action:"list"} → the person's own files in the package inputs/ folder (guide curves, sites, zones, blockouts, PNG masks). Building a landscape or scene: look there first and build on them (help topic "inputs").
|
|
8
|
+
1. catalog → see node types (100+, Houdini names work as aliases: copytopoints, attribwrangle, polyextrude, mountain…) and TopoTopo's own packages, ready-made generators by full name (topotopo/architecture/house, topotopo/nature/tree_lowpoly, topotopo/street/road_strip …).
|
|
7
9
|
2. help {nodes:[...]} for exact params before using unfamiliar nodes; help {topic:"wrangle"|"graph"|"recipes"…} for concepts.
|
|
8
10
|
3. build {graph} the WHOLE network in one call (dry_run:true validates without cooking). Every response reports errors per node with did-you-mean hints.
|
|
9
11
|
4. render to SEE it (quad view: persp/front/right/top; backfaces are tinted blue = flipped normals; views "quad_uv" + checker:true for UVs; overlays for specific questions: wireframe "hard"/"boundary", views "section", glyphs "N", label_groups, shading "matcap", see help topic "render"). inspect for numbers (bbox, attributes, watertightness).
|
|
10
12
|
5. edit {ops} for incremental changes (set params, insert nodes, rewire) — only downstream nodes re-cook.
|
|
11
|
-
6. export to glb/gltf (materials, textures, meshopt), geo (Houdini), csv (Unreal PCG points / instance rows), points.json, usda, obj/ply/stl/json for Unreal, Blender, Houdini; unreal_landscape = a whole terrain scene for Unreal.
|
|
13
|
+
6. export to glb/gltf (materials, textures, meshopt), geo (Houdini), csv (Unreal PCG points / instance rows), points.json, usda, obj/ply/stl/json for Unreal, Blender, Houdini; unreal_landscape = a whole terrain scene for Unreal. Every export records its source (graph, vars, seeds, frame, version) so it can be made again (help topic "export").
|
|
12
14
|
7. verify: assert nodes guard invariants in the graph (watertight, counts, bbox, expr); explain {graph} reads a result in words; diff {a, b} shows what an edit changed. See help topic "verify".
|
|
13
|
-
OUTPUTS: publish intended deliverables in graph.outputs: {"rotor":{"node":"rotor_final","label":"Rotor"}}. The default graph.output stays unchanged. The viewer lists every graph and named result, its generated textures and image layers; clicking a result isolates it. Rendered images and exports are saved and visible too. Use descriptive names; keep intermediate work in the node outliner. Rename/remove edits maintain published references.
|
|
15
|
+
OUTPUTS: publish intended deliverables in graph.outputs: {"rotor":{"node":"rotor_final","label":"Rotor"}}. The default graph.output stays unchanged. The viewer lists every graph and named result, its generated textures and image layers; clicking a result isolates it. Each card says what the result is (mesh, instances, points, curves, terrain, textures, material, volume or scene; its size) and offers the formats that write it: Download (the export as a file, or a zip with its sidecars) and Export (its target in exports/). Rendered images and exports are saved and visible too. Use descriptive names; keep intermediate work in the node outliner. Rename/remove edits maintain published references. In a package that publishes versions, give each output "tags" (["conifer", "low-poly"]: search finds outputs by them) and a "description" (else its graph's is recorded); "kind" (mesh, instances, points, curves, terrain, textures, material, volume, scene; a mesh with scene_null sockets is a mesh; materials alone are a material) pins what it must cook to: build warns and publishing blocks when it does not.
|
|
14
16
|
INSTANCING: copy_to_points {pack:true} / pack make packed instances (millions stay cheap; glb, usda and geo export them as instances, csv/points.json as one row per instance). See help topic "instancing".
|
|
15
17
|
PCG: mask → scatter {density_mask} → orient → prune → copy_to_points {pack, variants, variant_weights}; points_along_curve, cluster, attribute_from_map. See help topic "pcg".
|
|
16
18
|
CURVES: bezier / nurbs make spline prims (CVs + order, exact everywhere); convert_curve, resample, fillet_curve, offset_curve_3d, project_curve (roads on terrain), spline_fit, curve_attribs (curveu, frames, ramps). See help topic "curves".
|
|
17
19
|
CLOTH: drape {steps} simulates a mesh as cloth over a collider (input 1) and the floor, from pins (pin_group / input 2) and in wind; inflate {pressure} puffs a closed mesh into a cushion or balloon. See help topic "cloth".
|
|
18
20
|
|
|
19
21
|
CONVENTIONS: Y-up, metres, angles in degrees (wrangle trig uses radians). Houdini attribute names (P N Cd uv pscale orient up scale width name class piece). Polygons are closed prims, polylines are open prims.
|
|
20
|
-
GRAPH: {"nodes": {"name": {"type": "...", "in": ["upstream", ...], "params": {...}}}, "output": "name", "vars": {"k": 1}}. Params accept "=expr" using vars (e.g. "=height*0.5"), time (frame, time) and other nodes (npoints('pts'), bbox('base').size.y, ch('box1/size')).
|
|
22
|
+
GRAPH: {"nodes": {"name": {"type": "...", "in": ["upstream", ...], "params": {...}}}, "output": "name", "vars": {"k": 1}}. Params accept "=expr" using vars by their bare name (e.g. "=height*0.5"), time (frame, time) and other nodes (npoints('pts'), bbox('base').size.y, ch('box1/size')). Code (wrangle, script, sdf_expr, heightfield_layer, parametric, group and assert expressions) reads vars the same way: height, not vars.height.
|
|
21
23
|
HUMANS TUNE VARS: declare "params" for the 3–8 vars a person would tune ({"k": {type, desc, min, max, options, label, step}}); the live viewer (preview) shows them as sliders and menus. People change vars at any time, so read the graph (graphs {action:"get"}) before assuming a var's value. See help topic "graph".
|
|
22
24
|
TIME: build/edit/render/inspect/export take "frame" (default 1). solver = per-frame feedback (growth, accumulation). See help topic "time".
|
|
23
25
|
PARTICLES: particles(emitter points, collision mesh, field) = Houdini POPs in one node: emission, gravity/drag/wind, curl noise, fields, floor and mesh collisions, trails as polylines; steps with the frame. See help topic "particles".
|
|
24
26
|
ESCAPE HATCHES: wrangle (per-element JS with @P/@Cd syntax), script (whole-geometry JS with the engine library), sdf_expr (signed distance functions). If a node is missing, write it with these.
|
|
25
|
-
TERRAIN: heightfield → heightfield_noise → heightfield_erode → masks / heightfield_path → heightfield_scatter + copy_to_points, heightfield_to_mesh; export png16 for an Unreal Landscape, or unreal_landscape for the landscape + layers + instances bundle. See help topic "heightfield".
|
|
27
|
+
TERRAIN: heightfield → heightfield_noise → heightfield_erode → masks / heightfield_path → heightfield_scatter + copy_to_points, heightfield_to_mesh; heightfield_crop works on one tile of a big map; export png16 for an Unreal Landscape, or unreal_landscape for the landscape + layers + instances bundle. See help topic "heightfield".
|
|
26
28
|
PHYSICS: rbd_settle drops pieces (packed instances) onto a terrain/container/ground until they rest, so scattered rocks and props sit in contact; rbd_stack drops them one at a time into piles. See help topic "rbd".
|
|
27
|
-
|
|
29
|
+
WORKSPACE, PACKAGE, LIBRARY: a package is a folder of graphs and the models they make, marked by one <id>.topo file; every tool works in the open package. A workspace is a folder tree with topotopo-workspace.json at its root, best inside the engine's content folder (the Godot project, Unreal's Content/): every folder in it with a .topo file is a package, its packages find each other by themselves, use the shared libraries its file lists and share one copy of each package version, and their exports stay in each package's exports/, where the engine imports them. A library is a registered folder of packages, shared across workspaces; outside a workspace a package finds packages in every registered library. The web app (topotopo web) shows the workspaces and libraries (the person's board links to them), and TopoTopo ships one library built in. The workspace tool works on all three: workspace {action:"list"} finds a package, {action:"open"} makes it the folder every tool works in, {action:"create"} starts one, {action:"show"} says what the open package's workspace holds, {action:"check"} cooks what it relies on and lists what broke (after a TopoTopo update). See help topic "workspace".
|
|
30
|
+
PACKAGES: a package uses the published outputs of other packages as node types, {"type": "owner/name/output"} (help {nodes:[...]} gives their params and version); a build that names one adds it to the package once the graph validates. TopoTopo's own packages are four packages built into TopoTopo, used the same way: topotopo/architecture (walls, windows, doors, houses, roofs, stairs, railings, floors), topotopo/nature (rocks, cliffs, trees, bushes, logs, forests, grass), topotopo/props (barrels, crates, pallets, sandbags, pipes) and topotopo/street (roads, lamp posts, bollards, benches, signs, fences, cables), e.g. {"type": "topotopo/nature/rock", "params": {"size": 2}}. Only a package's graphs use packages: when the server starts it makes its folder a package if the folder holds nothing but a package's own folders (its first reply says so), and workspace {action:"init"} makes any other folder one when the person says so. workspace {action:"packages"} lists them, {action:"search", query?, kind?, tag?} finds outputs in the places the package looks in ("a conifer", every terrain) and says whether the package can use each, {action:"libraries", add} lists a shared library the person names for the workspace, {action:"publish", dry_run:true} says what publishing would do (show it to the person; publish {note} only when they say so), {action:"outdated"} lists newer versions, {action:"update", package} shows the before/after of an update, which you apply (from, to, apply:true) only when the person says so. See help topic "packages".`;
|
|
28
31
|
/**
|
|
29
32
|
* The complete example of help topic "inputs": guides.glb's path.* curves cut roads into a heightfield and its zone.*
|
|
30
33
|
* areas mask a tree scatter; the vars a person tunes are exposed as params. test/mcp.ts cooks it on a real guides.glb.
|
|
@@ -42,7 +45,7 @@ export const INPUTS_EXAMPLE = {
|
|
|
42
45
|
zone_mask: { type: 'heightfield_mask_by_object', in: ['road', 'areas'], params: { by: 'footprint', distance: 0, falloff: 3 } },
|
|
43
46
|
off_road: { type: 'heightfield_layer', in: ['zone_mask'], params: { layer: 'mask', expression: 'mask * (1 - path)' } },
|
|
44
47
|
spots: { type: 'heightfield_scatter', in: ['off_road'], params: { density: '=tree_density', align: 'upright', seed: 3 } },
|
|
45
|
-
tree: { type: 'tree_lowpoly', params: { height: 7 } },
|
|
48
|
+
tree: { type: 'topotopo/nature/tree_lowpoly', params: { height: 7 } },
|
|
46
49
|
trees: { type: 'copy_to_points', in: ['tree', 'spots'], params: { pack: true } },
|
|
47
50
|
land: { type: 'heightfield_to_mesh', in: ['off_road'], params: { color: 'terrain' } },
|
|
48
51
|
out: { type: 'merge', in: ['land', 'trees'] },
|
|
@@ -62,28 +65,107 @@ export function graphLines(g) {
|
|
|
62
65
|
return `{${parts.join(',\n ')}}`;
|
|
63
66
|
}
|
|
64
67
|
export const TOPICS = {
|
|
65
|
-
|
|
66
|
-
A
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
68
|
+
workspace: `WORKSPACE, PACKAGE, LIBRARY (the three words, and the workspace tool)
|
|
69
|
+
- A WORKSPACE is a folder tree: one production, a game, an archviz job, with topotopo-workspace.json at its root. Its
|
|
70
|
+
best place is inside the engine's content folder (Godot: the project folder or a folder in it; Unreal: Content/ or a
|
|
71
|
+
folder in it), so Explorer, the engine and the web app show one tree and the engine imports each package's exports/.
|
|
72
|
+
- A PACKAGE is a folder of graphs and the models they make, marked by one <id>.topo file, its manifest (the file's
|
|
73
|
+
name is the package id). Every folder of a workspace with a .topo file is a package of it, and the packages of a
|
|
74
|
+
workspace find each other by themselves. Every tool works in one package, the open package; only a package's graphs
|
|
75
|
+
use other packages. A package that publishes versions is used by other packages by name (help topic "packages").
|
|
76
|
+
- A LIBRARY is a folder of packages registered on this machine by name (\`topotopo library add <name> <folder>\`, kept
|
|
77
|
+
in ~/.topotopo/config.json), shared across workspaces: a workspace lists the libraries it uses. TopoTopo's built-in
|
|
78
|
+
library, "topotopo", is always there. Workspaces and libraries share one set of names.
|
|
79
|
+
The workspace tool works on all three; its actions that use or publish packages are in help topic "packages".
|
|
76
80
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
A PACKAGE'S FOLDER
|
|
82
|
+
props/lantern/lantern.topo {title, description, tags, graph:"main", bake:{graph?, node?, frame?}, links:[{label, url}],
|
|
83
|
+
name?:"owner/name", uses}
|
|
84
|
+
props/lantern/graphs/ assets/ inputs/ exports/ graphs, saved assets, the person's input files, exports
|
|
85
|
+
props/lantern/attachments/ concept art, references, source files (shown on the package's page)
|
|
86
|
+
props/lantern/.web/ thumb.png, preview.glb, bake.json: derived, never edit
|
|
87
|
+
A folder holds one package at most (two .topo files in a folder are an error), and a package holds no other package.
|
|
88
|
+
Plain folders group packages: props/, levels/, a Godot project's assets/.
|
|
89
|
+
|
|
90
|
+
WORKING IN A PACKAGE
|
|
91
|
+
- workspace {action:"list", query?, tag?} → find one in the registered libraries and workspaces (and the open
|
|
92
|
+
package's workspace); workspace {action:"get", library, id, thumbnail:true} → what it holds ("library": a library's
|
|
93
|
+
or a workspace's name).
|
|
94
|
+
- workspace {action:"open", library, id} (or {path}) → every tool (build, edit, render, export, inputs, assets,
|
|
95
|
+
preview) now works in that folder. Build the package's model into graph "main" (or the manifest's "graph").
|
|
96
|
+
- workspace {action:"create", library, path:"props/barrel", title, tags, links} → a new package in a library or a
|
|
97
|
+
workspace, opened.
|
|
98
|
+
- workspace {action:"init"} → the server's folder becomes a package where it is none (<id>.topo in its folder), when
|
|
99
|
+
the person wants its graphs to use packages. When the server starts it makes its folder, named or not, a package
|
|
100
|
+
if the folder is in no package and holds nothing but what TopoTopo makes itself (graphs/, assets/, exports/,
|
|
101
|
+
inputs/), or nothing at all; a folder with anything else in it (a repository, the person's own files) stays as it is
|
|
102
|
+
until the person says so.
|
|
103
|
+
- workspace {action:"set", tags, links, description, bake:{frame: 48}} → edit the manifest (bake.frame for
|
|
83
104
|
simulations that settle after frame 1; bake.node to show one part).
|
|
84
|
-
-
|
|
105
|
+
- workspace {action:"bake"} → render the previews now and see the thumbnail.
|
|
85
106
|
Put reference images the person gives you in attachments/, guide files in inputs/. Links in "links" point back to the
|
|
86
|
-
board or concept pages, so the
|
|
107
|
+
board or concept pages, so the package page and the board link both ways. To find a ready-made output ("a conifer",
|
|
108
|
+
every terrain): workspace {action:"search", query?, kind?, tag?}.
|
|
109
|
+
|
|
110
|
+
WORKSPACES: topotopo-workspace.json at the workspace's root:
|
|
111
|
+
{"name": "my-game", "libraries": ["props", "../shared/materials"],
|
|
112
|
+
"engine": {"type": "godot", "project": "../project.godot"}, "follow": false, "uses": {"topotopo/props": "1.1"}}
|
|
113
|
+
Paths are written from the workspace's folder. The person makes one: CLI topotopo workspace init <folder>
|
|
114
|
+
[--engine godot:<path>|unreal:<path>|none] [--library <name or folder>] [--follow]; MCP workspace
|
|
115
|
+
{action:"init_workspace", path, ...} when the person says so. workspace {action:"show"} (CLI: topotopo workspace)
|
|
116
|
+
says what the open package's workspace holds: its packages as the scan finds them.
|
|
117
|
+
- THE SCAN: every folder below the root with exactly one .topo file is a package; the scan does not enter a package.
|
|
118
|
+
It skips dot folders, node_modules, topotopo-packages, Unreal's Binaries, Intermediate, Saved, DerivedDataCache,
|
|
119
|
+
__ExternalActors__ and __ExternalObjects__, C#'s bin and obj beside a .csproj or .sln, a folder holding another
|
|
120
|
+
engine project than the workspace's own, another workspace (listed, not scanned) and a TopoTopo checkout; it goes 16
|
|
121
|
+
folders deep and says which folder it cut off there.
|
|
122
|
+
- WHERE A PACKAGE LOOKS: in a workspace, the workspace itself, then the shared libraries its file lists, in order, then
|
|
123
|
+
TopoTopo's built-in library. Outside a workspace: the library the package is in (a registered library's root or a
|
|
124
|
+
library.json above it, read from the package's own checkout), then every other registered library, then the built-in
|
|
125
|
+
library. A name comes from the first place that has it; the same name in a later place is not used (packages and
|
|
126
|
+
search say "also in …, not used"). Only the built-in library has the packages named "topotopo/…". Two folders of one
|
|
127
|
+
place publishing the same name leave the name out (said, naming both), and publishing blocks while they do. A library
|
|
128
|
+
listed by the workspace that lies inside it, or holds it, is a problem: its packages are found by themselves.
|
|
129
|
+
- SHARED LIBRARIES: "libraries" holds registered names and paths to folders outside the workspace. The person lists
|
|
130
|
+
one: CLI topotopo workspace library add|remove <name or folder> [--workspace <folder>]; MCP workspace
|
|
131
|
+
{action:"libraries", add:"props"} (a relative path is read from the server's folder), only when the person names it.
|
|
132
|
+
{action:"libraries"} alone says what the workspace lists. Registering a library is the person's own act.
|
|
133
|
+
- ONE COPY PER WORKSPACE: the packages inside share one copy of each package version, in topotopo-packages/ beside the
|
|
134
|
+
file, whose "uses" names one version of each package for the whole workspace. A first use in any package adds it
|
|
135
|
+
there; Update compares every place any package of the workspace uses the updated package, and applying changes them
|
|
136
|
+
all. A package that publishes versions keeps its own uses and copies (they are published with it). workspace init
|
|
137
|
+
moves the copies of the packages inside that kept their own.
|
|
138
|
+
- FOLLOWING: "follow": true shows the workspace's own packages live from their working folders, for looking (the
|
|
139
|
+
viewer, renders, inspect); exports and publishing always use the published versions, and an export made while
|
|
140
|
+
following says which it used.
|
|
141
|
+
- THE ENGINE: "engine" names the engine project ({"type", "project"}, the path written from the workspace and leading
|
|
142
|
+
upward when the workspace is inside it) or "none" (kept). workspace init finds it: the nearest at or above the
|
|
143
|
+
folder, else one below. It says when Unreal will not see the workspace (outside the project's Content/ or a plugin's),
|
|
144
|
+
which packages lie outside a project found below (their exports are not imported), and which Godot export presets
|
|
145
|
+
would ship TopoTopo's files, with the exclude_filter entries to add. An export lands in its package's exports/, which
|
|
146
|
+
the engine imports where the workspace is inside it. Inside a Godot project TopoTopo keeps a .gdignore in each
|
|
147
|
+
package's versions/, packages/ and inputs/ (its working folders, not game content); files engines write beside ours
|
|
148
|
+
(*.import, *.uid, *.uasset …) never count as TopoTopo's.
|
|
149
|
+
- CHECK: workspace {action:"check"} (CLI: topotopo check) cooks the newest version of the workspace's packages that
|
|
150
|
+
publish, every graph of the others and the newest versions in the shared libraries it lists, and lists what broke
|
|
151
|
+
and why; it changes nothing but missing .gdignore files. Run it after a TopoTopo update.
|
|
152
|
+
|
|
153
|
+
LIBRARIES AND THE WEB APP: a library holds packages in folders below it; the parent folders ("props") are a package's
|
|
154
|
+
collection, and an id is unique in its library or workspace. The web app (\`topotopo web\`, http://127.0.0.1:7340)
|
|
155
|
+
mirrors the folders of the registered workspaces (CLI: topotopo workspace add <folder>) and libraries: the front page
|
|
156
|
+
shows each as a card (TopoTopo's built-in library last) and searches every package and output; every folder is a page
|
|
157
|
+
(/w/<workspace>/<path>/, /l/<library>/<path>/) with its flags, its package when it holds a .topo file (preview,
|
|
158
|
+
versions, outputs with their kinds and tags, the packages that use it and those it uses, graphs, exports), its notes,
|
|
159
|
+
its subfolders and its files by type (images, sounds and videos in players, models in 3D). Notes: every .md and .txt
|
|
160
|
+
file of a folder is a box on its page, in file name order; markdown renders, and a link shows what it leads to (an
|
|
161
|
+
image inline, a sound or video in a player, a .glb in 3D, a folder as a card, a YouTube or Vimeo address in its
|
|
162
|
+
player), relative to the note's folder, res:// from the Godot project, /Game/ from Unreal's Content/; a link to a
|
|
163
|
+
missing file is a flag. The other flags: a preview that did not cook, a package with no version or with changes no
|
|
164
|
+
version holds, an export older than its graph, published outputs no package of the workspace uses. Each package keeps
|
|
165
|
+
a stable address (/p/<library or workspace>/<id>, leading to its folder page), a thumbnail (…/thumb.png) and an iframe
|
|
166
|
+
embed (/embed/<library or workspace>/<id>) that the person's board pastes. It bakes the previews by itself after
|
|
167
|
+
graphs, assets or inputs change, from the graph named in "graph" (or "bake": another graph, a node, a frame);
|
|
168
|
+
TopoTopo's own packages show the thumbnails they keep of their outputs.`,
|
|
87
169
|
graph: `GRAPH FORMAT
|
|
88
170
|
{
|
|
89
171
|
"nodes": {
|
|
@@ -97,39 +179,61 @@ board or concept pages, so the gallery page and the board link both ways.`,
|
|
|
97
179
|
"vars": {"rock_count": 200},
|
|
98
180
|
"params": {"rock_count": {"type": "int", "min": 0, "max": 2000, "label": "Rocks", "desc": "number of rocks"}}
|
|
99
181
|
}
|
|
100
|
-
- "vars": graph constants that "=expr" params
|
|
101
|
-
|
|
182
|
+
- "vars": graph constants that "=expr" params and code read by their bare name ("=rock_count * 2", @P.y += height).
|
|
183
|
+
Name them so code can: letters, digits and _, and not a JavaScript keyword (class, default …), a helper (noise,
|
|
184
|
+
rand, length, detail …), a built-in (Math, Number, JSON …), the time (frame, time, fps, timeInc) or a wrangle name
|
|
185
|
+
(ptnum, Frame …); the build says when a name is taken. "params": one entry per var a person would tune (3–8 of them):
|
|
186
|
+
{type (float int bool string enum), desc, min, max, options (enum: strings or numbers; the var holds the option,
|
|
187
|
+
so [4, 8, 16] gives numbers), label (control name), step (slider step)}.
|
|
102
188
|
The live viewer (preview) renders them as controls: sliders for numbers with a range, menus for options, checkboxes
|
|
103
189
|
for bools. They are also the parameters when the graph is saved as an asset.
|
|
104
190
|
- People change vars at any time (the viewer's controls edit the stored graph): read it with graphs {action:"get"}
|
|
105
191
|
before assuming a var's value, and edit {op:"vars"} rather than rebuilding to change one. When a person asks to
|
|
106
192
|
keep a value, keep it.
|
|
193
|
+
- Command line: --var name=value sets a var for one run without editing the file (repeat it; numbers, true/false and
|
|
194
|
+
JSON values are parsed, other text is a string; an unknown name lists the graph's vars), and --output <id> renders,
|
|
195
|
+
exports and inspects a named output instead of the default: topotopo terrain.json --output land --var relief=8
|
|
196
|
+
--render r.png --export land.glb. Exports record the vars they were made with (help topic "export", SOURCE).
|
|
197
|
+
- The viewer shows each cook as it runs (the node, the time) and has a Stop button: a cook a person stopped fails with
|
|
198
|
+
"cook stopped" at the node it stopped at. That is their decision, not an error to retry: ask before cooking it again.
|
|
107
199
|
- "in": ordered input list (null = unconnected), a single name, or {"inputName": node} (names from help).
|
|
108
200
|
- Output node: "output", else a node named out/OUT, else the last unconnected node.
|
|
109
201
|
- Optional "outputs": {"rotor":{"node":"rotor_final","label":"Rotor"}} publishes additional deliverables beside
|
|
110
202
|
the default. Publish complete assets and useful separate parts; the viewer isolates each on click and lists
|
|
111
|
-
its textures/layers.
|
|
203
|
+
its textures/layers. In a package that publishes versions they are its outputs; "publish": false keeps one (a viewer-only
|
|
204
|
+
preview) out of the package, "tags" and "description" say what it is to search, and "kind" pins what it cooks to
|
|
205
|
+
(help topic "packages"). Rename/remove edits maintain references. The latest render of each graph node is saved as
|
|
112
206
|
exports/renders/<graph>-<node>.png (each render overwrites it) unless save_to is supplied; explicit render/export
|
|
113
207
|
destinations are registered in the viewer too.
|
|
114
208
|
- Optional "export" (on the graph for the default output, or on an entry of "outputs") is where that output
|
|
115
209
|
exports: a format ("glb" → exports/<graph or output id>.glb) or {"format":"obj","path":"parts/a.obj","up_axis":"z"}
|
|
116
|
-
(the export tool's options), always inside
|
|
117
|
-
|
|
210
|
+
(the export tool's options), always inside the package's exports/ (a workspace inside the engine project has it
|
|
211
|
+
inside the project, where the engine imports from; an "engine:" path prefix is gone: it warns, and exporting it is
|
|
212
|
+
refused). The person's Export buttons in the viewer, export {output} / export {all:true} and the CLI's --export-all write these
|
|
213
|
+
targets; set one with edit {op:"export", output?, export}.
|
|
214
|
+
The viewer's Download buttons need no target: they offer the formats that fit the output (a heightfield: png16,
|
|
215
|
+
r16, mask_png, unreal_landscape; a mesh: glb, gltf, usda, obj …) and hand the person the files, with their record.
|
|
118
216
|
- Node names: letters, digits, _ . - Node types & params are case/underscore-insensitive and accept Houdini-style aliases.
|
|
119
217
|
- "bypass": true passes input 0 through. "note": free text. "ui": {x,y} reserved for the future GUI.
|
|
120
218
|
- Vectors: a single number broadcasts ("size": 2 → [2,2,2]). Colours accept [r,g,b], "#ff8800" or names.
|
|
121
219
|
- build mode "merge" upserts nodes into the existing graph; edit ops: set, add, remove (auto-rewires), connect, rename, output, vars, bypass, replace, insert (after a node, rewiring its consumers).
|
|
122
|
-
- Several graphs can coexist (name param); graph_ref composes them. Graphs persist as JSON in the
|
|
123
|
-
|
|
124
|
-
|
|
220
|
+
- Several graphs can coexist (name param); graph_ref composes them. Graphs persist as JSON in the package.
|
|
221
|
+
- "fragment": true marks a graph that is a piece another graph or a script completes (merging in nodes it names but
|
|
222
|
+
does not hold): it is never cooked on its own, and topotopo check skips it.`,
|
|
223
|
+
inputs: `HUMAN INPUT (guides, blockouts and masks in the package inputs/ folder)
|
|
224
|
+
People feed in their own material by dropping files into <package>/inputs/ (or onto the live viewer, or with its Add
|
|
125
225
|
input button): meshes, guide curves and points drawn in Blender, Houdini or Unreal, placeholder blockouts, PNG masks and
|
|
126
226
|
heightmaps. Every tool answer ends with a note when inputs/ has files new or changed since your last call. Before building a
|
|
127
227
|
landscape or scene, call inputs {action:"list"}; inputs {action:"describe", path} tells what one holds (polygons, open
|
|
128
228
|
polylines, loose points, packed prims; bbox in metres; attributes; every name and role value; materials). Read a file
|
|
129
|
-
with a file node
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
229
|
+
with a file node: {"type":"file","params":{"path":"inputs/guides.glb"}} (relative paths read from the package folder,
|
|
230
|
+
the nearest folder with a .topo file at or above the graph, else the graph's folder; the list gives the exact path).
|
|
231
|
+
MARKERS: what a person places by clicking in the live viewer (the guides tools: null, curve, area, volume; they drag
|
|
232
|
+
them about afterwards) is written as inputs/markers.json with the same name and role attributes (sites: points with
|
|
233
|
+
pscale and orient; paths open and zones closed polylines; volumes closed boxes), so describe it and read it like any
|
|
234
|
+
other input. A graph meant to be directed by guides reads the file with "missing": "empty"
|
|
235
|
+
({"type":"file","params":{"path":"inputs/markers.json","missing":"empty"}}): it cooks before the first guide is
|
|
236
|
+
drawn, and again each time the guides change.
|
|
133
237
|
FORMATS: glb/gltf (+Y up already; object names → prim "name", materials → "material"), obj/stl/ply (no up axis:
|
|
134
238
|
Unreal exports and Blender exports with Up = Z are Z-up, so add "up_axis":"z"), geo/bgeo (Houdini), csv and
|
|
135
239
|
points.json (one point per row; columns such as name, role, pscale become point attributes), blend (needs Blender
|
|
@@ -167,14 +271,16 @@ ROLES AND RECIPES
|
|
|
167
271
|
{density_mask:"mask"} scatters there (invert:true for a hole); group {class:"point", pattern:"@mask>0.5"} groups
|
|
168
272
|
them. Let volumes reach below the ground. On a heightfield use heightfield_mask_by_object {by:"footprint"}.
|
|
169
273
|
blockout a placeholder mesh to replace: bound {per_piece:true} gives each piece's box; foreach {mode:"pieces",
|
|
170
|
-
piece_attrib:"name"} runs a body per object, where a
|
|
274
|
+
piece_attrib:"name"} runs a body per object, where a package output takes its size from the piece
|
|
171
275
|
("width": "=bbox('piece').size.x", piece = the body's input node) and match_size(asset, piece) moves it in
|
|
172
276
|
place. A footprint polygon feeds the house asset directly (its input 0).
|
|
173
277
|
IMAGES: PNG masks and heightmaps. heightfield_from_image {path:"inputs/height.png", size:[x, z], height_min, height_max}
|
|
174
278
|
makes a terrain (16-bit greys keep the detail); with a heightfield connected it writes into layer (e.g. "mask",
|
|
175
|
-
height_min 0, height_max 1)
|
|
176
|
-
|
|
177
|
-
|
|
279
|
+
height_min 0, height_max 1), the image lying at size/center in the world (fit "field" stretches it over the
|
|
280
|
+
connected heightfield instead). attribute_from_map {path, projection:"xz", size, center, name:"mask"} samples it onto
|
|
281
|
+
points (scatter density_mask, prune {mode:"density"}). Textures: a node albedo = image_file {path:"inputs/albedo.png"}
|
|
282
|
+
loads it as an image named "albedo" (after the node; a file node names it after the file) for the texture nodes and
|
|
283
|
+
texture_to_material {base_color:"albedo"}.
|
|
178
284
|
EXAMPLE: inputs/guides.glb holds path.* curves and zone.* areas: roads cut into hills, trees in the zones off the road,
|
|
179
285
|
the vars a person would tune exposed as params:
|
|
180
286
|
${graphLines(INPUTS_EXAMPLE)}
|
|
@@ -182,8 +288,13 @@ Afterwards render it, and tell the person which of their guides you used for wha
|
|
|
182
288
|
expressions: `PARAM EXPRESSIONS
|
|
183
289
|
Any non-code param can be a string starting with "=": a JS expression evaluated with graph vars.
|
|
184
290
|
"vars": {"floors": 6, "h": 3} → "height": "=floors*h", "count": "=floors*4"
|
|
291
|
+
ONE FORM: expressions and code (wrangle, script, sdf_expr, heightfield_layer, parametric curves and surfaces, group and
|
|
292
|
+
assert expressions, loop bodies) read graph vars by their bare name: height, not vars.height (an error says so).
|
|
293
|
+
Vars are read-only; in code a local of the same name comes first.
|
|
185
294
|
Helpers: sin cos tan asin acos atan atan2 sqrt pow exp log abs floor ceil round min max sign hypot PI TAU E
|
|
186
295
|
clamp fit lerp smoothstep frac mod radians degrees rand(x, seed) pick(array, i)
|
|
296
|
+
Conversions: Number(x) parseFloat(s) parseInt(s, radix) String(x) Boolean(x) isFinite(x) isNaN(x), Number.isInteger …
|
|
297
|
+
e.g. a menu var holding text: "=Number(res) * 2".
|
|
187
298
|
Time: frame, time (seconds), fps, timeInc. "=sin(time*2)" animates; the node then re-cooks per frame (see topic time).
|
|
188
299
|
Inside foreach bodies: iteration, numiterations, value, attr (e.g. "=attr.height"), plus parent vars.
|
|
189
300
|
Inside solver bodies: iteration (frames since start_frame), substep, and frame/time/timeInc are the step's time.
|
|
@@ -193,6 +304,7 @@ READING OTHER NODES (n = a node of the same graph or body, named by a string lit
|
|
|
193
304
|
centroid('n') → mean point position (bbox('n').center is the box centre)
|
|
194
305
|
detail('n', 'attr'[, comp]) detail attribute value
|
|
195
306
|
point('n', i, 'attr'[, comp]) prim('n', i, 'attr'[, comp]) (prim 'P' = centroid when no prim P exists)
|
|
307
|
+
primintrinsic('n', i, 'name'[, comp]) computed prim values (topic instancing): "=primintrinsic('rocks', 0, 'bounds', 3)" = ymax
|
|
196
308
|
ch('n', 'param') or ch('n/param') another node's resolved param value (defaults included)
|
|
197
309
|
e.g. stack on top: "translate": [0, "=bbox('base').max.y", 0] match a count: "count": "=npoints('pts')"
|
|
198
310
|
Referenced nodes are dependencies: they cook first (even if not wired), changing them re-cooks this node, unknown
|
|
@@ -200,10 +312,11 @@ names get did-you-mean errors, and reading a node downstream of yourself is a cy
|
|
|
200
312
|
Not supported: dynamic names (npoints(name) with a variable), and these functions inside graph "vars".
|
|
201
313
|
Assets: their vars become node parameters.
|
|
202
314
|
Expressions are per-node constants. For per-element logic use wrangle.
|
|
203
|
-
SANDBOX: an expression sees only graph vars (read-only copies), frame/time/fps/timeInc, Math, the helpers
|
|
204
|
-
reference functions; any other name (process, require, globalThis, fetch,
|
|
205
|
-
import, \`this\` and assigning to a name. Errors name the param and the expression: param "size":
|
|
206
|
-
|
|
315
|
+
SANDBOX: an expression sees only graph vars (read-only copies), frame/time/fps/timeInc, Math, the helpers and
|
|
316
|
+
conversions above and the reference functions; any other name (process, require, globalThis, fetch, JSON …) is an
|
|
317
|
+
error, and so are import, \`this\` and assigning to a name. Errors name the param and the expression: param "size":
|
|
318
|
+
expression "=…" failed: ….
|
|
319
|
+
Straight-line expressions (operators, helper, conversion and Math calls) run directly; ones with functions, loops, regular
|
|
207
320
|
expressions or method calls run under the script timeout (TOPOTOPO_SCRIPT_TIMEOUT_MS, default 30 s), ~0.5 ms more
|
|
208
321
|
each the first time (the result is reused while the vars, time and nodes it read stay the same).
|
|
209
322
|
SECURITY: a graph is code. Expressions and wrangles run sandboxed with a timeout on Node, but can still allocate
|
|
@@ -223,7 +336,8 @@ SOLVER (Houdini SOP Solver): feedback over frames.
|
|
|
223
336
|
Body inputs: 0 = previous frame's result (initial geometry on start_frame), 1 = initial, 2/3 = solver inputs 2/3 at that frame.
|
|
224
337
|
Cooking frame N runs the body for frames start_frame..N (substeps times each); before start_frame the input passes through.
|
|
225
338
|
Each frame's state is cached, so stepping 10 → 11 runs the body once; jumping back is a cache hit.
|
|
226
|
-
Body vars: iteration (frames since start_frame, from 0), substep, and
|
|
339
|
+
Body vars (by their bare name in "=expr" params and code): iteration (frames since start_frame, from 0), substep, and
|
|
340
|
+
frame/time/timeInc = the step's time (fractional between substeps).
|
|
227
341
|
SOLVER vs FOREACH: foreach feedback:true is count-based (N iterations in one cook, no time, cached as a whole);
|
|
228
342
|
the solver's result depends on the frame you cook at and is advanced frame by frame.
|
|
229
343
|
PARTICLES: the particles node is a solver too: frame f runs steps + (f - start_frame) × substeps steps, every frame's state is
|
|
@@ -262,12 +376,17 @@ GEOMETRY QUERIES (input 0 = incoming geometry, 1..3 = other inputs):
|
|
|
262
376
|
nearpoint(i,pos[,maxdist]) nearpoints(i,pos,maxdist,maxcount) xyzdist(i,pos) minpos(i,pos) closest(i,pos)→{dist,pos,prim}
|
|
263
377
|
intersect(i,orig,dir)→{prim,pos,dist} (prim -1 = miss) inpointgroup(i,"grp",pt) inprimgroup(i,"grp",pr)
|
|
264
378
|
invertexgroup(i,"grp",v) inedgegroup(i,"grp",pt0,pt1)
|
|
379
|
+
primintrinsic(i,"name",pr): read-only values computed per prim: "bounds" [xmin,xmax,ymin,ymax,zmin,zmax], "typename"
|
|
380
|
+
("Poly" | "PackedGeometry" | "BezierCurve" | "NURBCurve"), "vertexcount", "closed"; on packed prims "packedbounds" (the
|
|
381
|
+
source's own box), "transform" (3×3), "packedfulltransform" (4×4), "pivot" (topic instancing)
|
|
265
382
|
EDITS (applied after the loop, geohandle 0 optional):
|
|
266
383
|
addpoint(0,pos)→pt addprim(0,"poly"|"polyline",[pts])→prim removepoint(0,pt) removeprim(0,pr,andpoints)
|
|
267
384
|
setpointattrib(0,"name",pt,v) setprimattrib setvertexattrib setdetailattrib(0,"name",v) setpointgroup(0,"g",pt,1) setprimgroup
|
|
268
385
|
setvertexgroup(0,"g",v,1) setedgegroup(0,"g",pt0,pt1,1) (0 removes)
|
|
269
386
|
DEBUG: print(...) (shows as warnings), error("msg") aborts. Use 'return' to skip the rest for the current element.
|
|
270
|
-
|
|
387
|
+
VARS: graph vars by their bare name, as in "=expr" params: @P.y += height * 0.5; rand(@ptnum, seed). Read-only (writing
|
|
388
|
+
one is an error); a local of the same name comes first. Inside foreach also iteration numiterations value attr, inside
|
|
389
|
+
solver iteration substep frame time timeInc. A wrangle re-cooks when a var it names changes, not for other vars.
|
|
271
390
|
SPEED: a point wrangle over 64k+ points that calls no geometry query/edit/print function runs in parallel on worker threads (same result).
|
|
272
391
|
SDF helpers are also available (see topic sdf).`,
|
|
273
392
|
groups: `GROUP PATTERNS (any "group" param; also delete/group nodes)
|
|
@@ -278,6 +397,20 @@ SDF helpers are also available (see topic sdf).`,
|
|
|
278
397
|
@P.y>0.5 attribute test, ops = == != > < >= <= ; components .x .y .z .w .r .g .b
|
|
279
398
|
@class==3 @name=piece* @Cd.r<0.2 @ptnum<100
|
|
280
399
|
Tokens are space-separated and applied left to right (union unless prefixed ! or ^).
|
|
400
|
+
STRING ATTRIBUTES (name, path, a material or part label):
|
|
401
|
+
@name=barrel exactly "barrel" (= and == are the same)
|
|
402
|
+
@name=bar* @name=*rel @name=b?rrel wildcards: * any run, ? one character; case-sensitive
|
|
403
|
+
@name!=frame every element whose name is not "frame"
|
|
404
|
+
"@name=barrel @name=stock" either (a space is a union)
|
|
405
|
+
"* ^@name=barrel ^@name=stock" all but those two
|
|
406
|
+
Quotes around the value are optional (@name='bolt*'); a value cannot hold a space (it splits the tokens), so name
|
|
407
|
+
parts with _ or -. < > <= >= never match a string. Digits in a string compare as text: @lod=1 matches "1", not "01".
|
|
408
|
+
A prim test reads the prim attribute, then the detail one, then the point one (a string from the prim's first point,
|
|
409
|
+
numbers averaged over its points); a point test reads the point attribute, then the detail one.
|
|
410
|
+
RECIPES: material per part {"type":"material","params":{"name":"glass","group":"@name=Glass*"}} · prims 0 to 11
|
|
411
|
+
"0-11" · all glass but the first three prims "@name=Glass* ^0-2" · pieces without names: name them first with
|
|
412
|
+
attrib_string {"format":"part_{piece:03}"} (connected pieces; piece_attrib for class / copynum), then select
|
|
413
|
+
"@name=part_00*". Help topic "materials" has the material recipes.
|
|
281
414
|
FOUR CLASSES: point, prim, vertex (polygon corners), edge (unordered point pairs, Houdini edge groups).
|
|
282
415
|
group node: "class": "point" | "prim" | "vertex" | "edge". delete: class vertex removes corners (a polygon losing
|
|
283
416
|
one is deleted, polylines shrink); class edge deletes every prim using one of the edges.
|
|
@@ -309,7 +442,9 @@ SELECTING EDGES TO BEVEL (poly_bevel group; also subdivide creases, normal hard_
|
|
|
309
442
|
"p3-7" "p0-1-2-3-0" explicit edges / closed chains of point numbers
|
|
310
443
|
"rim" an edge group made with {"type":"group","params":{"class":"edge","name":"rim","pattern":"..."}}
|
|
311
444
|
"bevel_edges" poly_bevel's output group (where the bevel meets the faces): bevel again to soften the first
|
|
312
|
-
"" every edge shared by two polygons
|
|
445
|
+
"" every edge shared by two polygons where the surface bends (flat edges inside a plane, such as
|
|
446
|
+
the splits of a boolean's cut face, are skipped). Boundary and non-manifold edges are skipped
|
|
447
|
+
with a warning.
|
|
313
448
|
mode "points" takes a point pattern instead ("0", "@P.y>0", a point group) and truncates those corners.
|
|
314
449
|
EDGE GROUPS IN NODES: poly_bevel, subdivide creases (+ creaseweight attribute), normal hard_edges. Edge groups follow points:
|
|
315
450
|
they survive transforms, fuse (remapped), merge (offset), copies, deletes (edges that no longer bound a prim
|
|
@@ -318,10 +453,45 @@ EDGE GROUPS IN NODES: poly_bevel, subdivide creases (+ creaseweight attribute),
|
|
|
318
453
|
WRANGLE: @group_x works in vertices mode too; invertexgroup(i,"g",v) inedgegroup(i,"g",pt0,pt1) setvertexgroup(0,"g",v,1)
|
|
319
454
|
setedgegroup(0,"g",pt0,pt1,1). Scripts: lib.halfEdges(geo) (edge loops/rings, one-rings, boundaries), lib.EdgeSet,
|
|
320
455
|
lib.evalEdgeGroup(geo, pattern), lib.convertSelection(geo, from, to, sel, include).
|
|
321
|
-
Groups produced by nodes: poly_extrude front/side, poly_bevel bevel/bevel_corner (+ edge group bevel_edges), extrude top/bottom/side, boolean from_a/from_b, sweep caps/sides,
|
|
456
|
+
Groups produced by nodes: poly_extrude front/side, poly_bevel bevel/bevel_corner (+ edge group bevel_edges), extrude top/bottom/side, boolean from_a/from_b, sweep caps/sides, loft caps/sides, curve fillet, remove_interior interior,
|
|
322
457
|
clip above/below/cap, fill_holes filled, lsystem leaves/J/K/M, voronoi_fracture inside, knife cut (edge + point) and
|
|
323
458
|
above/below, polysplit split (edge + point), edge_divide divided, polybridge bridge, polyfill fill, dissolve dissolved,
|
|
324
459
|
edge_collapse collapsed. Create custom ones with "group".`,
|
|
460
|
+
materials: `MATERIALS (assign by name, range or group; name the pieces first)
|
|
461
|
+
A material is a prim string "material" naming an entry of the detail table "materials" (PBR base colour, metallic,
|
|
462
|
+
roughness, emissive, alpha, maps). The material node writes both for the prims of its group ("" = all); chain one
|
|
463
|
+
node per material, the later one winning where groups overlap. Maps: base_color_map / normal_map / roughness_map file
|
|
464
|
+
paths, or images from the texture nodes through texture_to_material (help topic "textures").
|
|
465
|
+
PICK THE PRIMS (any group pattern, help topic "groups"; string tests take wildcards and are case-sensitive):
|
|
466
|
+
by name {"type":"material","params":{"name":"glass","group":"@name=Glass*","alpha":0.3}}
|
|
467
|
+
"@name=*lass*" contains · "@name=glass_* @name=Glass_*" either · "@name!=frame" all but
|
|
468
|
+
by prim range "0-11" (prims 0 to 11) · "0-100:2" every second · "6-11 ^7" without 7 · "@name=Glass* ^0-2"
|
|
469
|
+
by node groups extrude "top" / "side", poly_extrude "front", poly_bevel "bevel", boolean "from_b" (the cut
|
|
470
|
+
faces), clip "cap" … ; by attribute "@P.y>1.5", "@N.y>0.9" (facing up)
|
|
471
|
+
NAME THE PIECES FIRST when they have no names (one node each):
|
|
472
|
+
connected pieces attrib_string {"format":"part_{piece:03}"} → part_000 … (or connectivity {name_prefix:"part_"})
|
|
473
|
+
copies attrib_string {"format":"crate_{copynum}"} after copy_xform / copy_to_points
|
|
474
|
+
engine suffixes attrib_string {"format":"hull_{piece:03}-convcolonly"} names 146 collision hulls at once
|
|
475
|
+
clean up attrib_string {"find":"_LOD","replace":"_lod"} · {"find":"\\\\.\\\\d+$","regex":true} · {"case":"lower"}
|
|
476
|
+
prefix attrib_string {"format":"gun_{value}"} keeps each name behind a prefix
|
|
477
|
+
Then material {group:"@name=hull_*"} and export split_by_name write one mesh per name.
|
|
478
|
+
EXPORT: glTF writes one material per table entry; a named material decides the colour of its prims (their Cd is
|
|
479
|
+
dropped unless vertex_colors:true). Merging pieces whose materials or images share a name but differ (two package
|
|
480
|
+
outputs that both call their map "basecolor") renames the later one ("paint_2", "<material>_basecolor"), so every
|
|
481
|
+
piece keeps its own look. Inspect the table: inspect lists materials; render {shading:"pbr", textures:true}.
|
|
482
|
+
MATERIAL OUTPUTS (a material as a package output, kind "material": materials and their maps, no geometry):
|
|
483
|
+
make texture nodes → texture_to_material with NOTHING in input 0, the images in input 1 ("in": {"images": "maps"}
|
|
484
|
+
or [null, "maps"]), {material:"steel", base_color, normal, orm} → the output; or material {name, base_color,
|
|
485
|
+
roughness} with no input for a plain one.
|
|
486
|
+
Each map keeps its texture node's resolution (a 4k normal beside a 512 mask); expose one as a param (a var
|
|
487
|
+
such as "normal_resolution" read by that node) to let a use change it.
|
|
488
|
+
use {"type":"owner/materials/steel", "params":{...}} → input 1 of material {group:"@name=body*"} on the mesh: the
|
|
489
|
+
material and its maps are copied in and assigned (from names one when the source holds several; name
|
|
490
|
+
renames it). The material node's own colour and map params are not used then.
|
|
491
|
+
see renders, the viewer and the web app show it on spheres (one per material) with its base colour maps;
|
|
492
|
+
publishing records each map's size (packages lists "maps baseColor 2048, normal 4096").
|
|
493
|
+
export format "textures": one PNG per map + materials.json (each material's values and the files of its maps), for
|
|
494
|
+
engines to rebuild it; glb and usda need a mesh: export the mesh that uses it.`,
|
|
325
495
|
attributes: `ATTRIBUTES (Houdini conventions)
|
|
326
496
|
Classes: point (P and per-point data), vertex (per polygon corner: uv seams, hard normals), prim (per face/curve), detail (global).
|
|
327
497
|
Lookup precedence when reading: vertex > point > prim > detail.
|
|
@@ -359,7 +529,8 @@ Volumes are signed distance functions (negative inside) carried in geometry; nod
|
|
|
359
529
|
smooth_* with blend k) → sdf_modify (offset shell noise twist bend repeat) → sdf_to_mesh (watertight triangles, smooth N).
|
|
360
530
|
sdf_from_mesh turns closed meshes into volumes (blend meshes, offsets); remesh = voxel remesh (remesh_isotropic keeps
|
|
361
531
|
sharp edges, boundaries and attributes).
|
|
362
|
-
sdf_expr: write the distance in JS: p = [x,y,z]; return a number. Inputs via sdf(0, p), sdf(1, p)
|
|
532
|
+
sdf_expr: write the distance in JS: p = [x,y,z]; return a number. Inputs via sdf(0, p), sdf(1, p); graph vars by their
|
|
533
|
+
bare name (sdSphere(p, radius)).
|
|
363
534
|
IQ-style helpers: sdSphere(p,r) sdBox(p,[hx,hy,hz]) sdRoundBox(p,b,r) sdTorus(p,R,r) sdCapsule(p,a,b,r) sdCylinder(p,h,r)
|
|
364
535
|
sdCone(p,h,r) sdEllipsoid(p,[rx,ry,rz]) sdPlane(p,n,h) sdOctahedron(p,s) sdHexPrism(p,[r,h]) sdSegment(p,a,b,r)
|
|
365
536
|
opUnion opSubtract(a,b) opIntersect smin/opSmoothUnion(a,b,k) smax opSmoothSubtract(a,b,k) opRound(d,r) opOnion(d,t)
|
|
@@ -378,6 +549,8 @@ counts landscape vertices the same way). Layers: height (world Y), mask (0..1 se
|
|
|
378
549
|
(written by heightfield_erode), path (heightfield_path) and any user layer (rock, snow …).
|
|
379
550
|
WORKFLOW
|
|
380
551
|
heightfield {size, resolution} → heightfield_noise {fractal: "ridged", amplitude, element_size, range: "positive"}
|
|
552
|
+
(warp_amplitude, warp_element_size: a domain warp in metres bends ridges, escarpments and rivers into meanders;
|
|
553
|
+
terrace a broad warped noise for cliff bands, carve a band of a warped mask_noise around 0.5 for a river)
|
|
381
554
|
→ heightfield_erode {iterations: 60} (gullies and sediment fans; writes flow, sediment, debris, water)
|
|
382
555
|
→ heightfield_path (road along a curve, writes "path") · heightfield_project (stamp meshes/curves: plateaus, ridges)
|
|
383
556
|
→ heightfield_mask_by_feature (slope/height/curvature/direction/flow/occlusion) → heightfield_scatter → copy_to_points
|
|
@@ -386,23 +559,50 @@ WORKFLOW
|
|
|
386
559
|
{min_distance: 12} for lots that never overlap; heightfield_project {level: "mean"} levels the pads under them)
|
|
387
560
|
→ heightfield_to_mesh {color: "terrain"} for polygons (layers become point attributes), or export png16.
|
|
388
561
|
Other sources: heightfield_from_mesh (project polygons along Y), heightfield_from_image (8/16-bit PNG).
|
|
389
|
-
Layer tools: heightfield_layer (expression over layers "height * mask +
|
|
390
|
-
|
|
391
|
-
|
|
562
|
+
Layer tools: heightfield_layer (expression over layers and graph vars "height * mask + lift", or copy/rename/delete/
|
|
563
|
+
fill; a layer named like a var comes first, with a warning, so name terrain vars apart from layers: relief, not height), remap
|
|
564
|
+
(input_min..input_max → output range), blur, terrace (levels at base + n × step_height), clip, cutout, mask_noise,
|
|
565
|
+
mask_blur, mask_expand, resample (e.g. samples [505, 505]), crop (a tile or world bounds, samples kept exactly),
|
|
566
|
+
transform (translate, scale, 90° turns; the generic transform node works too), to_sdf (solid terrain for
|
|
567
|
+
caves/overhangs with sdf_combine).
|
|
568
|
+
TILES: a big map (4 × 4 km at 2 m = 2001² samples) is previewed and processed one tile at a time at full resolution:
|
|
569
|
+
heightfield {size:[4000, 4000], resolution:2} → heightfield_crop {tiles:[8, 8], tile:[3, 5], margin:40} → the chain.
|
|
570
|
+
Everything that works at world positions gives the tile the same samples as the whole map: noise (and its warp),
|
|
571
|
+
terrace levels step/range, remap's input range, layer expressions in x z, masks by height and by object distance,
|
|
572
|
+
mask_noise, clip, from_image (fit world). Cell sizes exact in binary (0.25, 0.5, 1, 2 m) make the positions
|
|
573
|
+
bit-identical. Filters read neighbours: crop with a margin of their reach (a sample for slope and direction masks;
|
|
574
|
+
blur radius, curvature and occlusion radius, mask_expand and footprint distance + falloff, cutout feather, path
|
|
575
|
+
shoulder + smooth, project radius and whole pieces for its level mean) and crop the margin off again
|
|
576
|
+
(heightfield_crop {mode:"bounds"} to the crop_core_min / crop_core_max detail attributes). Not local, so a tile only
|
|
577
|
+
matches statistically: erosion (droplets and water cross tile borders: erode the whole map, or a tile with a margin),
|
|
578
|
+
heightfield_flow / fill_sinks (catchments), heightfield_scatter (points drawn over the field; scatter on the map and
|
|
579
|
+
keep the tile's points). Tied to the field's own extent: the options terrace levels "layer", remap and
|
|
580
|
+
heightfield_to_tex auto_range, heightfield_flow normalise, transform pivot_at_center and from_image fit "field" (all
|
|
581
|
+
off by default), and layer variables i j u v, to_mesh uv and its height / terrain colours, to_sdf's bottom.
|
|
582
|
+
Exports: pass the same height_min / height_max to every tile.
|
|
392
583
|
MASKS: every mask node combines with the existing mask (mode replace/add/subtract/multiply/max/min): chain them,
|
|
393
584
|
multiply = and, max = or. Most layer nodes take mask_layer to blend their effect by a mask.
|
|
394
585
|
e.g. rocks on steep slopes off the road: mask_by_feature slope 33° → heightfield_layer {layer:"mask", expression:"mask * (1 - path)"}.
|
|
395
|
-
EROSION: droplets (
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
586
|
+
EROSION: droplets in metres, so the same params erode alike at any spacing (an 8 m preview like the 2 m map, finer
|
|
587
|
+
detail aside): rain_density droplets per m² per iteration, max_distance metres a droplet travels, erosion_radius the
|
|
588
|
+
brush radius in metres (about a gully's half-width). erosion_rate, deposition_rate, evaporation, inertia, gravity and
|
|
589
|
+
thermal_rate act per droplet step of erosion_radius / 3 and sediment_capacity is a volume in those steps cubed; the
|
|
590
|
+
node converts them to the field's cells (cells of erosion_radius / 3 take them as given: the defaults at 0.1 m).
|
|
591
|
+
Scale: for a terrain λ times larger multiply erosion_radius and max_distance by λ and divide rain_density by λ², the
|
|
592
|
+
rest unchanged (a 4 km map at 2 m: erosion_radius 6, max_distance 60, rain_density 0.005). Thermal:
|
|
593
|
+
thermal_talus_angle, thermal_rate; hardness_layer (1 = rock), freeze_layer (1 = untouched); boundary closed conserves
|
|
594
|
+
material. Deterministic per seed. Cost ≈ rain_density × area × iterations × max_distance / cell droplet steps
|
|
595
|
+
(512² × 100 iterations at the defaults ≈ 2–3 s). Stronger: more iterations, rain_density or sediment_capacity. Not
|
|
596
|
+
local: a tile erodes like the same area of the map only statistically (see TILES).
|
|
399
597
|
method droplet / backend js is the unchanged default. backend kernel loads WASM; auto uses an already loaded
|
|
400
598
|
kernel or falls back to js. method pipe and stream_power require the kernel. Pipe uses virtual pipes, CFL-limited
|
|
401
|
-
time_step (0 = automatic
|
|
599
|
+
time_step (0 = automatic, shorter on finer cells; a time_step below the limit of every spacing simulates the same
|
|
600
|
+
time per iteration), rain_amount in metres/second, optional rain_layer multiplier, evaporation and thermal
|
|
402
601
|
talus relaxation. stream_power adds stream_power_k * drainage^stream_power_m * slope^stream_power_n incision.
|
|
403
602
|
Kernel erosion also writes wear (cumulative eroded depth); pipe water is remaining water depth in metres.
|
|
404
|
-
heightfield_flow {method:"dinf",
|
|
405
|
-
|
|
603
|
+
heightfield_flow {method:"dinf", log_scale:true} writes drainage and direction without erosion: drainage is
|
|
604
|
+
ln(1 + contributing area in m²) (raw area without log_scale; normalise:true divides by the field's largest value,
|
|
605
|
+
which depends on its extent); direction E/SE/S/SW/W/NW/N/NE = 0..7, sink = 255. D8 routes one receiver,
|
|
406
606
|
D-infinity splits across two downhill receivers; local pits retain flow unless fill_sinks:true routes over a
|
|
407
607
|
virtually filled surface (height stays unchanged). stream_power accepts the same opt-in fill_sinks flag.
|
|
408
608
|
See examples/erosion_models.json for all four erosion methods on the same ridged terrain.
|
|
@@ -415,8 +615,11 @@ DRAINAGE: heightfield_fill_sinks uses deterministic priority-flood to raise clos
|
|
|
415
615
|
Protected outlets and retained lakes are exceptions to border drainage. Pipe/stream_power erosion initializes from lake and writes simulated water
|
|
416
616
|
depth back to lake within that original lake footprint. Droplet water remains its legacy normalised resting mask.
|
|
417
617
|
See examples/drainage.json: unfilled massif beside shallow fills, blue retained lakes and coloured accumulation.
|
|
418
|
-
RENDER / INSPECT: render draws heightfields as a shaded grid
|
|
419
|
-
|
|
618
|
+
RENDER / INSPECT: render draws heightfields as a shaded grid with the mask in red; heightfield_layer:"flow" draws
|
|
619
|
+
another layer in red instead ("none": none; the viewer's layer picker does the same), color_by any layer name maps
|
|
620
|
+
it to colours. It draws at most 256 quads per side, so a 513 × 513 field shows at 257 × 257 (the footer and a note
|
|
621
|
+
say so); heightfield_res: "full" (CLI --heightfield-res full) draws every sample. inspect and every cook summary
|
|
622
|
+
list the grid and each layer's min/max/mean.
|
|
420
623
|
UNREAL LANDSCAPE: export {path: "exports/terrain.png"} (png16) or ".r16" writes the heightmap plus terrain.json with
|
|
421
624
|
height_min / height_max and the import settings. Pixel column = X, row = Z (row 0 at min Z); Unreal X = X,
|
|
422
625
|
Unreal Y = Z, Unreal Z = Y, centimetres.
|
|
@@ -436,33 +639,89 @@ An image is a volume carried in the geometry (like a heightfield): a 2D grid of
|
|
|
436
639
|
Values are written to PNG as value × 255 with no transfer curve: colours hold the numbers colour params give
|
|
437
640
|
("#a5462e" → 0.65, 0.27, 0.18), so files match the colours you typed; data maps (heights, masks, roughness, normals)
|
|
438
641
|
are linear. Images merge, clone and cache like geometry; materials reference them as "image:<name>".
|
|
642
|
+
NAMES: every image is named after the node that made or last filtered it ("rust_mask" for the node rust_mask), unless
|
|
643
|
+
that node's name param says otherwise, so default names in a graph never collide and texture_to_material slots name
|
|
644
|
+
nodes: {base_color:"paint", normal:"detail_normal"}. A node whose input holds several images never picks one: it
|
|
645
|
+
stops and lists them; set image (foreground_image, mask_image, detail_image … for the other inputs) to the one to
|
|
646
|
+
use, or isolate it with tex_output {image, keep_only:true}. To edit one image of a stack in place (an atlas, a
|
|
647
|
+
material's maps), give the filter name = that image's name. merge (and every node that merges) keeps an image or
|
|
648
|
+
material several inputs carry (same name and content, e.g. textured LOD branches) once; when two inputs use a name
|
|
649
|
+
for different images or materials (two package outputs whose maps are all "basecolor"), the later one is renamed
|
|
650
|
+
("<material>_basecolor", "paint_2") with its material table and prim "material", so each piece keeps its own maps
|
|
651
|
+
in renders, the viewer and every export.
|
|
439
652
|
GENERATORS (no input, resolution [w, h], name): tex_noise (perlin/simplex/value/worley × fbm/ridged/turbulence,
|
|
440
653
|
tileable default: whole cells per octave; simplex tiles on a 4D torus) · tex_pattern (bricks, tiles, checker, stripes,
|
|
441
|
-
hex, dots
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
654
|
+
hex, dots: 1 on the cells, 0 in the gaps; grid is a line mask, 1 on the lines, 0 in the cells: for grooved cells use
|
|
655
|
+
tiles; gap = mortar or line width, bevel, variation; layer "id" = random per cell) · tex_cells (Voronoi distance /
|
|
656
|
+
edges / id / crackle / crystal: a tilted flat facet per cell) · tex_gradient · tex_constant (one grey value, or an
|
|
657
|
+
RGBA colour with channels:"rgba"; input 0 = an image to take the size from) · tex_shape (disc, square, polygon, star,
|
|
658
|
+
ring; falloff; tile) · tex_sdf_shape (the signed distance in metres to a disc, box, polygon, star, capsule or cross;
|
|
659
|
+
corner rounding; tile; see SHAPES below) · tex_grunge (dirt / leaks / spots with a coverage fraction and edge
|
|
660
|
+
contrast) · tex_splatter (blobs) · tex_scratches (strokes) · tex_text.
|
|
661
|
+
FILES: image_file {path:"inputs/brick.png"} loads a PNG (8/16-bit, grey or colour) as an image named after the node
|
|
662
|
+
(name sets another; the file node reads .png the same way, named after the file); layers auto/grey/rgba; srgb
|
|
663
|
+
(default on) keeps the stored values, which suits colour and data maps alike (off only for linear-light colour).
|
|
664
|
+
Input 0 = a geometry to add it to, so image_file nodes chain. People drop their own textures and masks into inputs/.
|
|
665
|
+
FILTERS (input 0 = an image; image/layer pick what to process, the result replaces that layer and takes the filter's
|
|
666
|
+
name; every other image and the mesh pass through): tex_blend (normal, add, subtract, multiply, screen, overlay, min,
|
|
667
|
+
max, difference, divide; opacity; input 2 = mask) · tex_levels · tex_curves (ramp) · tex_blur (gaussian/box, tileable
|
|
668
|
+
keeps the mean) · tex_directional_blur (motion blur, length in metres: brushed metal from noise; symmetric off = a
|
|
669
|
+
trail) · tex_slope_blur (smear input 0 along the slopes of input 1 for distance metres: blur, min = eroded ragged
|
|
670
|
+
edges, max = grown) · tex_warp (directional/slope/vector by input 1; nonuniform adds an angle map on input 2;
|
|
671
|
+
multi averages several directions) · tex_transform (offset, rotate, scale, tile) · tex_make_tile (blend with
|
|
672
|
+
half-shifted copies so a photo or non-tileable noise tiles; noise = a wandering patch edge) · tex_edge_detect
|
|
673
|
+
(sobel, or outline / inner / outer: a line line_width metres wide along a mask's outline, roundness 1 = a ridge) ·
|
|
674
|
+
tex_invert · tex_threshold · tex_clamp · tex_quantize (levels; round or floor = posterize) · tex_auto_levels (own
|
|
675
|
+
range to 0..1; clip ignores outliers; stats range_min/max) · tex_histogram_range (squeeze around position) ·
|
|
676
|
+
tex_histogram_select (a band position ± range/2, contrast = edge hardness) · tex_histogram_scan (THE mask maker:
|
|
677
|
+
coverage 0.3 = the brightest 30 % turn white, whatever the input's range; or position = a value cut; contrast =
|
|
678
|
+
hardness; stat coverage) ·
|
|
679
|
+
tex_normal_from_height (physical: depth = metres a value of 1 stands, size = metres the image spans, so the slope is
|
|
680
|
+
real and the same at any resolution; paint grain 0.0003, hammered metal 0.002, bricks 0.015; opengl/directx) ·
|
|
681
|
+
tex_normal_blend (detail normal map over a base, e.g. micro grain over a bake: mode rnm (default, reoriented: both
|
|
682
|
+
reliefs keep their depth) | udn | linear; strength scales the detail; input 2 = mask; never tex_blend overlay on
|
|
683
|
+
normals) · tex_normal_normalize (unit vectors again after blur/resize/blend) · tex_normal_invert (green = OpenGL ↔
|
|
684
|
+
DirectX; red; both) · tex_height_from_normal (integrates a normal map back to a height: same depth and size as
|
|
685
|
+
tex_normal_from_height round-trips; FFT when tileable; stat relief in metres) · tex_curvature (from a normal map:
|
|
686
|
+
0.5 flat, radius = the bend radius in metres that reads full white/black; blur metres for broader curvature;
|
|
687
|
+
layers convex/concave, as bake_curvature) · tex_ao (ground-truth AO of a height in metres: depth, size, radius;
|
|
688
|
+
a plane stays white; same result at any resolution; prefer it to tex_height_to_ao, whose units are image widths)
|
|
689
|
+
· tex_colorize (gradient map) · tex_channel (pack inputs 0..3 into RGBA, e.g. ORM; or extract) · tex_tile_sampler
|
|
690
|
+
(stamp input 0 on a grid with jitter/rotation/scale; mask input 1 = keep probability; inputs 2/3/4 = scale,
|
|
691
|
+
rotation (0..1 = 360°) and intensity maps read at each instance; stamps:"random" picks among every image of input
|
|
692
|
+
0; output id / color = a random value / colour per instance with layer mask; tileable off cuts at the borders) ·
|
|
693
|
+
tex_output (rename, or copy a layer out as a new image: brick_ids = tex_output {layer:"id"}; keep_only drops the
|
|
694
|
+
rest).
|
|
457
695
|
To process a layer as its own image, copy it out first (tex_output layer:"id") and filter that.
|
|
458
696
|
Inputs of different sizes are resized to the first input (bilinear up, area average down).
|
|
697
|
+
UNITS: nodes with a size param measure in metres like tex_normal_from_height: size = metres the image width covers
|
|
698
|
+
(1 by default, so metres = image widths); their widths, radii and distances are metres, so the same graph gives the
|
|
699
|
+
same maps at 512 and 4096. Give every node of a material the same size (the uv tile's span on the model). Filters
|
|
700
|
+
with tileable (default on) read across the borders exactly like anywhere else.
|
|
701
|
+
SHAPES AND REGIONS (metres): an SDF image holds the signed distance in metres in C (negative inside). tex_sdf_shape
|
|
702
|
+
makes one; tex_sdf_from_mask measures one from any mask (threshold; sub-pixel accurate) · tex_sdf_op (offset grows,
|
|
703
|
+
round / fillet round convex / concave corners, stroke = a band on the outline, invert, redistance) ·
|
|
704
|
+
tex_sdf_boolean (union, subtract, intersect, xor with smoothness metres; morph) · tex_sdf_to_mask (fill, outline,
|
|
705
|
+
bevel with profile linear/smooth/round/ramp, distance = the 0.5-at-the-edge encoding). From masks directly:
|
|
706
|
+
tex_bevel (distance metres, > 0 inward, < 0 outward; profile) · tex_distance (grow a mask: gradient falloff or a hard
|
|
707
|
+
grown edge; with input 1 its values bleed out from the mask, e.g. per-tile colours into the gaps) ·
|
|
708
|
+
tex_flood_fill (the separate tiles of a mask: random grey, random colour, a gradient across each tile (angle,
|
|
709
|
+
angle_random), bbox_size in metres, position; layer id; stat tiles; random values stay with a tile at any resolution).
|
|
710
|
+
Panels: plates = tex_sdf_shape {shape:"box", extent:[0.46,0.46], corner:0.025, tile:[2,2]} → tex_sdf_to_mask
|
|
711
|
+
{mode:"bevel", width:0.012, profile:"round"} → tex_normal_from_height {depth:0.006}; rivets near the edges =
|
|
712
|
+
tex_sdf_boolean(rivet grid, tex_sdf_op(tex_sdf_op(plates, offset -0.035), stroke 0.07)) {mode:"intersect"}.
|
|
459
713
|
BAKES (input 0 = mesh with non-overlapping uv in 0..1: uv_unwrap; input 1 = optional high-res mesh): bake_ao
|
|
460
714
|
(samples, max_distance; white = open), bake_curvature (edges' dihedral angles within radius: 0.5 flat, bright convex,
|
|
461
|
-
dark concave; layers convex/concave
|
|
715
|
+
dark concave; layers convex/concave; creases where separate parts cut into each other count as concave too),
|
|
716
|
+
bake_thickness, bake_position (bbox/uniform/world), bake_world_normal,
|
|
462
717
|
bake_normal (tangent space from the high mesh along averaged-normal cage rays; cage distance), bake_height (high above
|
|
463
718
|
low; layer distance in metres), bake_island_id (colour per uv island, layer id, stat islands), bake_mask
|
|
464
719
|
(mask_group or a numeric attribute), bake_vertex_color (Cd + Alpha). Shared: resolution (default 1024), supersample
|
|
465
720
|
(1..4), padding (texels of edge dilation, default 4), group (prims to bake), keep_mesh (output the mesh too).
|
|
721
|
+
With a high-res mesh: cage (search distance), cage_attrib (default "cage": a float prim/point attribute of the mesh
|
|
722
|
+
that sets the cage per part, e.g. attrib_create {name:"cage", class:"prim", group:"@name=grip", value:0.03}),
|
|
723
|
+
match_name (each named piece projects only onto the high prims of its name: parts sharing one atlas), and layer
|
|
724
|
+
"missed" (1 where no high surface was found within the cage; stat missed) to see where to raise the cage.
|
|
466
725
|
Rays and curvature run on the worker pool. The output is only the image unless keep_mesh.
|
|
467
726
|
MATERIALS: texture_to_material {material, base_color, normal, roughness, metallic, occlusion, orm} on input 0 (mesh
|
|
468
727
|
with uv) + input 1 (merged images): writes "image:<name>" slots into the material table, assigns the material (all
|
|
@@ -486,11 +745,18 @@ EXPORT: glb/gltf embed the image textures as PNG (ORM = occlusionTexture + metal
|
|
|
486
745
|
<name>_textures/<image>.png next to the file (ORM through orm_map r/g/b); format "textures" writes every image as
|
|
487
746
|
<dir>/<image>.png (layers: ["id"] or ["*"] for extra layers); json keeps images losslessly; geo/obj/… skip them.
|
|
488
747
|
RECIPE (brick wall + worn crate: examples/textures.json):
|
|
489
|
-
bricks = tex_pattern {pattern:"bricks", count:[4, 12], bevel:0.15} · ids = tex_output(bricks) {
|
|
748
|
+
bricks = tex_pattern {pattern:"bricks", count:[4, 12], bevel:0.15} · ids = tex_output(bricks) {layer:"id"}
|
|
490
749
|
color = tex_blend(tex_colorize(grain mortar greys), tex_colorize(ids, brick reds), bricks as mask)
|
|
491
|
-
normal = tex_normal_from_height(bricks) · crate: uv_unwrap → bake_ao + bake_curvature →
|
|
492
|
-
→ tex_blend subtract noise → tex_histogram_scan = edge wear →
|
|
493
|
-
= ORM → texture_to_material {base_color, orm}
|
|
750
|
+
normal = tex_normal_from_height(bricks) {depth:0.035, size:1.6} · crate: uv_unwrap → bake_ao + bake_curvature →
|
|
751
|
+
tex_output layer "convex" → tex_blend subtract noise → tex_histogram_scan {coverage} = edge wear →
|
|
752
|
+
tex_blend(wood, paint, wear) → tex_channel(ao, rough) = ORM → texture_to_material {base_color, orm}.
|
|
753
|
+
Detail on a bake: grain = tex_noise {scale:60} → grain_n = tex_normal_from_height {depth:0.0003, size:<uv span in m>}
|
|
754
|
+
→ tex_normal_blend(baked_normal, grain_n) {mode:"rnm"}.
|
|
755
|
+
RECIPE (worn painted metal from texture nodes only: examples/texture_lab.json): SDF plates and rivets → height →
|
|
756
|
+
normal, tex_ao · edge wear = tex_curvature(normal) layer convex × tex_grunge chips → tex_slope_blur {mode:"max"}
|
|
757
|
+
(ragged) → tex_histogram_scan {coverage:0.07} · steel = tex_directional_blur(fine noise) under the paint · per-plate
|
|
758
|
+
paint = tex_flood_fill(plate mask) → tex_histogram_range → tex_colorize · rust runs = tex_directional_blur(rivet
|
|
759
|
+
mask) {angle:-90, symmetric:false} × tex_grunge {style:"leaks"} · ORM = tex_channel(ao, roughness, metallic).`,
|
|
494
760
|
loops: `FOREACH LOOPS
|
|
495
761
|
{"type": "foreach", "in": ["lots"], "params": {"mode": "prims", "body": {
|
|
496
762
|
"nodes": {
|
|
@@ -500,7 +766,8 @@ RECIPE (brick wall + worn crate: examples/textures.json):
|
|
|
500
766
|
"output": "bldg"}}}
|
|
501
767
|
Modes: pieces (by piece_attrib or connectivity) · prims · points · count (N times; feedback:true chains results).
|
|
502
768
|
Body input index 0 = current element/piece (or the previous result with feedback); 1 = whole input; 2 = foreach input 2.
|
|
503
|
-
Vars in the body: iteration, numiterations, value, attr (the element's
|
|
769
|
+
Vars in the body, by their bare name in "=expr" params and code: iteration, numiterations, value, attr (the element's
|
|
770
|
+
attributes, e.g. "=attr.height"), parent vars.
|
|
504
771
|
Results are merged (or the last one with feedback). Identical iterations are cached.
|
|
505
772
|
For feedback over animation frames (growth, accumulation) use solver instead (help topic "time").`,
|
|
506
773
|
instancing: `PACKED PRIMITIVES (instances)
|
|
@@ -525,12 +792,18 @@ Every other node (boolean, subdivide, scatter, normal, measure, uv_*, …) gets
|
|
|
525
792
|
unpack {group, transfer_attributes:"name Cd material piece", limit, piece_attrib, recursive}.
|
|
526
793
|
Anchor attributes are copied onto the unpacked geometry only where the source has none (Cd: in any class), so a
|
|
527
794
|
source's own colours win and an anchor Cd tints colourless sources.
|
|
795
|
+
Read them: primintrinsic(0, "bounds", pr) in a wrangle (or primintrinsic('n', pr, 'bounds') in an expression) is the
|
|
796
|
+
instance's world box [xmin, xmax, ymin, ymax, zmin, zmax], computed when read; "packedbounds" is the source's own box;
|
|
797
|
+
"transform" is the 3×3 rotation·scale and "packedfulltransform" the 4×4 with the anchor position as its last row, both
|
|
798
|
+
row-major for row vectors (p' = p · M + t); "typename" is "PackedGeometry". Sit every instance on the ground:
|
|
799
|
+
wrangle {run_over:"prims", code:"const b = primintrinsic(0, 'bounds', @primnum), pt = primpoints(0, @primnum)[0];
|
|
800
|
+
const p = point(0, 'P', pt); p[1] -= b[2]; setpointattrib(0, 'P', pt, p);"}
|
|
528
801
|
See them: render draws instances (an evenly spread subset above 600k triangles, with a note "rendering 9.5k of 30k
|
|
529
802
|
instances"); inspect/build summaries say "packed: N instances of K sources (M triangles expanded)".
|
|
530
803
|
Export: glb/gltf → EXT_mesh_gpu_instancing (one mesh + node per source, named like the source's prim "name",
|
|
531
|
-
TRANSLATION/ROTATION/SCALE per instance, anchor attributes as _NAME instance accessors
|
|
532
|
-
approximated with a warning); usda → one PointInstancer (prototypes = sources, protoIndices,
|
|
533
|
-
scales, ids, velocities, primvars per instance); geo → Houdini PackedGeometry prims sharing embedded sources;
|
|
804
|
+
TRANSLATION/ROTATION/SCALE per instance, with custom_attribs:true the anchor attributes as _NAME instance accessors
|
|
805
|
+
(Cd → _COLOR); shear is approximated with a warning); usda → one PointInstancer (prototypes = sources, protoIndices,
|
|
806
|
+
positions, orientations, scales, ids, velocities, with custom_attribs:true primvars per instance); geo → Houdini PackedGeometry prims sharing embedded sources;
|
|
534
807
|
csv / points.json → one row per instance (instance stream: Position/Rotation/Scale or P/orient/scale, Mesh column)
|
|
535
808
|
+ <name>.meshes.json + one GLB per source; json keeps them losslessly; obj/ply/stl expand them (warned).
|
|
536
809
|
instancing:"expand" (export option) always writes real geometry (instances:"expand" for csv/points.json only).
|
|
@@ -618,7 +891,7 @@ Example: examples/forest.json (30k candidates → pruned packed forest) and exam
|
|
|
618
891
|
straight_skeleton {mode skeleton|offset|roof, distance, pitch, pitch_attrib, height_cap, group}
|
|
619
892
|
Closed XZ polygons with contained holes; skeleton outputs lines with prim kind (0 skeleton, 1 contour).
|
|
620
893
|
offset uses positive distance inward and negative outward; roof uses degrees and prim edge provenance.
|
|
621
|
-
WASM loads lazily through the host. roof_skeleton is the footprint
|
|
894
|
+
WASM loads lazily through the host. topotopo/architecture/roof_skeleton is the roof on a footprint input, with overhang and thickness.
|
|
622
895
|
Polylines are open prims of points; closed curves are polygons (faces). Spline prims are Houdini's Bezier/NURBS curves:
|
|
623
896
|
the prim's points are its CONTROL POINTS (CVs) and the curve is evaluated exactly wherever it is needed.
|
|
624
897
|
bezier {points, order, closed, weights} segments of order CVs sharing their ends: 7 CVs of order 4 = 2 cubic segments
|
|
@@ -639,11 +912,20 @@ Nodes:
|
|
|
639
912
|
nurbs is exact; polyline → spline uses the points as CVs, or passes through them with fit:true.
|
|
640
913
|
spline_fit {tolerance | cv_count, smoothing, order, output nurbs|polyline} least-squares NURBS through ordered points:
|
|
641
914
|
denoise GPS-like / jittered polylines, compress dense curves (prim fit_error = largest deviation).
|
|
915
|
+
curve {points, corner_radius, corner_segments} corner_radius rounds corners as you draw: one radius, or one per point
|
|
916
|
+
(0 = sharp), e.g. [0, 0.004, 0.004, 0]; a point that is not [x, y, z] (NaN, null) is an error naming it.
|
|
642
917
|
fillet_curve {radius, type round|chamfer|bezier, segments, group (corner points), angle_min, clamp} rounds polyline
|
|
643
918
|
corners in 3D (new points in point group "fillet").
|
|
644
919
|
offset_curve_3d {distance, lift, frame rmf|plane, up, corner mitre|round|bevel, both} parallel curves in 3D:
|
|
645
920
|
rails, kerbs, lanes (both:true = two rails, prim side ±1; frame "plane" keeps them level). offset_curve is the
|
|
646
|
-
2D (Clipper) grow/shrink of CLOSED flat shapes;
|
|
921
|
+
2D (Clipper) grow/shrink of CLOSED flat shapes; on a flat OPEN path it makes a strap outline (width 2 × distance,
|
|
922
|
+
cap butt|round|square): offset_curve → extrude for a flat band; sweep {shape:"rect", size:[w, h]} for one that
|
|
923
|
+
follows a 3D path.
|
|
924
|
+
loft {sections, resample auto|length|none, caps} skins through the curves in prim order, or through copies of ONE
|
|
925
|
+
profile placed by sections [{offset, scale, rotate}, ...]; sections with the same point count join point to point
|
|
926
|
+
(insets keep their corners), closed sections are turned to the first one's winding; closed results face outward.
|
|
927
|
+
revolve {axis, origin, angle} lathe about any axis line; draw the profile in a plane that holds the axis.
|
|
928
|
+
shape2d capsule | slot a stadium (rect with half-circle ends) in size; extrude for a slot cutter.
|
|
647
929
|
project_curve (curves, surface | heightfield) {mode direction|closest, direction, spacing, lift, misses} drapes a
|
|
648
930
|
curve onto terrain; spacing resamples first so it follows the bumps; writes point hit and N (smooth normals).
|
|
649
931
|
curve_attribs {curveu, arclength, tangent (tangentu), frame (N = tangent, up), curvature, segment, ramp_attrib + ramp}
|
|
@@ -685,50 +967,326 @@ Any graph with vars can be saved as a node type: assets {action:"save", name:"ro
|
|
|
685
967
|
The graph's vars become parameters (add "params": {"var": {"desc": "...", "min": 0, "max": 1}} for docs/ranges).
|
|
686
968
|
Inputs: put {"type":"input","params":{"index":0,"label":"surface"}} nodes in the graph.
|
|
687
969
|
Then use it like any node: {"type": "rock_cluster", "in": ["terrain"], "params": {"count": 50}}.
|
|
688
|
-
Assets are stored as JSON in
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
970
|
+
Assets are stored as JSON in the package's assets/ folder and load on startup; list, get and delete work on them.
|
|
971
|
+
Ready-made generators are TopoTopo's own packages, used by full name (help topic "packages"): walls, houses, roofs,
|
|
972
|
+
stairs, rocks, trees, props and roads such as {"type": "topotopo/architecture/stairs", "params": {"steps": 12}}. To
|
|
973
|
+
change one: assets {action:"fork", name:"topotopo/architecture/stairs", to:"my_stairs"} copies the output's graph into
|
|
974
|
+
the package's assets as my_stairs (an output whose graph names the package's other outputs adds the built-in package to the package);
|
|
975
|
+
assets {action:"get", name:"my_stairs"} shows it, assets {action:"save", name:"my_stairs", graph} writes it back, and
|
|
976
|
+
{"type": "my_stairs"} uses it.`,
|
|
977
|
+
packages: `PACKAGES (a package uses another package's published outputs by name; help topic "workspace": the three words)
|
|
978
|
+
A published package has a full name and versions. Its author names it once in its manifest, <id>.topo, "name":
|
|
979
|
+
"owner/name" (lower-case letters, digits, - and _; the owner "topotopo" is reserved for TopoTopo's own), and publishes:
|
|
980
|
+
workspace {action:"publish", dry_run:true} CLI: topotopo publish [folder] --dry-run
|
|
981
|
+
workspace {action:"publish", note:"taller pines"} CLI: topotopo publish [folder] --note "taller pines" [--big]
|
|
982
|
+
Publishing is permanent: run the dry run, show it to the person, and publish when they say so.
|
|
983
|
+
A graph uses an output of a package as a node type; "owner/name" alone is the package's default output:
|
|
984
|
+
{"type": "studio/trees/pine", "in": ["ground"], "params": {"height": 6}} {"type": "studio/trees"}
|
|
985
|
+
Its params are the vars of the output's graph that its node reads, with their "params" declarations (ranges clamp,
|
|
986
|
+
options are checked), and its inputs that graph's input nodes. help {nodes:["studio/trees/pine"]} gives them with the
|
|
987
|
+
version and its note, also for an output search found in a place the package looks in but does not use yet (read there,
|
|
988
|
+
nothing copied); catalog {category:"package"} lists the outputs of the packages in use and TopoTopo's own.
|
|
989
|
+
|
|
990
|
+
WHAT A PACKAGE PUBLISHES: every named output ("outputs") of every graph in graphs/ but those marked "publish": false
|
|
991
|
+
(viewer-only previews), and the default output: the output node ("output") of the graph the manifest shows ("graph"),
|
|
992
|
+
which must be set. Output names follow the same rule as the package name and are unique in the package. A graph that
|
|
993
|
+
holds several outputs gives each the vars its node reads: publishing warns about an output that does not read some of
|
|
994
|
+
its graph's vars (they are not its params; give it a graph of its own for params of its own).
|
|
995
|
+
|
|
996
|
+
WHAT AN OUTPUT IS: its kind, its tags and its description, which search, the catalog and help show.
|
|
997
|
+
"outputs": {"pine": {"node": "out", "label": "Pine", "kind": "mesh", "tags": ["conifer", "low-poly"], "description": "…"}}
|
|
998
|
+
- kind: mesh, instances (packed), points, curves, terrain (heightfields), textures (images alone), material (materials
|
|
999
|
+
and their maps, no geometry: help topic "materials"), volume, or scene (several of these: a street with its lamp
|
|
1000
|
+
posts as instances). A mesh that carries scene_null sockets is a mesh: the
|
|
1001
|
+
sockets are part of a mesh asset, and scene means several kinds of geometry together. Publishing cooks every output
|
|
1002
|
+
and records the kind it cooks to. "kind" pins it: publishing blocks when the output cooks to another, and build, edit
|
|
1003
|
+
and the viewer warn before that. A kind not on the list is an error wherever the graph is read.
|
|
1004
|
+
- tags: free words search finds the output by: lower-case letters, digits and -, starting with a letter or digit, at
|
|
1005
|
+
most 64 characters, at most 16 per output, each once ("low-poly", "street-furniture"); a malformed one is an error. A
|
|
1006
|
+
package's own "tags" in its manifest stay the web app's; search matches both.
|
|
1007
|
+
- description: the output's "description", else its graph's "description" (a built-in package's outputs, one graph each, need no
|
|
1008
|
+
more). The default output carries the tags and description of the named output it is, if any.
|
|
1009
|
+
Every listing says an output's kind and tags the same way: mesh [conifer, low-poly].
|
|
1010
|
+
|
|
1011
|
+
OUTPUTS OF THE SAME PACKAGE: a package's graphs and assets name its own outputs by full name, as they name another package's: a built-in package
|
|
1012
|
+
whose pieces build on each other, a house of the package's walls ({"type": "studio/house/wall"} in the house's graph). They
|
|
1013
|
+
resolve to the same version, with no entry in "uses"; in the package that publishes versions, to its graphs as they are now
|
|
1014
|
+
(its working folder), and in a followed working folder to that folder. Outputs that name each other in a loop (a names
|
|
1015
|
+
b and b names a, or a names itself) do not resolve, and publishing refuses them.
|
|
1016
|
+
|
|
1017
|
+
VERSIONS: big.small from 1.0, each a folder versions/<version>/ in the package that is never written over: <id>.topo,
|
|
1018
|
+
graphs/, assets/, inputs/, the copies the package uses (packages/) and version.json (the note, the time, a hash of every
|
|
1019
|
+
other file, each output's graph, node, kind, tags, description, params and inputs). The hash reads text files with LF
|
|
1020
|
+
line ends, so a checkout that turns them into CRLF changes nothing; binary files count as they are. exports/,
|
|
1021
|
+
attachments/ and other files are not part of a version. The number comes from the version before: big (2.0) when
|
|
1022
|
+
something a user relies on goes away or means something else (an output removed, renamed or marked "publish": false;
|
|
1023
|
+
an output of another kind; a param removed, renamed or of another type; a narrower range; a removed option; an input
|
|
1024
|
+
removed or moved), small (1.4) for everything else (new outputs, params, options and inputs, wider ranges, other
|
|
1025
|
+
defaults, labels, tags, descriptions, a kind pinned or unpinned that stays the same, any change to the geometry).
|
|
1026
|
+
big:true (--big) marks a version big when its meaning changed in a way the tools cannot see (a model that now faces
|
|
1027
|
+
another way).
|
|
1028
|
+
PUBLISHING goes in steps and stops at the first that blocks, so each problem is said once, at its cause, and a version
|
|
1029
|
+
number only for what would publish: (1) what the package declares: its name, the note, its outputs (names, kinds,
|
|
1030
|
+
tags, descriptions, clashes, the default output), loops, files it cannot read, its copies (none missing or edited by
|
|
1031
|
+
hand), a package this session follows; (2) every output cooked as a package that uses this one cooks it, in the
|
|
1032
|
+
package's own scope: one that does not cook, cooks to nothing or to another kind than pinned blocks; a warning is said
|
|
1033
|
+
once, under the output it belongs to (not again under a line-up that cooks it); (3) nothing changed since the last
|
|
1034
|
+
version blocks; (4) the number, the changes and the warnings: an output without tags or a description, one that does
|
|
1035
|
+
not read some of its graph's vars, an output of another kind than before, URLs and files outside the package that its
|
|
1036
|
+
nodes read (a version holds no copy of them) and a version above 50 MB. A DRY RUN, workspace {action:"publish",
|
|
1037
|
+
dry_run:true, note?, big?} (CLI: topotopo publish --dry-run), goes through every step and writes nothing.
|
|
1038
|
+
|
|
1039
|
+
USING PACKAGES: the manifest's "uses" holds the version the package uses of each ({"studio/trees": "1.3"}), and packages/
|
|
1040
|
+
its own copy of each, and of the packages those use, flat: packages/<owner>/<name>/<version>/, each version once, with
|
|
1041
|
+
packages/lock.json (each copy's hash, where it came from, its own uses). The copies are committed with the package,
|
|
1042
|
+
so it cooks anywhere without the libraries, and what it uses never changes by itself; a copy edited by hand is warned
|
|
1043
|
+
about, and the warning goes once the copy is restored. init writes a .gitattributes that keeps versions/ and packages/
|
|
1044
|
+
byte for byte, and a .gitignore for packages/.cache.json (the hashes of the copies' files, kept between runs) and
|
|
1045
|
+
packages/.lock (held while a command, the viewer or an MCP server writes the manifest and the lock).
|
|
1046
|
+
IN A WORKSPACE (a folder tree with topotopo-workspace.json; CLI: topotopo workspace init): its packages share one copy
|
|
1047
|
+
of each package version, in topotopo-packages/ beside that file, whose "uses" names the version the whole workspace uses.
|
|
1048
|
+
A first use in any of its packages adds the package there; Update compares every place every package uses it and
|
|
1049
|
+
changes them all; remove is refused while a package still names it. A package that publishes versions keeps its own "uses"
|
|
1050
|
+
and copies, which are published with it. workspace init moves the copies of the packages inside that kept their own
|
|
1051
|
+
(two packages that used different versions get the newer, said).
|
|
1052
|
+
WHERE A PACKAGE LOOKS: in a workspace, in the workspace itself (every folder with a .topo file), then in the shared
|
|
1053
|
+
libraries the workspace's file lists ("libraries": ["props", "../shared/materials"]: registered names, or paths written
|
|
1054
|
+
from the workspace to folders outside it), in order; outside a workspace, in the library the package is in (read from
|
|
1055
|
+
its own checkout, so its siblings come from the same worktree), then in every other registered library. Then, always,
|
|
1056
|
+
in TopoTopo's built-in library, "topotopo" (no other library takes that name), which alone holds the packages named
|
|
1057
|
+
"topotopo/…": TopoTopo's own packages, which a package uses, copies and locks like any other; a newer version a
|
|
1058
|
+
TopoTopo release brings shows as an update. A name comes from the first place that has it, and the same name in a later
|
|
1059
|
+
place is not used (said); two folders of one place publishing one name leave it out, naming both. An entry of
|
|
1060
|
+
"libraries" that does not work (no such folder, a name not registered, a package's folder, a folder inside the
|
|
1061
|
+
workspace) is reported, and the others still count. The tools never list a library by themselves: workspace
|
|
1062
|
+
{action:"libraries", add} (CLI: topotopo workspace library add|remove) does it when the person names one. A package
|
|
1063
|
+
manifest lists no libraries ("libraries" there is refused, saying where each entry goes). Only a package's graphs use packages: in a folder that
|
|
1064
|
+
is none, naming one fails and says so, and workspace {action:"init"} (CLI: topotopo init) makes it a package, when the
|
|
1065
|
+
person says so.
|
|
1066
|
+
- First use: a build or edit whose graph names a package this package does not use yet adds its newest version once the
|
|
1067
|
+
graph validates (a graph they reject adds nothing and writes nothing), and the response says so. A dry run (build
|
|
1068
|
+
{dry_run:true}) checks the graph against that version, read where its place holds it, copies and writes nothing,
|
|
1069
|
+
and a note says what build or edit would add. A graph-file cook (topotopo graph.json) adds it too and says so;
|
|
1070
|
+
--locked fails instead, for a build machine. workspace {action:"use", package:"studio/trees", version?} (CLI: topotopo
|
|
1071
|
+
use studio/trees [--version 1.1]) adds one explicitly; workspace {action:"remove", package} (CLI: topotopo remove) drops
|
|
1072
|
+
one no graph of the package names any more, with the copies nothing else uses.
|
|
1073
|
+
- workspace {action:"packages"} (CLI: topotopo packages) lists what the package uses, one line each (version, outputs, up
|
|
1074
|
+
to date or "1.3 is out"), the other packages the places it looks in give (each with its place, and "also in …, not
|
|
1075
|
+
used"), the places, and what it could not check; at a workspace's root, the workspace's;
|
|
1076
|
+
{action:"packages", package:"studio/trees"} (CLI: topotopo packages studio/trees) shows one package: its versions and
|
|
1077
|
+
notes, its outputs with their kinds, tags, params and inputs.
|
|
1078
|
+
- A package output cooks in its version's own scope: its own assets, graphs (graph_ref) and files (relative paths read
|
|
1079
|
+
the version's folder) and the versions it uses. Nothing leaks either way, and two versions of one package (one the
|
|
1080
|
+
package uses, one another package uses) cook side by side. Its result names the version's texture files by paths
|
|
1081
|
+
relative to the package's folder (absolute only for a followed working folder outside the package), so exports name
|
|
1082
|
+
no folder of this machine.
|
|
1083
|
+
- Errors never guess: a package not in "uses" says how to add it, an unknown output lists the package's outputs, a
|
|
1084
|
+
missing copy says which and which package's use copies it again, and in a workspace a package found only in a
|
|
1085
|
+
registered library the workspace does not list names that library and the command that lists it.
|
|
1086
|
+
|
|
1087
|
+
SEARCH: workspace {action:"search", query?, kind?, tag?} (CLI: topotopo search [words] [folder] --kind k --tag t, the
|
|
1088
|
+
folder written as a path: ., ./forest, ../forest) looks through the newest version of every package in the places the
|
|
1089
|
+
package looks in and TopoTopo's built-in library, and in a workspace the registered libraries it does not list. Every word of query
|
|
1090
|
+
must start a word of an output's full name, label, description or tags, or of its package's title or tags
|
|
1091
|
+
("tree" finds trees, not topotopo/street); kind and tag match exactly: {query:"conifer"}, {kind:"terrain"},
|
|
1092
|
+
{query:"brick", tag:"masonry"}. Results come by place, in the order a lookup takes them (TopoTopo's built-in library
|
|
1093
|
+
after them), each with its full name, kind, tags, label, version and description, and say whether the package can use
|
|
1094
|
+
it: those of a place it looks in, yes (a graph that names one adds it); in a workspace, a registered library it does not
|
|
1095
|
+
list only once the workspace lists it, and the result says the command that lists it.
|
|
1096
|
+
|
|
1097
|
+
TOPOTOPO'S OWN PACKAGES: four built-in packages in TopoTopo's built-in library, every one a package of the owner "topotopo"; their
|
|
1098
|
+
outputs are listed by the catalog (category "package") and help even where the package does not use them yet:
|
|
1099
|
+
topotopo/architecture wall_segment window_frame door_frame house stairs spiral_stairs railing pillar arch roof_gable
|
|
1100
|
+
roof_hip roof_skeleton brick_wall tile_floor hex_grid_floor scaffold beam_truss
|
|
1101
|
+
topotopo/nature rock cliff_block tree_lowpoly bush log forest_patch grass_clumps scatter_rocks
|
|
1102
|
+
topotopo/props crate barrel pallet sandbag_wall pipe_run
|
|
1103
|
+
topotopo/street road_strip lamp_post bollard bench sign_post fence cable
|
|
1104
|
+
{"type": "topotopo/architecture/stairs", "params": {"steps": 12, "style": "open"}} {"type": "topotopo/nature/rock"}
|
|
1105
|
+
A built-in package's name alone ("topotopo/nature"), or its output "lineup", is its default output: its outputs side by side. Every
|
|
1106
|
+
output has a pinned kind (mesh; instances for scatter_rocks, forest_patch and grass_clumps; the nature package's line-up a
|
|
1107
|
+
scene) and tags (search {tag:"street-furniture"}, {query:"conifer"}, {tag:"low-poly"}). Pivots sit at the base (y = 0,
|
|
1108
|
+
Y up, metres; walls start at x = 0, roofs at the wall top); every piece has prim name and material. Outputs that
|
|
1109
|
+
follow a curve (railing, fence, pipe_run, road_strip) take the curve as input 0, those that dress a surface
|
|
1110
|
+
(scatter_rocks, forest_patch, grass_clumps) the surface; unconnected they build a default one. Those three output
|
|
1111
|
+
packed instances. A built-in package's pieces build on each other (house is its own wall_segment and roof_skeleton).
|
|
1112
|
+
A first use copies the built-in package into the package that uses it, as for any other, and a newer version a
|
|
1113
|
+
TopoTopo release brings shows as an update. In an installed TopoTopo they have no working folder to follow;
|
|
1114
|
+
TopoTopo's repository publishes them.
|
|
1115
|
+
|
|
1116
|
+
FOLLOWING, for one session: workspace {action:"follow", package:"studio/trees", on:true} (CLI: --follow studio/trees on a
|
|
1117
|
+
graph cook or topotopo view) shows that package's working folder (where the package finds it) instead of its copy, until
|
|
1118
|
+
on:false or the end of the session; nothing about it is saved. Every edit there re-cooks. Following is for looking
|
|
1119
|
+
(the viewer, renders, inspect): exports and publishing use the published copy, and an export made while following
|
|
1120
|
+
says which published version it used. A workspace with "follow": true (topotopo workspace init --follow) follows its
|
|
1121
|
+
own packages this way, those whose working folder is inside it. Other packages' versions keep the copies they hold.
|
|
1122
|
+
|
|
1123
|
+
OUT OF DATE AND UPDATE: what a package uses changes only by an update, after a before/after.
|
|
1124
|
+
- workspace {action:"outdated"} (CLI: topotopo outdated) lists the packages in use that have newer versions:
|
|
1125
|
+
the newer versions with their notes (and their outputs of another kind), one line for those up to date, what it could
|
|
1126
|
+
not check, and the update to run for each.
|
|
1127
|
+
- workspace {action:"update", package:"studio/trees", to?} (CLI: topotopo update studio/trees [--to 2.0]) is the
|
|
1128
|
+
before/after: every place the package uses the updated package (each node of its type in graphs/, assets/ and the graph files
|
|
1129
|
+
in the package's folder, nested graphs included, with its params and inputs as they are) cooked with the version in
|
|
1130
|
+
use and with the new one; what changed in each (counts, size, attributes, the largest move) with an overlay render
|
|
1131
|
+
(grey the same, blue only with the new version, orange only with the old); the notes of the versions between. Without
|
|
1132
|
+
"to" it goes to the newest version with the same big number (none newer is no failure: it says so). A big version is
|
|
1133
|
+
named with "to", and the before/after then lists what the graphs must change, place by place: params they set that it
|
|
1134
|
+
no longer has (with did-you-mean), values its narrower range clamps, options it no longer has, outputs they use and
|
|
1135
|
+
inputs they wire that are gone. The new version is read where its place holds it: nothing is written. It says how
|
|
1136
|
+
far it is, stops when the call is cancelled (CLI: Ctrl+C) and reuses what was cooked before.
|
|
1137
|
+
- Show the before/after to the person and apply it only when they say so, naming the versions it showed:
|
|
1138
|
+
{action:"update", package, from, to, apply:true} (CLI: the command the before/after ends with, --from 1.3 --to 1.4
|
|
1139
|
+
--apply) copies the new version in with the versions it uses, sets "uses" and the lock, and deletes the copies
|
|
1140
|
+
nothing uses any more. It is refused when the manifest uses another version by then. After a big update the graphs
|
|
1141
|
+
report what they must change until they do.
|
|
1142
|
+
|
|
1143
|
+
IN THE VIEWER (preview, topotopo edit, topotopo view on a graph in a package): the Packages tab, in every package, has
|
|
1144
|
+
Find packages (the places the package looks in and TopoTopo's built-in packages) and a box per package used: the version in use with a badge (up to
|
|
1145
|
+
date, update available, live), the nodes that use it, its outputs with their kinds and tags (those in use marked), and
|
|
1146
|
+
Update only when a newer version exists. The Scene tree marks the nodes of a package with an update or a live folder.
|
|
1147
|
+
The card of an output that cooks to another kind than its "kind" says so. Update first compares every place with the
|
|
1148
|
+
version in use (a) and the new one (b), its progress in the cook line and Stop; a place shows alone in the view as a,
|
|
1149
|
+
as b or both overlaid, with what changed in a line; it applies only when the person confirms, and a big version whose
|
|
1150
|
+
graphs must change asks once more and gives the person a line to copy for you. "Source: Published | Live folder" shows
|
|
1151
|
+
a package's working folder for the viewer's session (never saved; not offered for TopoTopo's built-in packages outside TopoTopo's
|
|
1152
|
+
repository); results that use it are marked as showing unpublished edits, their exports and downloads write the
|
|
1153
|
+
published version, and a save in a working folder
|
|
1154
|
+
the session does not follow is offered in that package's box.
|
|
1155
|
+
|
|
1156
|
+
EXPORTS record the package versions their graph used in the source block: "packages": {"studio/trees@1.3": "<hash>"}.
|
|
1157
|
+
|
|
1158
|
+
THE CLI COMMANDS (a folder named must exist; without one, the current folder's package):
|
|
1159
|
+
${PACKAGE_COMMANDS.map((c) => ` topotopo ${c.usage}\n ${c.what}`).join('\n')}`,
|
|
1160
|
+
godot: `GODOT (packages inside a Godot project, imported by the TopoTopo plugin)
|
|
1161
|
+
A package inside a Godot project imports as <id>.topo: the plugin (topotopo godot setup puts it in addons/topotopo/) cooks
|
|
1162
|
+
each published output into a plain GLB Godot imports itself, and keeps them current while graphs change (from the
|
|
1163
|
+
viewer, an agent over MCP, by hand). Levels place and load the GLBs, never the .topo.
|
|
1164
|
+
|
|
1165
|
+
WHAT IS COOKED: the package's published outputs, the rule publishing uses: every named output of every graph without
|
|
1166
|
+
"publish": false, plus the default output (named after the package id when it is no named output), minus the skip
|
|
1167
|
+
list; each at frame 1 with its graph's var defaults, from the working folder, the packages it uses from their pinned
|
|
1168
|
+
copies (working folders are never followed). Nothing of the package is written but its outputs and its record: a graph
|
|
1169
|
+
naming a package it does not use, or a missing or edited copy, fails that output (as --locked does).
|
|
1170
|
+
mesh, scene, instances, curves, points <folder>/<id>/<id>.glb (per-output folders) or <folder>/<id>.glb (--flat)
|
|
1171
|
+
textures one PNG per image in that folder
|
|
1172
|
+
terrain, material, volume not imported yet: listed as skipped, with why (a warning)
|
|
1173
|
+
The GLB: TopoTopo's glTF defaults (y up, metres, materials with embedded images, no compression or quantization),
|
|
1174
|
+
node names as authored (sockets from scene_null, _lod0/_lod1 pieces, Godot's -col/-colonly suffixes), packed instances
|
|
1175
|
+
as EXT_mesh_gpu_instancing (MultiMeshInstance3D in Godot; the instances' Cd as _COLOR), every required extension one
|
|
1176
|
+
Godot 4.7 reads, the source block in asset.extras.source with "package". No .source.json beside it.
|
|
1177
|
+
|
|
1178
|
+
OPTIONS come from <id>.topo.import [params] (the Import dock), and the flags override them:
|
|
1179
|
+
outputs/folder "outputs" (relative to the package, or res://…) --into <folder>
|
|
1180
|
+
outputs/per_output_folders true --flat
|
|
1181
|
+
outputs/skip "" (comma-separated output ids) --skip a,b
|
|
1182
|
+
instances/mode 0 MultiMesh (packed) | 1 Expand (real copies) --instancing packed|expand
|
|
1183
|
+
|
|
1184
|
+
WRITING: one cook per package at a time (<package>/.topotopo/cook.lock); only files whose bytes changed are written
|
|
1185
|
+
(through <file>.topotopo-part), so Godot reimports only those; a failed output keeps its last good files and the others
|
|
1186
|
+
still update; a file at an output path is replaced only when the record lists it or it was cooked for this package
|
|
1187
|
+
(--adopt takes one over once, keeping its .import); an output no longer published leaves its files as orphans.
|
|
1188
|
+
THE RECORD <package>/.topotopo/godot.json (commit it with the outputs and their .import files): canonical JSON, no
|
|
1189
|
+
times, no machine paths; per output its deps (every file it read), files with their SHA-256, state and errors.
|
|
1190
|
+
A package is current when its record matches: the options, every source's hash (text read with LF line ends), the
|
|
1191
|
+
listings of graphs/, assets/, inputs/ and the folders outputs listed, every output file, and a TopoTopo no newer than
|
|
1192
|
+
the one that cooked it. Only outputs whose own deps changed cook again; results are shared through the cook cache
|
|
1193
|
+
(~/.topotopo/cache/cook, or $TOPOTOPO_CACHE/cook) by every checkout and worktree.
|
|
1194
|
+
|
|
1195
|
+
EXIT CODES: 0 every output ok; 1 an output or package failed or timed out (records and reports still written);
|
|
1196
|
+
2 usage, setup or protocol error, a published copy, a package outside a Godot project (nothing written).
|
|
1197
|
+
CI: godot --headless --path game --import, then topotopo godot status game --strict (where TopoTopo is not installed:
|
|
1198
|
+
godot --headless --path game --script res://addons/topotopo/tools/check.gd, which exits 1 the same way).
|
|
1199
|
+
IN THE EDITOR: the TopoTopo panel (bottom) shows each package's state, outputs, errors and orphans; right-click a .topo
|
|
1200
|
+
or an output: Open in TopoTopo (the live viewer), Recook, Show Cook Report. A failed output keeps its last good GLB and
|
|
1201
|
+
marks the .topo with Godot's ImportFail icon. integrations/godot/demo is a project to try it on.
|
|
1202
|
+
The plugin's contract (jobs file, progress lines, record schema, freshness): integrations/godot/PROTOCOL.md.
|
|
1203
|
+
|
|
1204
|
+
THE CLI COMMANDS:
|
|
1205
|
+
${GODOT_COMMANDS.map((c) => ` topotopo ${c.usage}\n ${c.what}`).join('\n')}`,
|
|
700
1206
|
uv: `UV TOOLKIT (uv = vertex attribute (u, v, 0); seams are edges where the corner uv differs)
|
|
701
1207
|
Which node:
|
|
702
|
-
uv_project planar/box/cylindrical/spherical projection. Fast, no packing
|
|
1208
|
+
uv_project planar/box/cylindrical/spherical projection. Fast, no packing (uv = position / scale, over many tiles):
|
|
1209
|
+
tiling textures, boxes. box: each polygon along the axis its normal is closest to (X faces u = z, v = y;
|
|
1210
|
+
Y faces u = x, v = z; Z faces u = x, v = y); both sides of an axis share it, so faces looking along +X,
|
|
1211
|
+
+Y and -Z are MIRRORED (text reads backwards; inspect uv counts them) and -X, -Y, +Z read right.
|
|
703
1212
|
uv_unwrap automatic (xatlas): cuts charts by angle/cost, flattens and packs into 0..1. Default for props and
|
|
704
|
-
hard-surface. Keeps polygons; writes prim chart.
|
|
705
|
-
|
|
1213
|
+
hard-surface. Keeps polygons; writes prim chart. Each connected piece is charted on its own; polygons
|
|
1214
|
+
xatlas cuts across charts become triangles (exact uv); faces with no area collapse onto a neighbour's
|
|
1215
|
+
chart (never to uv 0,0); folded charts are charted again or cut; thin charts (bevel strips) join a
|
|
1216
|
+
neighbour (merge_thin); charts longer than the tile, rings and arcs are cut when that packs denser
|
|
1217
|
+
(cut_long). The result is checked and warnings name the part. use_seams:true keeps existing seams.
|
|
1218
|
+
Big smooth meshes chart slowly: max_chart_area -1 (auto) caps chart size above ~1000 triangles; a higher
|
|
1219
|
+
max_cost makes fewer, larger charts (less space lost to padding).
|
|
706
1220
|
uv_flatten LSCM (conformal) per chart, charts bounded by YOUR seams: uv discontinuities (use_seams), the
|
|
707
1221
|
"seams" edge group, point pairs ({"seams": [[a,b],[b,c]]}), a prim chart attribute, the group border.
|
|
708
1222
|
Closed charts / handles are cut open automatically (cut_closed). pins: [a,b] fixes orientation.
|
|
709
1223
|
uv_autoseam experimental: proposes charts (xatlas or normal clustering) → prim chart + point seam; then uv_flatten.
|
|
710
|
-
uv_layout (re)pack islands:
|
|
711
|
-
|
|
1224
|
+
uv_layout (re)pack islands without overlaps: island_attrib "chart" packs by chart; writes prim island. Islands that
|
|
1225
|
+
do not fit at any scale leave the uv unchanged, with a warning (never a silent overlap).
|
|
712
1226
|
uv_transform translate/scale/rotate existing uv.
|
|
1227
|
+
Packing (uv_unwrap and uv_layout): islands on the texel grid of resolution, padding texels apart (half of it to the tile
|
|
1228
|
+
border), uniform texel density (uv area ∝ 3D area), every gap filled (inside rings, between arms).
|
|
1229
|
+
orient: min_rect (densest; 90° turns allowed) | world (world up +Y → +v, horizontal islands +X → +u; no turns) |
|
|
1230
|
+
keep (as it is; no turns). Rotations never mirror.
|
|
1231
|
+
texel_weight: a prim float attribute scaling density per island (2 = twice the texels per metre; <= 0 counts as 1):
|
|
1232
|
+
attrib_create {name:"texel_weight", class:"prim", value:2, group:"@name=sight"} gives the sight more texels.
|
|
1233
|
+
texels_per_unit (0 = largest that fits) with fit: atlas (default: everything in 0..1, the density lowered if needed,
|
|
1234
|
+
with a warning) | udim (keep the density, spill into tiles 1001, 1002 …; uv_layout up to udims) | stack (uv_unwrap:
|
|
1235
|
+
more atlases, all in 0..1, prim atlas).
|
|
1236
|
+
Rails, ladders, pipes (long thin parts): orient min_rect lays each strip along the tile and the packer stacks the strips
|
|
1237
|
+
side by side, filling the gaps with small charts; leave cut_long on (a chart longer than the tile is cut into parts)
|
|
1238
|
+
and merge_thin on (bevel strips join the face beside them). Every chart loses a padding border, so fewer, wider charts
|
|
1239
|
+
fill more: unwrap with a higher max_cost, or give a part your own seams (use_seams). inspect uv names the lowest and
|
|
1240
|
+
highest density charts: compare them to spot a part that came out too coarse.
|
|
713
1241
|
Typical: geo → uv_unwrap → render {views:"quad_uv", checker:true}. Manual: delete uv → uv_flatten {seams:[...]} → uv_layout.
|
|
1242
|
+
LODs: decimate / lod after uv_unwrap keep the uv free of folds (keep_uv, default on: where a collapse would fold the uv
|
|
1243
|
+
they reduce in steps around it, so a level can stop above its target; the warning names the parts). The full
|
|
1244
|
+
reduction: reduce first, then uv_unwrap each level.
|
|
714
1245
|
SEE IT: render views "uv" (or "quad_uv" = persp + uv): the 0..1 square with a 0.1 grid and UDIM labels, polygons filled
|
|
715
|
-
by chart/island colour, island borders yellow, overlapping uv in RED (footer/notes give the overlap %)
|
|
1246
|
+
by chart/island colour, island borders yellow, overlapping uv in RED (footer/notes give the overlap %); overlap that is
|
|
1247
|
+
expected is amber: charts of a repeating texture (they run across tile borders: the label says TILING) and LODs that
|
|
1248
|
+
share the uv space (prim names ending _lod0, _lod1 …).
|
|
716
1249
|
render checker:true shades 3D views with an 8×8 uv checker: squares should look square and equal-sized
|
|
717
1250
|
(stretch = rectangles, density = cell size, mirrored charts flip the red/green gradient).
|
|
718
|
-
MEASURE IT: inspect {detail:"uv", resolution:1024, json:true}: exact overlaps (triangle pairs
|
|
719
|
-
folds inside one chart included; shared edges are not overlaps),
|
|
720
|
-
|
|
721
|
-
|
|
1251
|
+
MEASURE IT: inspect {detail:"uv", resolution:1024, json:true}: exact overlaps (triangle pairs with the part and world
|
|
1252
|
+
position of each, and their areas; folds inside one chart included; shared edges are not overlaps), split into
|
|
1253
|
+
overlap.inTile (between atlas charts, each inside one tile: what a bake suffers), overlap.tiling (a chart runs across
|
|
1254
|
+
tile borders, as uv_project over many tiles does: a repeating texture, flagged tiling:true; expected) and
|
|
1255
|
+
overlap.acrossLods (prims named _lod0 / _lod1 … share the uv space on purpose); collapsed / non-finite / out-of-tile
|
|
1256
|
+
triangles (the first one named with its position), UDIM tiles, charts, mirrored triangles, utilization (exact for a
|
|
1257
|
+
clean atlas in 0..1, else a labelled raster ESTIMATE; tileUtilization per UDIM tile), texel density (density: overall,
|
|
1258
|
+
per chart 5 % / median / 95 %, the lowest and highest chart and where; texels/m with a resolution) and per-piece
|
|
1259
|
+
(prim "name") surface, uv area and texel density. An analysis that hits its bounds says INCOMPLETE.
|
|
722
1260
|
CLI: --inspect uv --uv-resolution 1024 [--json].
|
|
723
1261
|
Export: uv → glTF TEXCOORD_0 (v flipped), OBJ vt, USD primvars:st.`,
|
|
724
1262
|
render: `RENDER (pick the overlay that answers your question; everything is off by default)
|
|
725
1263
|
render {node?, views, …} returns a PNG; build/edit take the same options as render:{…}. The footer names the active
|
|
726
1264
|
overlays and notes pieces, open edges and back-facing % (also returned as text notes).
|
|
727
1265
|
VIEWS: "quad" (persp/front/right/top, default) · "turntable" (persp at azimuth 0/90/180/270) · "quad_uv" · a list of
|
|
728
|
-
persp, front, back, left, right, top, bottom, uv, section, texture, persp@<azimuth
|
|
729
|
-
|
|
1266
|
+
persp, front, back, left, right, top, bottom, uv, section, texture, persp@<azimuth>, and the three-quarter views
|
|
1267
|
+
front_left, front_right, back_left, back_right (persp at azimuth -45, 45, -135, 135).
|
|
730
1268
|
"texture" draws images flat (texture:"<image>" | "image/layer" | "<material>" picks; a geometry holding only images
|
|
731
1269
|
renders as it by default); textures:true shows base colour maps on the mesh. Help topic "textures".
|
|
1270
|
+
FRAMING: every 3D view fits the bounds: the bbox corners fill the view with a small margin, so nothing is cropped.
|
|
1271
|
+
azimuth: degrees around +Y; 0 = the camera on +Z looking at the front, 90 = on +X (the right side), 180 = the back,
|
|
1272
|
+
-90 = the left; default 35. elevation: degrees above the horizon (default 25; 90 looks straight down).
|
|
1273
|
+
e.g. render {views:"persp", azimuth:-90, elevation:10} looks at the left side from just above.
|
|
1274
|
+
zoom: relative to the fit (1 = fit, 0.5 = half size). Above 1 it magnifies around look_at and crops, so it only
|
|
1275
|
+
applies with look_at (or ortho_scale); without them it is held at 1 and a note says so.
|
|
1276
|
+
look_at: [x, y, z] in world metres (x right, y up, z towards the front; Y-up like everything else); the view centres
|
|
1277
|
+
on it and still fits the bounds around it. e.g. render {views:"persp", look_at:[0.6, 0.15, 0], zoom:4} (a muzzle).
|
|
1278
|
+
ortho_scale: the world width in metres across an ortho or section view (default: fit the bounds).
|
|
1279
|
+
e.g. render {views:"front", ortho_scale:0.5} shows 50 cm across the front view, at any size.
|
|
1280
|
+
size: pixels per view, n or "WxH": size:"1600x600" gives wide views a long prop fills (the fit follows the aspect);
|
|
1281
|
+
scale 2 makes a 2× image.
|
|
1282
|
+
BACKGROUND: transparent:true gives a PNG with alpha (background pixels 0; no ground grid or axis gizmo; the footer
|
|
1283
|
+
stays). grid:false drops the persp ground grid. underlay:"inputs/side.png" draws a reference image (PNG, relative to
|
|
1284
|
+
the package) behind the 3D views at underlay_opacity (default 0.5); underlay_fit "bounds" (default: fitted into the
|
|
1285
|
+
rectangle the bounds cover in that view, keeping its aspect, so a reference cropped to the object lines up with it),
|
|
1286
|
+
"width" / "height" (its width or height spans the bounds'), "view" (the whole view). Pick the view that matches the
|
|
1287
|
+
picture: render {views:"front", underlay:"inputs/side.png", size:"1600x500"}.
|
|
1288
|
+
SOCKETS: sockets:true draws scene empties (scene_null: attachment points) as dots with their name and orient axes
|
|
1289
|
+
(X red, Y green, Z blue), through the surface. pbr renders hide empties unless sockets is set.
|
|
732
1290
|
QUESTION → OPTION
|
|
733
1291
|
How dense / clean is the topology? Where are the triangles, poles, slivers? wireframe:"all" (every edge, 1 px)
|
|
734
1292
|
Which edges are creases? wireframe:"hard" (dihedral > hard_angle, default 30) + crease/hard/sharp edge groups
|
|
@@ -753,17 +1311,36 @@ QUESTION → OPTION
|
|
|
753
1311
|
roughness map, metallic, emissive, unlit) under a fixed camera-relative studio rig (key, fill, rim and a
|
|
754
1312
|
sky/ground environment), GGX specular, ACES, exposure (stops, default 0). Deterministic: the same graph
|
|
755
1313
|
gives the same PNG. Texture files are read from disk; transparency is not evaluated (shaded opaque,
|
|
756
|
-
with a note), nor are missing or non-PNG maps (named in the notes).
|
|
1314
|
+
with a note), nor are missing or non-PNG maps (named in the notes). color_by and highlight tint
|
|
1315
|
+
the shaded material (the attribute colour lit by the material's brightness); checker is not shown.
|
|
1316
|
+
POLYGON EDGES: wireframe "auto" (the default) draws polygon edges on meshes under 6,000 polygons, never under shading
|
|
1317
|
+
"pbr" or textures:true (they would read as marks in the material); the footer says EDGES AUTO when it draws them.
|
|
1318
|
+
wireframe:false hides them, true draws them always.
|
|
757
1319
|
Labels never overlap: ones without room are skipped (note says how many; raise size or lower max_labels).
|
|
758
|
-
view_labels:false drops each view's name label and the persp axis gizmo (clean thumbnails, e.g.
|
|
1320
|
+
view_labels:false drops each view's name label and the persp axis gizmo (clean thumbnails, e.g. those of TopoTopo's own packages).
|
|
1321
|
+
Heightfields draw at most heightfield_res quads per side (default 256; "full" = every sample): a larger field is
|
|
1322
|
+
drawn decimated (a 513 × 513 field at 257 × 257) and the footer and a note say so. They show the mask in red;
|
|
1323
|
+
heightfield_layer:"flow" shows another layer (0..1 layers as they are, others from their min to their max, named
|
|
1324
|
+
in the legend) and "none" none.
|
|
759
1325
|
Examples: render {views:["persp","section"], section_axis:"z", wireframe:"hard", label_groups:true}
|
|
760
1326
|
render {views:"turntable", shading:"matcap"} · render {glyphs:"N", clip:{axis:"x", offset:0.5}}
|
|
1327
|
+
CLI: several renders per cook: the options after a --render apply to that render, up to the next --render; options before the
|
|
1328
|
+
first --render apply to every render. Example: both renders 1200x600; side.png the front view over the reference,
|
|
1329
|
+
beauty.png a pbr three-quarter view:
|
|
1330
|
+
topotopo g.json --size 1200x600 --render side.png --views front --underlay ref.png --render beauty.png --views front_left --shading pbr
|
|
761
1331
|
CLI: --wireframe all --section y:0.5 --clip x:0.5 --glyphs N --labels groups,pieces --shading matcap --legend --size 1600 --scale 2
|
|
762
|
-
--shading pbr --exposure 0.5
|
|
763
|
-
--
|
|
1332
|
+
--shading pbr --exposure 0.5 --views front_left --size 1600x600 --transparent --no-grid --sockets
|
|
1333
|
+
--azimuth -90 --elevation 10 --look-at 0.6,0.15,0 --zoom 4 --ortho-scale 0.5
|
|
1334
|
+
--underlay ref.png --underlay-opacity 0.6 --underlay-fit width (CLI paths are relative to the current folder)
|
|
1335
|
+
--no-view-labels --heightfield-res full --heightfield-layer flow`,
|
|
764
1336
|
export: `EXPORT
|
|
765
1337
|
export {output:"crate"} / export {} (the default output) / export {all:true}: the graph's export targets (help topic
|
|
766
1338
|
"graph": "export" on the graph or an output), written inside exports/, the same files the viewer's Export buttons write.
|
|
1339
|
+
PATHS: one rule for the CLI, the MCP server and the viewer: relative paths inside a graph (file nodes, material maps,
|
|
1340
|
+
image files) read from its package folder, the nearest folder with a .topo file at or above the graph file, else
|
|
1341
|
+
the graph file's folder (MCP: the server's folder); exports/ is that package's (a graph in <package>/graphs/ exports into
|
|
1342
|
+
<package>/exports/, never beside itself), and exports/.outputs.json records the files by their package paths. The
|
|
1343
|
+
CLI's own --render / --export / --underlay paths are relative to the current folder.
|
|
767
1344
|
export {path:"exports/thing.glb"} — format from the extension:
|
|
768
1345
|
glb / gltf glTF 2.0 via gltf-transform (recommended for Unreal, Blender, web)
|
|
769
1346
|
geo Houdini JSON geometry: every attribute (all classes), group and polyline, lossless (precision 64 or 32)
|
|
@@ -772,28 +1349,53 @@ export {path:"exports/thing.glb"} — format from the extension:
|
|
|
772
1349
|
obj usda ply stl json (lossless topotopo)
|
|
773
1350
|
textures format:"textures", path = a folder: every image volume as <image>.png (help topic "textures")
|
|
774
1351
|
Options: up_axis "y" (default) | "z", scale (100 = m → cm), split_by_name (one mesh per prim "name", default true),
|
|
775
|
-
custom_attribs
|
|
1352
|
+
custom_attribs (extra numeric attributes: default off for glb / gltf / usda and the GLBs of instance rows and bundles,
|
|
1353
|
+
on for ply; below), materials (default true), vertex_colors (glTF, default false: prims with a named material are
|
|
1354
|
+
written in that material, their Cd dropped; true keeps Cd as COLOR_0 there too, below), compress "none" | "meshopt" (EXT_meshopt_compression + KHR_mesh_quantization,
|
|
776
1355
|
~3× smaller; for web engines such as three.js/Babylon.js) | "draco" (only with the optional draco3dgltf package),
|
|
777
1356
|
quantize (KHR_mesh_quantization alone), tangents "auto" | "preserve" | "none" (glTF TANGENT, below), attributes ["P","pscale",…] (csv / points.json), pcg / pcg_struct (csv),
|
|
778
1357
|
precision 64 | 32 (geo), instancing "packed" | "expand", instances "rows" | "expand" (csv / points.json of packed
|
|
779
1358
|
prims), meshes (instance rows: also write one GLB per source, default true). For Unreal and Blender keep the default
|
|
780
1359
|
uncompressed GLB.
|
|
1360
|
+
SOURCE: every export (export tool, export targets and the viewer's Export and Download buttons, the CLI's --export and
|
|
1361
|
+
--export-all) records how it was made, so it can be made again: a "source" block {graph, graph_sha256 (SHA-256 of the graph JSON as
|
|
1362
|
+
cooked: vars after overrides, keys sorted, no whitespace), output (a named output, else null), node, frame, fps, vars
|
|
1363
|
+
(all of them, after overrides), seeds (the seed params the graph sets, by node: "loop/pts" inside a body, as written),
|
|
1364
|
+
export: {format, options: every option the format reads, the given ones and the defaults of the rest}, topotopo (the
|
|
1365
|
+
version)}. png16 / r16 carry it in their .json sidecar, csv / points.json
|
|
1366
|
+
instance rows in <name>.meshes.json, unreal_landscape in landscape.json; every other export writes <file>.source.json
|
|
1367
|
+
next to the file ({format:"topotopo-export-source", version, files, source}; a textures folder: source.json inside
|
|
1368
|
+
it), and glb / gltf also carry it in asset.extras.source. Nothing in it depends on the time or the machine: the same
|
|
1369
|
+
graph, values and options give the same bytes, and a later version changing a default does not change what the
|
|
1370
|
+
record replays. Replay on the command line: topotopo <graph>.json --output <output> (or --node <node>) --frame <frame>
|
|
1371
|
+
--fps <fps>, one --var <name>=<value as JSON> per var, --format <format>, every option as its flag (up_axis "z" →
|
|
1372
|
+
--up-axis z, custom_attribs false → --no-custom-attribs, layers ["a","b"] → --layers a,b) and --export <path>. e.g.
|
|
1373
|
+
topotopo graphs/crate.json --node h --frame 1 --fps 24 --format glb --compress none --custom-attribs
|
|
1374
|
+
--instancing packed --materials --no-quantize --scale 100 --split-by-name --tangents auto --up-axis z --export crate.glb
|
|
1375
|
+
These sidecars and manifests are metadata of the file beside them: inputs list and the viewer show
|
|
1376
|
+
them with it (kind "metadata"), and a file node reading one says what to read instead.
|
|
781
1377
|
glTF layout: one node+mesh per "name", one primitive per material. Polygons → TRIANGLES, polylines → one LINE_STRIP each
|
|
782
1378
|
(LINES above 256 curves), loose points → POINTS with pscale as _PSCALE. Scene empties (scene_null: isolated points with
|
|
783
1379
|
scene_empty 1, name, parent, orient, scale) → meshless nodes (sockets) under their parent: the scene, another empty or
|
|
784
1380
|
a uniquely named mesh, with the local TRS that keeps their geometry-space placement; set point attributes → node extras;
|
|
785
1381
|
missing, ambiguous or cyclic parents and GPU-instanced parents are errors; import brings them back. N → NORMAL (else computed, 60° cusp),
|
|
786
|
-
uv/uv2 → TEXCOORD_0/1 (V flipped), Cd (+Alpha) → COLOR_0
|
|
1382
|
+
uv/uv2 → TEXCOORD_0/1 (V flipped), Cd (+Alpha) → COLOR_0 (not on prims with a named material unless vertex_colors,
|
|
1383
|
+
MATERIALS below). TANGENT (tangents "auto", the default): MikkTSpace
|
|
787
1384
|
tangents (xyz + handedness w) for every primitive whose material has a normal map, computed per corner before
|
|
788
1385
|
vertices are welded (uv seams, hard normals and mirrored islands keep their own frames), the same frame bake_normal
|
|
789
1386
|
bakes in; a valid point/vertex "tangent" float[4] (from an import) is written on other primitives. "preserve" writes
|
|
790
1387
|
the supplied attribute wherever it exists (malformed = error), "none" never writes TANGENT. Collapsed uvs are
|
|
791
|
-
reported. Import reads TANGENT back as point "tangent" (transforms keep it: xyz rotated, w flipped by mirrors).
|
|
792
|
-
of size 1-4 → _NAME (upper-cased,
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
1388
|
+
reported. Import reads TANGENT back as point "tangent" (transforms keep it: xyz rotated, w flipped by mirrors).
|
|
1389
|
+
Custom attributes (custom_attribs true): every other numeric point/vertex attribute of size 1-4 → _NAME (upper-cased,
|
|
1390
|
+
float or the smallest int type), mesh extras keep the original names and types, and packed instances carry their
|
|
1391
|
+
anchor attributes as per-instance accessors. The attributes only scene empties use (scene_empty, parent, orient, scale,
|
|
1392
|
+
their extras) never become mesh channels.
|
|
1393
|
+
MATERIALS: the material node writes prim "material" + the detail table. A named material wins: its prims export in that
|
|
1394
|
+
material as it is and their Cd / Alpha are dropped (Cd left from colouring parts does not become COLOR_0 or a second,
|
|
1395
|
+
white or tinted copy of the material). Prims without a material, and every prim with vertex_colors:true, keep their
|
|
1396
|
+
Cd: not all white → baseColor white × COLOR_0 with the material's metallic/roughness/emissive (one constant Cd is
|
|
1397
|
+
folded into the factor). alpha < 1 → alphaMode BLEND; unlit → KHR_materials_unlit; emissive above 1 → KHR_materials_emissive_strength.
|
|
1398
|
+
TEXTURES: material {base_color_map, normal_map, roughness_map} (PNG/JPEG paths relative to the package folder; the mesh
|
|
797
1399
|
needs uv). glb/gltf embed the images (baseColorTexture, normalTexture, metallicRoughnessTexture = roughness in green; a
|
|
798
1400
|
map replaces its factor). usda: UsdUVTexture shaders reading primvars:st, asset paths relative to the .usda. geo/json
|
|
799
1401
|
keep the paths in the material table. glTF import records texture paths (or "embedded:<name>") without decoding.
|
|
@@ -856,9 +1458,10 @@ HOUDINI: File SOP reads .geo (and glb/obj/usd); packed prims are written as Pack
|
|
|
856
1458
|
stored once in sharedprimitivedata (layout not yet confirmed against a Houdini-written file: instancing "expand" is
|
|
857
1459
|
the safe path). CSV points: Table Import SOP, map P.x/P.y/P.z → P (and other columns).
|
|
858
1460
|
A material name becomes a Houdini material path with a wrangle: s@shop_materialpath = "/mat/" + s@material;
|
|
859
|
-
BLENDER: File > Import > glTF 2.0 (custom attributes arrive as mesh attributes
|
|
860
|
-
|
|
861
|
-
|
|
1461
|
+
BLENDER: File > Import > glTF 2.0 (custom attributes, exported with custom_attribs:true, arrive as mesh attributes
|
|
1462
|
+
named _NAME).
|
|
1463
|
+
PACKED INSTANCES (help topic "instancing"): glb/gltf write EXT_mesh_gpu_instancing (per-instance attributes with
|
|
1464
|
+
custom_attribs:true), usda a PointInstancer (per-instance primvars with custom_attribs:true), geo PackedGeometry prims, csv/points.json the instance stream, json keeps
|
|
862
1465
|
them; obj/ply/stl expand them. Option instancing "expand" writes real geometry everywhere.
|
|
863
1466
|
SPLINES (Bezier/NURBS prims, help topic "curves"): every format but json writes the evaluated polylines (closed curves as
|
|
864
1467
|
polygons), with a note; json keeps the spline prims. convert_curve first to choose the resolution.
|
|
@@ -879,18 +1482,35 @@ IMPORT (file node): obj, stl, ply, glb/gltf (meshopt; Draco with draco3dgltf; ex
|
|
|
879
1482
|
null), min_edge_length, no_degenerate (zero-area faces, coincident points within tolerance), no_self_intersections
|
|
880
1483
|
(BVH, stops after max_tests candidate pairs and says so), attrib (must exist; attrib_min/attrib_max bound its first
|
|
881
1484
|
component; attrib_class), group (exists and is non-empty), expr (JS over npoints nprims nvertices npolys nlines
|
|
882
|
-
bbox.min/.max/.size/.center (.x .y .z) volume area pieces open_pieces genus closed boundary_edges
|
|
1485
|
+
bbox.min/.max/.size/.center (.x .y .z) volume area pieces open_pieces genus closed boundary_edges, and the graph
|
|
1486
|
+
vars by their bare name: "npoints == count * 8").
|
|
883
1487
|
on_fail: error (default) | warn | mark → detail assert_failed (count) + assert_report, groups assert_fail;
|
|
884
1488
|
then render {highlight:"assert_fail"} shows where. Each assert records stats checks/failed in the cook report.
|
|
1489
|
+
Every failed check names its first offender: the part (prim "name", groups) and its world position.
|
|
1490
|
+
inspect {detail:"topology"} says whether the mesh is a closed solid and, when not, why: open edges (counted after
|
|
1491
|
+
welding the vertex splits of uv/normal seams, which a re-imported GLB has), non-manifold edges, flipped faces, pieces
|
|
1492
|
+
facing inward, degenerate faces, each with a count, where the first one is and the fix. Solid ops (boolean …) give
|
|
1493
|
+
the same causes when they refuse a mesh.
|
|
885
1494
|
2. EXPLAIN AFTER A BUILD/EDIT: explain {graph, node?} describes the result in words, e.g.
|
|
886
1495
|
"reads as: one closed piece, box-like, 2 × 1 × 1 m, 3 cm thin walls, mirror-symmetric in x, z", then pieces,
|
|
887
1496
|
watertight/genus/boundary loops, flipped normals, symmetry planes, principal axis + aspect, sampled thickness,
|
|
888
1497
|
degenerate faces, polygon mix, attributes, groups. Compare it with what you meant to build.
|
|
889
1498
|
3. DIFF TO SEE WHAT A CHANGE DID: graphs {action:"duplicate", name:"main", to:"before"} → edit → diff {a:"before", b:"main"}:
|
|
890
|
-
counts, bbox delta, topology/volume, attribute and group changes,
|
|
891
|
-
(same point count), verdict. a/b: "graph", "graph/node" or {graph, node, frame} (two nodes or two frames work too).
|
|
1499
|
+
counts, bbox delta, topology/volume, attribute and group changes, heightfields, images and SDF grids (sample by
|
|
1500
|
+
sample), Hausdorff + mean distance, per-point displacement (same point count), verdict. a/b: "graph", "graph/node" or {graph, node, frame} (two nodes or two frames work too).
|
|
892
1501
|
render:true overlays them: grey = unchanged, blue = only in b, orange = only in a.
|
|
893
1502
|
4. RENDER for what text cannot tell (proportions, style); inspect for one attribute's numbers.
|
|
1503
|
+
5. INSPECT {detail} (CLI --inspect <detail>):
|
|
1504
|
+
summary (default) one screen: counts and triangles, bbox in metres to the millimetre, parts (prim "name"),
|
|
1505
|
+
materials and their maps, images, uv state (charts, in-tile overlap, tiling, utilization), closed
|
|
1506
|
+
or open edges (after welding seam splits)
|
|
1507
|
+
budget triangles per part (prim "name": each exports as its own mesh), split per LOD when the names
|
|
1508
|
+
end in _lod0, _lod1 …, and per node (the triangles each node adds over its inputs), sorted, with
|
|
1509
|
+
totals; packed instances count expanded. json:true (CLI --json) appends it as JSON
|
|
1510
|
+
scene the glb export read back from its bytes: the node tree (meshes, sockets and their parents, world
|
|
1511
|
+
and local positions), triangles per mesh, materials with factors and maps, images with size;
|
|
1512
|
+
export_options (CLI: the export flags) as the export takes them
|
|
1513
|
+
topology / uv / attributes / elements / all (see above and help topic "uv")
|
|
894
1514
|
MEASURE NODES (category measure) turn shape into attributes for masks and colour:
|
|
895
1515
|
curvature type mean|gaussian|principal_min|principal_max|convexity (1/m; normalize → 0..1) — wear on convex edges
|
|
896
1516
|
occlusion mode occlusion → ao 0..1 | cavity → cavity 0..1 | thickness → metres (rays inward; closed meshes);
|
|
@@ -952,20 +1572,30 @@ LIMITS: collision is per point plus sharp corners (a sharp collider edge can pas
|
|
|
952
1572
|
chamfer; shape 1 = squarer, -0.5 = flat, -1 = cove). Only the rim of a slab: extrude → poly_bevel {group:"border:top"}.
|
|
953
1573
|
13) Clean asset pipeline: imported/broken mesh → mesh_repair (fuse, winding, small holes; report in detail repair_report)
|
|
954
1574
|
→ remesh_isotropic {target_length, feature_angle:40} (even triangles before uv_unwrap or simulation; target_attrib for
|
|
955
|
-
adaptive size) → uv_unwrap → lod {levels:4, ratios:[1,0.5,0.25,0.1]} (prim lod + name
|
|
956
|
-
|
|
1575
|
+
adaptive size) → uv_unwrap → lod {levels:4, ratios:[1,0.5,0.25,0.1]} (prim lod + name {name}_lod0… from name_format,
|
|
1576
|
+
export split_by_name; group "@name=magazine" for one part; mode switch + level for one level, named the same way) or
|
|
1577
|
+
decimate {ratio, attributes:"uv N"} for one level. A level that stops short warns with what holds it (uv seams, hard
|
|
1578
|
+
normals, group / prim attribute borders): reduce before unwrapping and compute vertex normals after lod. remesh_quad {target_faces:2000, feature_angle:45} produces field-aligned
|
|
957
1579
|
quad-dominant polygons with point/vertex/prim attributes; mode:"quads_only" conformingly subdivides all faces and can
|
|
958
1580
|
exceed target_faces, especially along hard curves. crease_group aligns explicit edges; group keeps its border fixed.
|
|
959
1581
|
Inspect detail quad_fraction and singularities, and the wireframe (examples/quad_remesh.json). remesh (voxel) only
|
|
960
1582
|
when the input is beyond repair (it drops attributes).
|
|
961
|
-
14) Street from
|
|
962
|
-
{side_offset, both_sides}; a house = four
|
|
963
|
-
|
|
964
|
-
or
|
|
1583
|
+
14) Street from TopoTopo's own packages (help topic packages): topotopo/street/road_strip on a line →
|
|
1584
|
+
topotopo/street/lamp_post packed onto points_along_curve {side_offset, both_sides}; a house = four
|
|
1585
|
+
topotopo/architecture/wall_segment walls (the street-facing one rotated 180°, sides ±90°, door:true on the front) +
|
|
1586
|
+
topotopo/architecture/roof_gable or roof_hip translated to the wall top; topotopo/street/fence and bench,
|
|
1587
|
+
topotopo/props/crate and topotopo/nature/tree_lowpoly placed with transform or copy_to_points;
|
|
1588
|
+
topotopo/nature/forest_patch on a grid for a park. Whole graph: examples/street_block.json.`,
|
|
965
1589
|
};
|
|
966
1590
|
export function topicList() {
|
|
967
1591
|
return Object.keys(TOPICS);
|
|
968
1592
|
}
|
|
1593
|
+
/** A help topic's text ("overview" or "instructions": the operating guide), or null for a name that is not a topic. */
|
|
1594
|
+
export function topicText(name) {
|
|
1595
|
+
if (name === 'overview' || name === 'instructions')
|
|
1596
|
+
return INSTRUCTIONS;
|
|
1597
|
+
return Object.hasOwn(TOPICS, name) ? TOPICS[name] : null;
|
|
1598
|
+
}
|
|
969
1599
|
function paramLine(name, pd) {
|
|
970
1600
|
let d = pd.default;
|
|
971
1601
|
if (pd.type === 'graph')
|
|
@@ -976,11 +1606,21 @@ function paramLine(name, pd) {
|
|
|
976
1606
|
const al = pd.aliases?.length ? ` (aka ${pd.aliases.join(', ')})` : '';
|
|
977
1607
|
return ` ${name} ${pd.type}${opts}${def}${range} — ${pd.desc}${al}`;
|
|
978
1608
|
}
|
|
1609
|
+
/**
|
|
1610
|
+
* A package output's kind and tags (NodeDef.package) as every listing says them, "mesh [conifer, low-poly]" (a working
|
|
1611
|
+
* folder's output that pins no kind: "kind not pinned [...]"); '' for other node types.
|
|
1612
|
+
*/
|
|
1613
|
+
export function kindTags(def) {
|
|
1614
|
+
const p = def.package;
|
|
1615
|
+
return p ? `${p.kind ?? 'kind not pinned'}${p.tags?.length ? ` [${p.tags.join(', ')}]` : ''}` : '';
|
|
1616
|
+
}
|
|
979
1617
|
export function nodeDoc(def) {
|
|
980
1618
|
const out = [`## ${def.type} (${def.category})${def.aliases?.length ? ` aka ${def.aliases.join(', ')}` : ''}`];
|
|
981
1619
|
if (def.deprecated)
|
|
982
1620
|
out.push(`DEPRECATED: ${def.deprecated}`);
|
|
983
1621
|
out.push(def.summary);
|
|
1622
|
+
if (kindTags(def))
|
|
1623
|
+
out.push(`what it is: ${kindTags(def)}`);
|
|
984
1624
|
if (def.description)
|
|
985
1625
|
out.push(def.description);
|
|
986
1626
|
if (def.usesTime)
|
|
@@ -997,6 +1637,7 @@ export function nodeDoc(def) {
|
|
|
997
1637
|
out.push(`example: ${JSON.stringify(def.example)}`);
|
|
998
1638
|
return out.join('\n');
|
|
999
1639
|
}
|
|
1640
|
+
/** The catalog by category; `cli` ends it with the command line's help flags instead of the MCP help tool. */
|
|
1000
1641
|
export function catalogText(defs, filter) {
|
|
1001
1642
|
let list = defs;
|
|
1002
1643
|
const hidden = filter?.deprecated ? 0 : list.filter((d) => d.deprecated).length;
|
|
@@ -1006,9 +1647,9 @@ export function catalogText(defs, filter) {
|
|
|
1006
1647
|
list = list.filter((d) => d.category === filter.category);
|
|
1007
1648
|
if (filter?.search) {
|
|
1008
1649
|
const s = filter.search.toLowerCase();
|
|
1009
|
-
list = list.filter((d) => (d.type + ' ' + (d.aliases ?? []).join(' ') + ' ' + d.summary + ' ' + (d.description ?? '')).toLowerCase().includes(s));
|
|
1650
|
+
list = list.filter((d) => (d.type + ' ' + (d.aliases ?? []).join(' ') + ' ' + d.summary + ' ' + (d.description ?? '') + ' ' + kindTags(d)).toLowerCase().includes(s));
|
|
1010
1651
|
}
|
|
1011
|
-
const cats = [...new Set([...CATEGORY_ORDER, '
|
|
1652
|
+
const cats = [...new Set([...CATEGORY_ORDER, 'asset', 'package', ...list.map((d) => d.category)])];
|
|
1012
1653
|
const out = [];
|
|
1013
1654
|
for (const c of cats) {
|
|
1014
1655
|
const items = list.filter((d) => d.category === c);
|
|
@@ -1016,9 +1657,11 @@ export function catalogText(defs, filter) {
|
|
|
1016
1657
|
continue;
|
|
1017
1658
|
out.push(`[${c}]`);
|
|
1018
1659
|
for (const d of items)
|
|
1019
|
-
out.push(` ${d.type}${d.inputs.length ? '' : ' ◦'}${d.deprecated ? ' (deprecated)' : ''} — ${d.summary}`);
|
|
1660
|
+
out.push(` ${d.type}${d.inputs.length ? '' : ' ◦'}${d.deprecated ? ' (deprecated)' : ''} — ${d.summary}${kindTags(d) ? ` (${kindTags(d)})` : ''}`);
|
|
1020
1661
|
}
|
|
1021
|
-
out.push(
|
|
1662
|
+
out.push(filter?.cli
|
|
1663
|
+
? '(◦ = generator, no inputs). --help-node <type> for a node\'s params; --help-topic <name> for a topic: overview, ' + topicList().join(', ')
|
|
1664
|
+
: '(◦ = generator, no inputs). Use help {nodes:[...]} for params. Help topics: ' + topicList().join(', '));
|
|
1022
1665
|
if (hidden)
|
|
1023
1666
|
out.push(`${hidden} deprecated node type(s) hidden (include_deprecated: true lists them).`);
|
|
1024
1667
|
return out.join('\n');
|