@threenative/core 0.3.4 → 0.3.5
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/capabilities.json +1505 -79
- package/dist/{audio-7i3Xl0l3.d.ts → audio-DIJE5HTr.d.ts} +43 -3
- package/dist/{canvas-layer-DDmC_VVF.d.ts → canvas-layer-C1-5CviZ.d.ts} +5 -1
- package/dist/{game-CljaDv4D.d.ts → game-Bj8G1wmD.d.ts} +102 -11
- package/dist/hot.d.ts +4 -4
- package/dist/index.d.ts +712 -118
- package/dist/index.js +12423 -4955
- package/dist/{gpu-readback-CqJEfWNQ.d.ts → model-lod-BDAUYgsS.d.ts} +80 -5
- package/dist/playtest.d.ts +6 -10
- package/dist/playtest.js +47 -24
- package/dist/react-css.d.ts +62 -0
- package/dist/react-css.js +591 -0
- package/dist/react.d.ts +2 -2
- package/dist/{renderer-CfsS2hxi.d.ts → renderer-9yEo9hPa.d.ts} +489 -22
- package/dist/terrain-jobs-worker.d.ts +2 -0
- package/dist/terrain-jobs-worker.js +130 -0
- package/dist/ui-layer.js +59 -8
- package/dist/world.d.ts +766 -73
- package/dist/world.js +9307 -3543
- package/gpl/recipes/export_world.py +18 -1
- package/mcp/blender-server.mjs +7 -4
- package/mcp/blender.mjs +3 -4
- package/mcp/engine-server.mjs +2 -2
- package/mcp/servers.mjs +4 -4
- package/package.json +15 -9
- package/patches/three@0.185.1-prd269-upgrade.patch +22418 -0
- package/patches/three@0.185.1.patch +6594 -700
- package/scripts/apply-three-patch.mjs +62 -4
- package/src/animation-blend.ts +264 -0
- package/src/animation-composition.ts +362 -0
- package/src/animation-layers.ts +260 -0
- package/src/animation-root-motion.ts +283 -0
- package/src/animation.ts +896 -0
- package/src/assets.ts +1303 -0
- package/src/atmosphere/index.ts +335 -0
- package/src/atmosphere/luts.ts +298 -0
- package/src/atmosphere/params.ts +323 -0
- package/src/audio.ts +912 -0
- package/src/billboard.ts +124 -0
- package/src/bone-lengths.ts +157 -0
- package/src/camera-shake.ts +116 -0
- package/src/canvas-layer.ts +47 -0
- package/src/clip-audit.ts +401 -0
- package/src/clustered-batch.ts +492 -0
- package/src/clustered-mesh.ts +638 -0
- package/src/compute-driven.ts +176 -0
- package/src/compute-timing.ts +318 -0
- package/src/config.ts +593 -0
- package/src/debug.ts +82 -0
- package/src/engine-render-hook.ts +25 -0
- package/src/entities.ts +79 -0
- package/src/entity-snapshot.ts +53 -0
- package/src/flight.ts +683 -0
- package/src/fluid-field.ts +748 -0
- package/src/fluid-particles.ts +1253 -0
- package/src/frame-budget.ts +1368 -0
- package/src/game.ts +2390 -0
- package/src/geometry-capture.ts +1098 -0
- package/src/gpu-class.ts +160 -0
- package/src/gpu-frame-observation.ts +424 -0
- package/src/gpu-readback.ts +143 -0
- package/src/gpu-scene-bvh.ts +464 -0
- package/src/grounding.ts +100 -0
- package/src/hot.ts +161 -0
- package/src/import-meta.d.ts +13 -0
- package/src/index.ts +1536 -0
- package/src/input.ts +690 -0
- package/src/instanced-batch-lod.ts +283 -0
- package/src/instanced-batch.ts +274 -0
- package/src/interpolation.ts +129 -0
- package/src/launch-diagnostics.ts +161 -0
- package/src/loop.ts +564 -0
- package/src/matrix-world.ts +245 -0
- package/src/merge-parts.ts +812 -0
- package/src/model-lod.ts +1315 -0
- package/src/net-protocol.ts +333 -0
- package/src/net-session.ts +477 -0
- package/src/net.ts +80 -0
- package/src/ocean/fft.ts +72 -0
- package/src/ocean/spectral.ts +728 -0
- package/src/particle-significance.ts +102 -0
- package/src/particles.ts +648 -0
- package/src/path-follow.ts +175 -0
- package/src/picking.ts +250 -0
- package/src/pipeline-census.ts +1566 -0
- package/src/platform.ts +210 -0
- package/src/playtest.ts +839 -0
- package/src/pointer-events.ts +411 -0
- package/src/pose-measure.ts +435 -0
- package/src/profiling/FrameCounters.ts +231 -0
- package/src/profiling/Spans.ts +548 -0
- package/src/profiling/opacity-convention.ts +21 -0
- package/src/profiling/render-list-validate.ts +175 -0
- package/src/profiling/render-trap-audit.ts +84 -0
- package/src/profiling/scene-warning.ts +190 -0
- package/src/profiling/span-probes.ts +191 -0
- package/src/profiling/unlit-foliage-warning.ts +149 -0
- package/src/projection-apply.ts +1529 -0
- package/src/projection-marker.ts +142 -0
- package/src/projection-plan.ts +1258 -0
- package/src/projection-skinned.ts +419 -0
- package/src/projection-stability.ts +409 -0
- package/src/projection-uniform.ts +328 -0
- package/src/random.ts +41 -0
- package/src/react-css.ts +604 -0
- package/src/react-glyphs.ts +114 -0
- package/src/react-host.ts +576 -0
- package/src/react-layout.ts +265 -0
- package/src/react.ts +60 -0
- package/src/render/alpha-antialiasing.ts +159 -0
- package/src/render/batched-velocity.ts +126 -0
- package/src/render/chain.ts +1021 -0
- package/src/render/daylight.ts +189 -0
- package/src/render/depth-pyramid.ts +596 -0
- package/src/render/foliage-alpha.ts +166 -0
- package/src/render/material-key.ts +60 -0
- package/src/render/mesh-pool.ts +144 -0
- package/src/render/probe-volume.ts +1668 -0
- package/src/render/resolution-subrect.ts +253 -0
- package/src/render/velocity.ts +442 -0
- package/src/render/virtual-shadow-pages.ts +827 -0
- package/src/render/virtual-shadow-partial.ts +174 -0
- package/src/render/virtual-shadow.ts +3330 -0
- package/src/render/world-impostor-surface.ts +722 -0
- package/src/render/world-impostor.ts +558 -0
- package/src/render-camera-cull.ts +441 -0
- package/src/render-pass-budget.ts +501 -0
- package/src/renderProjection.ts +758 -0
- package/src/renderer-config.ts +127 -0
- package/src/renderer.ts +1847 -0
- package/src/replay-protocol.ts +85 -0
- package/src/replay.ts +205 -0
- package/src/resolution-scaler.ts +819 -0
- package/src/rig-preparation.ts +271 -0
- package/src/ripple-field.ts +432 -0
- package/src/scale.ts +109 -0
- package/src/scene.ts +239 -0
- package/src/schedule.ts +155 -0
- package/src/skeletal-mesh.ts +61 -0
- package/src/skeleton.ts +100 -0
- package/src/snow-field.ts +744 -0
- package/src/softbody-topology.ts +269 -0
- package/src/softbody.ts +516 -0
- package/src/sprite-animator.ts +222 -0
- package/src/startup-readiness.ts +386 -0
- package/src/state.ts +66 -0
- package/src/static-transform.ts +274 -0
- package/src/storage-buffer.ts +253 -0
- package/src/streaming.ts +308 -0
- package/src/target-fps.ts +92 -0
- package/src/terrain-jobs-worker.ts +17 -0
- package/src/terrain-jobs.ts +353 -0
- package/src/textures.ts +39 -0
- package/src/tracers.ts +237 -0
- package/src/ui-bridge.ts +368 -0
- package/src/ui-hit-regions.ts +380 -0
- package/src/ui-layer.ts +83 -0
- package/src/ui-state.ts +220 -0
- package/src/version.ts +2 -0
- package/src/viewport.ts +253 -0
- package/src/warmup.ts +1357 -0
- package/src/water-surface.ts +384 -0
- package/src/wave-field.ts +524 -0
- package/src/world-capabilities.ts +131 -0
- package/src/world-cell-proxy.ts +392 -0
- package/src/world-cells.ts +10564 -0
- package/src/world-gpu-scene.ts +3354 -0
- package/src/world-heightmap.ts +82 -0
- package/src/world-package.ts +469 -0
- package/src/world-passes.ts +582 -0
- package/src/world-region.ts +17 -0
- package/src/world-terrain-splat.ts +564 -0
- package/src/world-tiles.ts +3826 -0
- package/src/world-topology.ts +370 -0
- package/src/world-validate.ts +48 -0
- package/src/world.ts +805 -0
|
@@ -388,6 +388,8 @@ def skipped_collections(layer, under_hidden=False):
|
|
|
388
388
|
|
|
389
389
|
def terrain_layer_texture(table_dir, textures, layer_id, kind):
|
|
390
390
|
"""The source file of one texture set's map, searched in the table's `textures.search` dirs."""
|
|
391
|
+
if kind not in textures:
|
|
392
|
+
fail("terrain layers: the table names no '%s' texture for a layer that asks for one" % kind)
|
|
391
393
|
name = textures[kind].replace("{id}", layer_id)
|
|
392
394
|
for relative in textures.get("search", ["."]):
|
|
393
395
|
base = os.path.normpath(os.path.join(table_dir, relative))
|
|
@@ -422,7 +424,9 @@ def export_terrain_layers(out, table_path, root=None):
|
|
|
422
424
|
The table (the game's; its DCC shader can read the same file) names its masks, texture sets and
|
|
423
425
|
blend values. This writes `terrain/layers.json` (the table plus the splat layout),
|
|
424
426
|
`terrain/splat.rgba8` (masks packed into RGBA8 planes, raw so no cook converts them) and
|
|
425
|
-
`terrain/tex/<id>_diff.jpg`
|
|
427
|
+
`terrain/tex/<id>_diff.jpg`, `<id>_nrm.jpg` and `<id>_orm.jpg`, and returns the
|
|
428
|
+
`terrain.layers` paths. A layer's `normal` and `orm` flags say which maps it ships, and its
|
|
429
|
+
`roughness`/`metalness` say how it answers light when it ships no ORM map.
|
|
426
430
|
Relative paths in the table resolve against `root` when given, else the table's folder.
|
|
427
431
|
"""
|
|
428
432
|
import numpy as np
|
|
@@ -476,6 +480,19 @@ def export_terrain_layers(out, table_path, root=None):
|
|
|
476
480
|
terrain_layer_texture(table_dir, textures, layer["id"], "nrm"),
|
|
477
481
|
os.path.join(tex, "%s_nrm.jpg" % layer["id"]),
|
|
478
482
|
)
|
|
483
|
+
if layer.get("orm"):
|
|
484
|
+
# A material with a roughness input of its own ships that input as occlusion,
|
|
485
|
+
# roughness and metalness; the table's numbers stand in for one without it.
|
|
486
|
+
shutil.copyfile(
|
|
487
|
+
terrain_layer_texture(table_dir, textures, layer["id"], "orm"),
|
|
488
|
+
os.path.join(tex, "%s_orm.jpg" % layer["id"]),
|
|
489
|
+
)
|
|
490
|
+
if layer.get("height"):
|
|
491
|
+
# The layer's own height, which the game's `layerWeight` reads; fails closed like orm.
|
|
492
|
+
shutil.copyfile(
|
|
493
|
+
terrain_layer_texture(table_dir, textures, layer["id"], "h"),
|
|
494
|
+
os.path.join(tex, "%s_h.jpg" % layer["id"]),
|
|
495
|
+
)
|
|
479
496
|
|
|
480
497
|
shipped = {key: table[key] for key in ("base", "breakup", "macro", "layers")}
|
|
481
498
|
shipped["splat"] = {"masks": placed, "planes": len(planes), "size": size}
|
package/mcp/blender-server.mjs
CHANGED
|
@@ -439,7 +439,7 @@ async function runRecipe(name, request, options = {}) {
|
|
|
439
439
|
|
|
440
440
|
// src/index.ts
|
|
441
441
|
var SERVER_NAME = "threenative-blender-mcp";
|
|
442
|
-
var SERVER_VERSION = "0.1.
|
|
442
|
+
var SERVER_VERSION = "0.1.5";
|
|
443
443
|
var AUTHORING_INSTRUCTIONS = "Call blender_status before anything else: it answers whether this machine can convert models at all, and when it cannot it names the install command rather than failing. Blender is never installed for the user \u2014 ask first, then let them run the command. An .fbx, .blend, .obj or .dae placed in a game's assets directory is converted by the build itself; these tools are for inspecting a source before committing it and for operations the build does not perform. For anything no named tool covers, read a shipped recipe with blender_recipes and adapt it, then run it with blender_run_python.";
|
|
444
444
|
var TOOL_DEFINITIONS = [
|
|
445
445
|
{
|
|
@@ -626,10 +626,13 @@ async function handleToolCall(params) {
|
|
|
626
626
|
}
|
|
627
627
|
if (name === "blender_run_python") {
|
|
628
628
|
const script = requiredString(argumentsValue, "script", "blender_run_python");
|
|
629
|
-
const request =
|
|
629
|
+
const request = argumentsValue.arguments === void 0 ? {} : argumentsValue.arguments;
|
|
630
|
+
if (!isRecord(request)) throw new Error("blender_run_python 'arguments' must be an object.");
|
|
630
631
|
const timeoutMs = argumentsValue.timeoutMs;
|
|
631
|
-
if (timeoutMs !== void 0 && typeof timeoutMs !== "number") {
|
|
632
|
-
throw new Error(
|
|
632
|
+
if (timeoutMs !== void 0 && (typeof timeoutMs !== "number" || !Number.isInteger(timeoutMs) || timeoutMs <= 0)) {
|
|
633
|
+
throw new Error(
|
|
634
|
+
"blender_run_python 'timeoutMs' must be a positive whole number of milliseconds."
|
|
635
|
+
);
|
|
633
636
|
}
|
|
634
637
|
return toolText(
|
|
635
638
|
await runBlenderScript(script, request, timeoutMs === void 0 ? {} : { timeoutMs })
|
package/mcp/blender.mjs
CHANGED
|
@@ -8,10 +8,9 @@ import { MCP_PACKAGES } from "./servers.mjs";
|
|
|
8
8
|
// Core carries the built server beside this shim, so a project that installed `@threenative/core`
|
|
9
9
|
// has working Blender tools with no network and no extra install.
|
|
10
10
|
//
|
|
11
|
-
// `blender-server.mjs` is generated by `scripts/bundle-blender-mcp.mjs` **and committed**,
|
|
12
|
-
// its `engine-server.mjs` neighbour
|
|
13
|
-
//
|
|
14
|
-
// a missing bundle becomes
|
|
11
|
+
// `blender-server.mjs` is generated by `scripts/bundle-blender-mcp.mjs` **and committed**, as is
|
|
12
|
+
// its `engine-server.mjs` neighbour. It must stay that way: the npx fallback below cannot work for
|
|
13
|
+
// this server, because `threenative-blender-mcp` has never been published — a missing bundle becomes
|
|
15
14
|
//
|
|
16
15
|
// threenative-blender exited before completing MCP requests (1): npm error code E404
|
|
17
16
|
//
|
package/mcp/engine-server.mjs
CHANGED
|
@@ -472,7 +472,7 @@ function handleToolCall(params, manifestFile) {
|
|
|
472
472
|
if (name === "engine_search_capabilities") {
|
|
473
473
|
if (typeof argumentsValue.situation !== "string")
|
|
474
474
|
throw new Error("engine_search_capabilities requires a string 'situation' argument.");
|
|
475
|
-
const scope = argumentsValue.scope
|
|
475
|
+
const scope = argumentsValue.scope === void 0 ? "mechanic" : argumentsValue.scope;
|
|
476
476
|
if (scope !== "request" && scope !== "mechanic")
|
|
477
477
|
throw new Error("engine_search_capabilities scope must be 'request' or 'mechanic'.");
|
|
478
478
|
const response = searchCapabilities(argumentsValue.situation, manifestFile, scope);
|
|
@@ -524,7 +524,7 @@ function handleLine(line, manifestFile) {
|
|
|
524
524
|
capabilities: { tools: { listChanged: false } },
|
|
525
525
|
instructions: AUTHORING_INSTRUCTIONS,
|
|
526
526
|
protocolVersion: "2025-06-18",
|
|
527
|
-
serverInfo: { name: "threenative-engine-mcp", version: "0.2.
|
|
527
|
+
serverInfo: { name: "threenative-engine-mcp", version: "0.2.5" }
|
|
528
528
|
});
|
|
529
529
|
}
|
|
530
530
|
if (request.method === "tools/list") {
|
package/mcp/servers.mjs
CHANGED
|
@@ -38,10 +38,10 @@ export const MCP_SERVERS = Object.freeze({
|
|
|
38
38
|
* separately. The pinned engine version remains an emergency fallback for a legacy development
|
|
39
39
|
* checkout whose bundle has not been built. */
|
|
40
40
|
export const MCP_PACKAGES = Object.freeze({
|
|
41
|
-
assets: Object.freeze({ name: "threenative-asset-mcp", version: "0.
|
|
42
|
-
sculpt: Object.freeze({ name: "threenative-sculpt-mcp", version: "0.
|
|
43
|
-
engine: Object.freeze({ name: "threenative-engine-mcp", version: "0.2.
|
|
44
|
-
blender: Object.freeze({ name: "threenative-blender-mcp", version: "0.1.
|
|
41
|
+
assets: Object.freeze({ name: "threenative-asset-mcp", version: "0.14.0" }),
|
|
42
|
+
sculpt: Object.freeze({ name: "threenative-sculpt-mcp", version: "0.2.2" }),
|
|
43
|
+
engine: Object.freeze({ name: "threenative-engine-mcp", version: "0.2.5" }),
|
|
44
|
+
blender: Object.freeze({ name: "threenative-blender-mcp", version: "0.1.5" }),
|
|
45
45
|
});
|
|
46
46
|
|
|
47
47
|
/** How one host spells a stdio MCP server. Hosts agree on what to run and disagree on where to
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@threenative/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"license": "MIT AND GPL-2.0-or-later",
|
|
5
5
|
"description": "The small vanilla Three.js game runtime foundation.",
|
|
6
6
|
"keywords": [
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
"scripts/postinstall.mjs",
|
|
34
34
|
"patches",
|
|
35
35
|
"capabilities.json",
|
|
36
|
-
"README.md"
|
|
36
|
+
"README.md",
|
|
37
|
+
"src/**/*.ts"
|
|
37
38
|
],
|
|
38
39
|
"main": "./dist/index.js",
|
|
39
40
|
"module": "./dist/index.js",
|
|
@@ -55,6 +56,10 @@
|
|
|
55
56
|
"types": "./dist/react.d.ts",
|
|
56
57
|
"import": "./dist/react.js"
|
|
57
58
|
},
|
|
59
|
+
"./react-css": {
|
|
60
|
+
"types": "./dist/react-css.d.ts",
|
|
61
|
+
"import": "./dist/react-css.js"
|
|
62
|
+
},
|
|
58
63
|
"./ui-layer": {
|
|
59
64
|
"types": "./dist/ui-layer.d.ts",
|
|
60
65
|
"import": "./dist/ui-layer.js"
|
|
@@ -76,8 +81,8 @@
|
|
|
76
81
|
"dependencies": {
|
|
77
82
|
"three": "0.185.1",
|
|
78
83
|
"three-mesh-bvh": "0.9.14",
|
|
79
|
-
"threenative-asset-mcp": "0.
|
|
80
|
-
"threenative-sculpt-mcp": "0.
|
|
84
|
+
"threenative-asset-mcp": "0.14.0",
|
|
85
|
+
"threenative-sculpt-mcp": "0.2.2",
|
|
81
86
|
"zustand": "5.0.14"
|
|
82
87
|
},
|
|
83
88
|
"devDependencies": {
|
|
@@ -88,13 +93,14 @@
|
|
|
88
93
|
"react": "19.2.0",
|
|
89
94
|
"react-reconciler": "0.33.0",
|
|
90
95
|
"tsup": "8.5.1",
|
|
91
|
-
"typescript": "
|
|
92
|
-
"@
|
|
93
|
-
"threenative-
|
|
94
|
-
"threenative-
|
|
96
|
+
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
97
|
+
"@typescript/native": "npm:typescript@7.0.2",
|
|
98
|
+
"threenative-blender-mcp": "0.1.5",
|
|
99
|
+
"threenative-engine-mcp": "0.2.5",
|
|
100
|
+
"@threenative/playtest": "0.3.5"
|
|
95
101
|
},
|
|
96
102
|
"peerDependencies": {
|
|
97
|
-
"@threenative/playtest": ">=0.3.
|
|
103
|
+
"@threenative/playtest": ">=0.3.5 <0.4.0",
|
|
98
104
|
"react": ">=19.2.0 <20",
|
|
99
105
|
"react-reconciler": ">=0.33.0 <0.34"
|
|
100
106
|
},
|