@deepblend/dsh-blender-contracts 0.25.0 → 0.27.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/lib/recipe-parameters.js +25 -11
- package/lib/recipe.js +19 -9
- package/lib/schema-types.d.ts +3 -3
- package/lib/schemas/recipe.schema.json +46 -2
- package/package.json +1 -1
package/lib/recipe-parameters.js
CHANGED
|
@@ -9,11 +9,19 @@ import { instantiateRecipeLock, RecipeError } from './recipe.js'
|
|
|
9
9
|
import { validateSceneSpec } from './scene-spec.js'
|
|
10
10
|
|
|
11
11
|
const axisOf = binding => ['x', 'y', 'z'].indexOf(binding.axis)
|
|
12
|
-
const structural = parameter => parameter.bindings.some(binding => ['entity', 'generator', 'lathe-shell', 'curve-point'].includes(binding.kind))
|
|
13
|
-
&& parameter.bindings.every(binding => ['entity', 'camera', 'generator', 'lathe-shell', 'curve-point'].includes(binding.kind))
|
|
12
|
+
const structural = parameter => parameter.bindings.some(binding => ['entity', 'generator', 'lathe-shell', 'curve-point', 'array'].includes(binding.kind))
|
|
13
|
+
&& parameter.bindings.every(binding => ['entity', 'camera', 'generator', 'lathe-shell', 'curve-point', 'array'].includes(binding.kind))
|
|
14
14
|
const entity = (spec, id) => spec.entities.find(item => item.id === id)
|
|
15
15
|
const vector = (target, property) => property === 'dimensions' ? target?.generator?.dimensions
|
|
16
16
|
: property === 'targetPoint' ? target?.targetPoint : target?.transform?.location
|
|
17
|
+
const boundValue = (target, binding) => {
|
|
18
|
+
if (binding.kind === 'array') return target?.modifiers?.[binding.modifierIndex]?.offset?.[axisOf(binding)]
|
|
19
|
+
if (binding.kind === 'curve-point') return target?.generator?.path?.[binding.pointIndex]?.[axisOf(binding)]
|
|
20
|
+
if (binding.kind === 'generator') return target?.generator?.[binding.property]
|
|
21
|
+
return vector(target, binding.property)?.[axisOf(binding)]
|
|
22
|
+
}
|
|
23
|
+
const arrayLayout = target => (target?.modifiers ?? []).flatMap((modifier, index) =>
|
|
24
|
+
modifier.type === 'array' ? [{ index, ...modifier }] : [])
|
|
17
25
|
const close = (a, b) => Array.isArray(a) && Array.isArray(b)
|
|
18
26
|
? a.length === b.length && a.every((value, index) => close(value, b[index]))
|
|
19
27
|
: Number.isFinite(a) && Number.isFinite(b)
|
|
@@ -54,14 +62,16 @@ export function planRecipeGeometryEdit(lock, currentSpec, parameterState, change
|
|
|
54
62
|
}
|
|
55
63
|
const conflicts = []
|
|
56
64
|
for (const parameter of parameters) for (const binding of targets(parameter)) {
|
|
57
|
-
if (!['entity', 'generator', 'curve-point'].includes(binding.kind)) continue
|
|
65
|
+
if (!['entity', 'generator', 'curve-point', 'array'].includes(binding.kind)) continue
|
|
58
66
|
const oldEntity = entity(before.spec, binding.entityId), currentEntity = entity(currentSpec, binding.entityId)
|
|
59
|
-
const expected =
|
|
60
|
-
|
|
61
|
-
const actual = binding.kind === 'curve-point' ? currentEntity?.generator?.path?.[binding.pointIndex]?.[axisOf(binding)] : binding.kind === 'generator' ? currentEntity?.generator?.[binding.property]
|
|
62
|
-
: vector(currentEntity, binding.property)?.[axisOf(binding)]
|
|
67
|
+
const expected = boundValue(oldEntity, binding)
|
|
68
|
+
const actual = boundValue(currentEntity, binding)
|
|
63
69
|
if (!close(actual, expected)) conflicts.push({ parameterId: parameter.id, entityId: binding.entityId,
|
|
64
70
|
property: binding.kind === 'curve-point' ? `path.${binding.pointIndex}` : binding.property, axis: binding.axis, expected, actual })
|
|
71
|
+
if (binding.kind === 'array' && canonicalStringify(arrayLayout(currentEntity)) !== canonicalStringify(arrayLayout(oldEntity))) {
|
|
72
|
+
conflicts.push({ parameterId: parameter.id, entityId: binding.entityId, property: 'array-layout',
|
|
73
|
+
expected: arrayLayout(oldEntity), actual: arrayLayout(currentEntity) })
|
|
74
|
+
}
|
|
65
75
|
if (['generator', 'curve-point'].includes(binding.kind) && currentEntity?.generator?.shape !== oldEntity?.generator?.shape) {
|
|
66
76
|
conflicts.push({ parameterId: parameter.id, entityId: binding.entityId, property: 'shape',
|
|
67
77
|
expected: oldEntity?.generator?.shape, actual: currentEntity?.generator?.shape })
|
|
@@ -76,8 +86,8 @@ export function planRecipeGeometryEdit(lock, currentSpec, parameterState, change
|
|
|
76
86
|
conflicts.push({ parameterId: parameter.id, entityId: binding.entityId,
|
|
77
87
|
property: 'shell-alignment', expected: oldEntity?.transform, actual: currentEntity?.transform })
|
|
78
88
|
}
|
|
79
|
-
if (binding.property === 'dimensions' || ['generator', 'curve-point'].includes(binding.kind)) {
|
|
80
|
-
if (binding.property === 'dimensions' && (currentEntity?.generator?.shape !== oldEntity?.generator?.shape
|
|
89
|
+
if (binding.property === 'dimensions' || ['generator', 'curve-point', 'array'].includes(binding.kind)) {
|
|
90
|
+
if ((binding.property === 'dimensions' || binding.kind === 'array') && (currentEntity?.generator?.shape !== oldEntity?.generator?.shape
|
|
81
91
|
|| !close(currentEntity?.transform?.rotationEuler ?? [0, 0, 0], oldEntity?.transform?.rotationEuler ?? [0, 0, 0]))) {
|
|
82
92
|
conflicts.push({ parameterId: parameter.id, entityId: binding.entityId,
|
|
83
93
|
property: 'dimension-alignment', expected: oldEntity?.transform?.rotationEuler, actual: currentEntity?.transform?.rotationEuler })
|
|
@@ -95,7 +105,7 @@ export function planRecipeGeometryEdit(lock, currentSpec, parameterState, change
|
|
|
95
105
|
|
|
96
106
|
const changed = parameters.filter(parameter => before.values[parameter.id] !== after.values[parameter.id]
|
|
97
107
|
|| assembly && !parameterState?.assemblyRepair && Object.keys(changes).includes(parameter.id))
|
|
98
|
-
const generators = new Map(), locations = new Map(), cameras = new Map(), tracks = new Map(), animationOffsets = new Map()
|
|
108
|
+
const generators = new Map(), modifierEdits = new Map(), locations = new Map(), cameras = new Map(), tracks = new Map(), animationOffsets = new Map()
|
|
99
109
|
const protectedCameras = new Set()
|
|
100
110
|
for (const parameter of changed) for (const binding of targets(parameter)) {
|
|
101
111
|
const axis = axisOf(binding)
|
|
@@ -114,7 +124,10 @@ export function planRecipeGeometryEdit(lock, currentSpec, parameterState, change
|
|
|
114
124
|
continue
|
|
115
125
|
}
|
|
116
126
|
const actual = entity(currentSpec, binding.entityId), target = entity(after.spec, binding.entityId)
|
|
117
|
-
if (binding.kind === '
|
|
127
|
+
if (binding.kind === 'array') {
|
|
128
|
+
if (!modifierEdits.has(actual.id)) modifierEdits.set(actual.id, structuredClone(actual.modifiers))
|
|
129
|
+
modifierEdits.get(actual.id)[binding.modifierIndex].offset[axis] = target.modifiers[binding.modifierIndex].offset[axis]
|
|
130
|
+
} else if (binding.kind === 'curve-point') {
|
|
118
131
|
if (close(actual.generator.path[binding.pointIndex][axis], target.generator.path[binding.pointIndex][axis])) continue
|
|
119
132
|
if (!generators.has(actual.id)) generators.set(actual.id, structuredClone(actual.generator))
|
|
120
133
|
generators.get(actual.id).path[binding.pointIndex][axis] = target.generator.path[binding.pointIndex][axis]
|
|
@@ -150,6 +163,7 @@ export function planRecipeGeometryEdit(lock, currentSpec, parameterState, change
|
|
|
150
163
|
}
|
|
151
164
|
const operations = [
|
|
152
165
|
...[...generators].map(([entityId, generator]) => ({ op: 'entity.generator.set', entityId, generator })),
|
|
166
|
+
...[...modifierEdits].map(([entityId, modifiers]) => ({ op: 'entity.modifiers.set', entityId, modifiers })),
|
|
153
167
|
...[...locations].map(([entityId, location]) => ({ op: 'entity.transform.update', entityId, location })),
|
|
154
168
|
...cameras.values(),
|
|
155
169
|
...[...tracks.values()].map(track => ({ op: 'animation.track.set', track })),
|
package/lib/recipe.js
CHANGED
|
@@ -3,20 +3,21 @@ import { inflateSync } from 'node:zlib'
|
|
|
3
3
|
import { sha256, sha256Canonical } from './canonical.js'
|
|
4
4
|
import { compileSchema } from './json-schema.js'
|
|
5
5
|
import { decodePng } from './png.js'
|
|
6
|
-
import { validateSceneSpec, compileSceneSpec, BOX_DIMENSIONS_FEATURE, MESH_GEOMETRY_FEATURE, SUBDIVISION_FEATURE, SURFACE_SCATTER_FEATURE, requiredSceneFeatures } from './scene-spec.js'
|
|
6
|
+
import { validateSceneSpec, compileSceneSpec, BOX_DIMENSIONS_FEATURE, HALF_LAP_FEATURE, MESH_GEOMETRY_FEATURE, SUBDIVISION_FEATURE, SURFACE_SCATTER_FEATURE, requiredSceneFeatures } from './scene-spec.js'
|
|
7
7
|
import { deformLatheShell, latheShellTargets } from './lathe-shell.js'
|
|
8
8
|
import recipeSchema from './schemas/recipe.schema.json' with { type: 'json' }
|
|
9
9
|
|
|
10
10
|
export const RECIPE_SCHEMA_VERSION = 'deepblend.recipe/v1'
|
|
11
11
|
export const RECIPE_CAPABILITIES = Object.freeze([
|
|
12
12
|
'geometry.primitive', BOX_DIMENSIONS_FEATURE, 'geometry.lathe', 'geometry.curve', 'geometry.handled_cup', 'geometry.handled_cup.tension', 'geometry.handled_cup.tension.extended', 'geometry.modifiers',
|
|
13
|
-
MESH_GEOMETRY_FEATURE, SUBDIVISION_FEATURE, SURFACE_SCATTER_FEATURE,
|
|
13
|
+
MESH_GEOMETRY_FEATURE, SUBDIVISION_FEATURE, SURFACE_SCATTER_FEATURE, HALF_LAP_FEATURE,
|
|
14
14
|
'material.principled', 'material.glass', 'material.emission', 'material.procedural', 'material.procedural.uv', 'material.anisotropy',
|
|
15
15
|
'animation.transform', 'animation.material',
|
|
16
16
|
'recipe.geometry-bindings',
|
|
17
17
|
'recipe.generator-bindings',
|
|
18
18
|
'recipe.lathe-shell-bindings',
|
|
19
19
|
'recipe.curve-point-bindings',
|
|
20
|
+
'recipe.array-bindings',
|
|
20
21
|
'recipe.threshold-bindings',
|
|
21
22
|
])
|
|
22
23
|
export const RECIPE_LIMITS = Object.freeze({ sceneBytes: 2 * 1024 * 1024, previewBytes: 4 * 1024 * 1024, previewPixels: 4 * 1024 * 1024 })
|
|
@@ -31,8 +32,13 @@ const bindingAxis = binding => ['x', 'y', 'z'].indexOf(binding.axis)
|
|
|
31
32
|
const bindingTarget = (spec, binding) => binding.kind === 'camera' ? spec.cameras?.find(item => item.id === binding.cameraId) : spec.entities.find(item => item.id === binding.entityId)
|
|
32
33
|
const bindingDelta = (value, parameter, binding) => ((binding.inputFloor === undefined ? value : Math.max(value, binding.inputFloor))
|
|
33
34
|
- (binding.inputFloor === undefined ? parameter.default : Math.max(parameter.default, binding.inputFloor))) * binding.multiplier
|
|
34
|
-
const bindingVector = (target, binding) =>
|
|
35
|
-
|
|
35
|
+
const bindingVector = (target, binding) => {
|
|
36
|
+
if (binding.kind === 'array') return target?.modifiers?.[binding.modifierIndex]?.offset
|
|
37
|
+
if (binding.kind === 'curve-point') return target?.generator?.path?.[binding.pointIndex]
|
|
38
|
+
if (binding.property === 'dimensions') return target?.generator?.dimensions
|
|
39
|
+
if (binding.property === 'targetPoint') return target?.targetPoint
|
|
40
|
+
return target?.transform?.location
|
|
41
|
+
}
|
|
36
42
|
const bindingTracks = (spec, binding) => (spec.animationTracks ?? []).filter(track => (track.targetKind ?? 'entity') === binding.kind
|
|
37
43
|
&& track.targetEntityId === (binding.entityId ?? binding.cameraId) && track.property === `location.${binding.axis}`)
|
|
38
44
|
|
|
@@ -112,6 +118,7 @@ export function validateRecipeManifest(manifest, options = {}) {
|
|
|
112
118
|
const target = slot.kind === 'material' ? `material:${slot.materialId}:${slot.property}`
|
|
113
119
|
: slot.kind === 'curve-point' ? `curve-point:${slot.entityId}:${slot.pointIndex}.${slot.axis}`
|
|
114
120
|
: slot.kind === 'generator' ? `generator:${slot.entityId}:${slot.property}`
|
|
121
|
+
: slot.kind === 'array' ? `array:${slot.entityId}:${slot.modifierIndex}.${slot.axis}`
|
|
115
122
|
: ['entity', 'camera'].includes(slot.kind) ? `${slot.kind}:${slot.entityId ?? slot.cameraId}:${slot.property}.${slot.axis}` : `render-profile:${slot.profile}:exposure`
|
|
116
123
|
const prior = targets.get(target)
|
|
117
124
|
// Camera framing may add independent width/depth/height deltas. Repeating a
|
|
@@ -123,12 +130,13 @@ export function validateRecipeManifest(manifest, options = {}) {
|
|
|
123
130
|
const color = binding.kind === 'material' && binding.property === 'baseColor'
|
|
124
131
|
if ((parameter.type === 'color') !== color) errors.push(issue('RECIPE_BINDING_INVALID', path, 'Parameter type does not match the allowlisted property'))
|
|
125
132
|
if (parameter.type === 'number') {
|
|
126
|
-
if (['entity', 'camera', 'generator', 'lathe-shell', 'curve-point'].includes(binding.kind)) {
|
|
133
|
+
if (['entity', 'camera', 'generator', 'lathe-shell', 'curve-point', 'array'].includes(binding.kind)) {
|
|
127
134
|
if (!Number.isFinite(binding.multiplier) || binding.multiplier === 0) errors.push(issue('RECIPE_BINDING_INVALID', path, 'Entity binding multiplier must be finite and nonzero'))
|
|
128
135
|
if (!declared.has('recipe.geometry-bindings')) errors.push(issue('RECIPE_CAPABILITY_UNDECLARED', path, 'Entity bindings require recipe.geometry-bindings'))
|
|
129
136
|
if (binding.kind === 'generator' && !declared.has('recipe.generator-bindings')) errors.push(issue('RECIPE_CAPABILITY_UNDECLARED', path, 'Generator bindings require recipe.generator-bindings'))
|
|
130
137
|
if (binding.kind === 'lathe-shell' && !declared.has('recipe.lathe-shell-bindings')) errors.push(issue('RECIPE_CAPABILITY_UNDECLARED', path, 'Lathe shell bindings require recipe.lathe-shell-bindings'))
|
|
131
138
|
if (binding.kind === 'curve-point' && !declared.has('recipe.curve-point-bindings')) errors.push(issue('RECIPE_CAPABILITY_UNDECLARED', path, 'Curve points require recipe.curve-point-bindings'))
|
|
139
|
+
if (binding.kind === 'array' && !declared.has('recipe.array-bindings')) errors.push(issue('RECIPE_CAPABILITY_UNDECLARED', path, 'Array offsets require recipe.array-bindings'))
|
|
132
140
|
if (binding.inputFloor !== undefined && (!declared.has('recipe.threshold-bindings') || binding.inputFloor < parameter.minimum || binding.inputFloor > parameter.maximum)) errors.push(issue('RECIPE_BINDING_INVALID', path, 'A threshold must be declared and inside the parameter range'))
|
|
133
141
|
if (binding.property !== 'location' && binding.offsetAnimation !== undefined) errors.push(issue('RECIPE_BINDING_INVALID', path, 'Animation offsets are only valid on location bindings'))
|
|
134
142
|
continue
|
|
@@ -223,12 +231,14 @@ function bindingsAgainstScene(manifest, spec) {
|
|
|
223
231
|
}
|
|
224
232
|
const ends = [parameter.minimum, parameter.maximum].map(value => current + bindingDelta(value, parameter, binding))
|
|
225
233
|
if (ends.some(value => !Number.isFinite(value) || value <= 0)) errors.push(issue('RECIPE_BINDING_INVALID', path, 'Generator binding range must remain positive and finite'))
|
|
226
|
-
} else if (['entity', 'camera', 'curve-point'].includes(binding.kind)) {
|
|
234
|
+
} else if (['entity', 'camera', 'curve-point', 'array'].includes(binding.kind)) {
|
|
227
235
|
const entity = bindingTarget(spec, binding)
|
|
228
236
|
const vector = bindingVector(entity, binding), axis = bindingAxis(binding)
|
|
229
|
-
if (!entity || (binding.kind === 'curve-point' && entity.generator?.shape !== 'curve')
|
|
237
|
+
if (!entity || (binding.kind === 'curve-point' && entity.generator?.shape !== 'curve')
|
|
238
|
+
|| (binding.kind === 'array' && entity.modifiers?.[binding.modifierIndex]?.type !== 'array')
|
|
239
|
+
|| (binding.property === 'dimensions' && (!['cube', 'rounded_box'].includes(entity.generator?.shape) || entity.generator.size !== undefined))
|
|
230
240
|
|| !Array.isArray(vector) || vector.length !== 3 || !Number.isFinite(vector[axis])) {
|
|
231
|
-
errors.push(issue('RECIPE_BINDING_INVALID', path, 'Structural binding requires an explicit supported dimension, position or aim point'))
|
|
241
|
+
errors.push(issue('RECIPE_BINDING_INVALID', path, 'Structural binding requires an explicit supported dimension, position, array offset or aim point'))
|
|
232
242
|
continue
|
|
233
243
|
}
|
|
234
244
|
const ends = [parameter.minimum, parameter.maximum].map(value => vector[axis] + bindingDelta(value, parameter, binding))
|
|
@@ -369,7 +379,7 @@ function resolveRecipe(manifest, checked, values) {
|
|
|
369
379
|
spec.entities.find(entity => entity.id === binding.linerEntityId).generator.profile = profiles.liner
|
|
370
380
|
} else if (binding.kind === 'generator') {
|
|
371
381
|
bindingTarget(spec, binding).generator[binding.property] += (resolvedValues[parameter.id] - parameter.default) * binding.multiplier
|
|
372
|
-
} else if (['entity', 'camera', 'curve-point'].includes(binding.kind)) {
|
|
382
|
+
} else if (['entity', 'camera', 'curve-point', 'array'].includes(binding.kind)) {
|
|
373
383
|
const vector = bindingVector(bindingTarget(spec, binding), binding)
|
|
374
384
|
// Preserve the input's exact default bytes and avoid cumulative edits.
|
|
375
385
|
if (value !== parameter.default) {
|
package/lib/schema-types.d.ts
CHANGED
|
@@ -73,12 +73,12 @@ export namespace ScenePatchSchema {
|
|
|
73
73
|
}
|
|
74
74
|
export type ScenePatch = ScenePatchSchema.Document;
|
|
75
75
|
|
|
76
|
-
/** Source SHA-256:
|
|
76
|
+
/** Source SHA-256: 9406af739a53068ed013fb29dc399d9794cb452d84c37a7d0402a2520649b4ac */
|
|
77
77
|
export namespace RecipeSchema {
|
|
78
|
-
export type Binding = ({ "kind": "material"; "materialId": string; "property": "baseColor" | "roughness"; }) | ({ "kind": "render-profile"; "profile": "preview" | "final"; "property": "exposure"; }) | ({ "kind": "entity"; "entityId": string; "property": "dimensions" | "location"; "axis": "x" | "y" | "z"; "multiplier": number; "offsetAnimation"?: boolean; "inputFloor"?: number; }) | ({ "kind": "camera"; "cameraId": string; "property": "location" | "targetPoint"; "axis": "x" | "y" | "z"; "multiplier": number; }) | ({ "kind": "generator"; "entityId": string; "property": "height" | "radius" | "wallThickness" | "handleLower" | "handleUpper" | "handleRadius" | "rootRadius" | "rootLength"; "multiplier": number; }) | ({ "kind": "lathe-shell"; "entityId": string; "linerEntityId": string; "outerPointCount": number; "linerStart": number; "linerPointCount": number; "rimHeight": number; "neckAnchorHeight": number; "multiplier": number; }) | ({ "kind": "curve-point"; "entityId": string; "pointIndex": number; "axis": "x" | "y" | "z"; "multiplier": number; "inputFloor"?: number; });
|
|
78
|
+
export type Binding = ({ "kind": "material"; "materialId": string; "property": "baseColor" | "roughness"; }) | ({ "kind": "render-profile"; "profile": "preview" | "final"; "property": "exposure"; }) | ({ "kind": "entity"; "entityId": string; "property": "dimensions" | "location"; "axis": "x" | "y" | "z"; "multiplier": number; "offsetAnimation"?: boolean; "inputFloor"?: number; }) | ({ "kind": "camera"; "cameraId": string; "property": "location" | "targetPoint"; "axis": "x" | "y" | "z"; "multiplier": number; }) | ({ "kind": "generator"; "entityId": string; "property": "height" | "radius" | "wallThickness" | "handleLower" | "handleUpper" | "handleRadius" | "rootRadius" | "rootLength"; "multiplier": number; }) | ({ "kind": "lathe-shell"; "entityId": string; "linerEntityId": string; "outerPointCount": number; "linerStart": number; "linerPointCount": number; "rimHeight": number; "neckAnchorHeight": number; "multiplier": number; }) | ({ "kind": "curve-point"; "entityId": string; "pointIndex": number; "axis": "x" | "y" | "z"; "multiplier": number; "inputFloor"?: number; }) | ({ "kind": "array"; "entityId": string; "modifierIndex": number; "property": "offset"; "axis": "x" | "y" | "z"; "multiplier": number; });
|
|
79
79
|
export type ColorParameter = { "id": string; "title": string; "description"?: string; "bindings": Array<RecipeSchema.Binding>; "type": "color"; "default": [number, number, number]; };
|
|
80
80
|
export type NumberParameter = { "id": string; "title": string; "description"?: string; "bindings": Array<RecipeSchema.Binding>; "type": "number"; "default": number; "minimum": number; "maximum": number; };
|
|
81
|
-
export type Document = { "schemaVersion": "deepblend.recipe/v1"; "id": string; "version": string; "title": string; "description": string; "author": { "name": string; "url"?: string; }; "license": string; "source": { "url": string; "note"?: string; }; "compatibility": { "sceneSchemaVersion": "deepblend.scene/v1"; "capabilities": Array<"geometry.primitive" | "geometry.primitive.dimensions" | "geometry.lathe" | "geometry.curve" | "geometry.handled_cup" | "geometry.handled_cup.tension" | "geometry.handled_cup.tension.extended" | "geometry.modifiers" | "material.principled" | "material.glass" | "material.emission" | "material.procedural" | "material.procedural.uv" | "material.anisotropy" | "animation.transform" | "animation.material" | "recipe.geometry-bindings" | "recipe.generator-bindings" | "recipe.lathe-shell-bindings" | "recipe.curve-point-bindings" | "recipe.threshold-bindings" | "geometry.procedural.mesh" | "geometry.modifier.subdivision" | "geometry.modifier.surface_scatter">; }; "input": { "path": "scene-spec.json"; "sha256": string; }; "preview": { "path": "preview.png"; "sha256": string; "mediaType": "image/png"; "alt": string; }; "parameters": Array<(RecipeSchema.ColorParameter) | (RecipeSchema.NumberParameter)>; };
|
|
81
|
+
export type Document = { "schemaVersion": "deepblend.recipe/v1"; "id": string; "version": string; "title": string; "description": string; "author": { "name": string; "url"?: string; }; "license": string; "source": { "url": string; "note"?: string; }; "compatibility": { "sceneSchemaVersion": "deepblend.scene/v1"; "capabilities": Array<"geometry.primitive" | "geometry.primitive.dimensions" | "geometry.lathe" | "geometry.curve" | "geometry.handled_cup" | "geometry.handled_cup.tension" | "geometry.handled_cup.tension.extended" | "geometry.modifiers" | "material.principled" | "material.glass" | "material.emission" | "material.procedural" | "material.procedural.uv" | "material.anisotropy" | "animation.transform" | "animation.material" | "recipe.geometry-bindings" | "recipe.generator-bindings" | "recipe.lathe-shell-bindings" | "recipe.curve-point-bindings" | "recipe.threshold-bindings" | "geometry.procedural.mesh" | "geometry.modifier.subdivision" | "geometry.modifier.surface_scatter" | "geometry.joinery.half_lap" | "recipe.array-bindings">; }; "input": { "path": "scene-spec.json"; "sha256": string; }; "preview": { "path": "preview.png"; "sha256": string; "mediaType": "image/png"; "alt": string; }; "parameters": Array<(RecipeSchema.ColorParameter) | (RecipeSchema.NumberParameter)>; };
|
|
82
82
|
}
|
|
83
83
|
export type RecipeManifest = RecipeSchema.Document;
|
|
84
84
|
export type Entity = SceneSpecSchema.Entity;
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"capabilities": {
|
|
98
98
|
"type": "array",
|
|
99
99
|
"minItems": 1,
|
|
100
|
-
"maxItems":
|
|
100
|
+
"maxItems": 26,
|
|
101
101
|
"items": {
|
|
102
102
|
"enum": [
|
|
103
103
|
"geometry.primitive",
|
|
@@ -123,7 +123,9 @@
|
|
|
123
123
|
"recipe.threshold-bindings",
|
|
124
124
|
"geometry.procedural.mesh",
|
|
125
125
|
"geometry.modifier.subdivision",
|
|
126
|
-
"geometry.modifier.surface_scatter"
|
|
126
|
+
"geometry.modifier.surface_scatter",
|
|
127
|
+
"geometry.joinery.half_lap",
|
|
128
|
+
"recipe.array-bindings"
|
|
127
129
|
]
|
|
128
130
|
}
|
|
129
131
|
}
|
|
@@ -462,6 +464,48 @@
|
|
|
462
464
|
"maximum": 1000000
|
|
463
465
|
}
|
|
464
466
|
}
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
"type": "object",
|
|
470
|
+
"additionalProperties": false,
|
|
471
|
+
"required": [
|
|
472
|
+
"kind",
|
|
473
|
+
"entityId",
|
|
474
|
+
"modifierIndex",
|
|
475
|
+
"property",
|
|
476
|
+
"axis",
|
|
477
|
+
"multiplier"
|
|
478
|
+
],
|
|
479
|
+
"description": "Apply a bounded parameter delta to one offset axis of an authored array modifier.",
|
|
480
|
+
"properties": {
|
|
481
|
+
"kind": {
|
|
482
|
+
"const": "array"
|
|
483
|
+
},
|
|
484
|
+
"entityId": {
|
|
485
|
+
"type": "string",
|
|
486
|
+
"pattern": "^[a-zA-Z][a-zA-Z0-9._-]{0,63}$"
|
|
487
|
+
},
|
|
488
|
+
"modifierIndex": {
|
|
489
|
+
"type": "integer",
|
|
490
|
+
"minimum": 0,
|
|
491
|
+
"maximum": 7
|
|
492
|
+
},
|
|
493
|
+
"property": {
|
|
494
|
+
"const": "offset"
|
|
495
|
+
},
|
|
496
|
+
"axis": {
|
|
497
|
+
"enum": [
|
|
498
|
+
"x",
|
|
499
|
+
"y",
|
|
500
|
+
"z"
|
|
501
|
+
]
|
|
502
|
+
},
|
|
503
|
+
"multiplier": {
|
|
504
|
+
"type": "number",
|
|
505
|
+
"minimum": -1000,
|
|
506
|
+
"maximum": 1000
|
|
507
|
+
}
|
|
508
|
+
}
|
|
465
509
|
}
|
|
466
510
|
]
|
|
467
511
|
},
|
package/package.json
CHANGED