@deepblend/dsh-blender-contracts 0.22.0 → 0.23.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/mesh-uv.js +69 -0
- package/lib/scene-patch.js +20 -0
- package/lib/schema-types.d.ts +2 -2
- package/lib/schemas/scene-patch.schema.json +28 -0
- package/package.json +1 -1
package/lib/mesh-uv.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { meshGeneratorIssues } from './mesh-geometry.js'
|
|
2
|
+
|
|
3
|
+
const subtract = (a, b) => a.map((value, axis) => value - b[axis])
|
|
4
|
+
const dot = (a, b) => a.reduce((sum, value, axis) => sum + value * b[axis], 0)
|
|
5
|
+
const cross = (a, b) => [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]]
|
|
6
|
+
const unit = vector => {
|
|
7
|
+
const length = Math.hypot(...vector)
|
|
8
|
+
if (!(length > 0)) throw new Error('face has no stable projection direction')
|
|
9
|
+
return vector.map(value => value / length)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Explicit corner UVs, leaving control geometry and legacy missing-UV behavior alone.
|
|
13
|
+
* Each planar face starts at (0, 0); islands overlap intentionally for repeating
|
|
14
|
+
* textures. One mesh-wide divisor retains aspect and relative texel density.
|
|
15
|
+
*/
|
|
16
|
+
export function projectMeshFaceUvs(generator, { quarterTurns = 0, scale = 1 } = {}) {
|
|
17
|
+
if (generator?.shape !== 'mesh') throw new Error('UV projection requires a mesh generator')
|
|
18
|
+
if (!Number.isInteger(quarterTurns) || quarterTurns < 0 || quarterTurns > 3
|
|
19
|
+
|| !Number.isFinite(scale) || scale < 0.0001 || scale > 10000) {
|
|
20
|
+
throw new Error('UV projection needs quarterTurns 0–3 and scale 0.0001–10000')
|
|
21
|
+
}
|
|
22
|
+
const { vertices, faces } = generator
|
|
23
|
+
const issues = meshGeneratorIssues({ vertices, faces })
|
|
24
|
+
if (issues.length) throw new Error(issues[0])
|
|
25
|
+
const low = [Infinity, Infinity, Infinity], high = [-Infinity, -Infinity, -Infinity]
|
|
26
|
+
for (const vertex of vertices) for (let axis = 0; axis < 3; axis++) {
|
|
27
|
+
low[axis] = Math.min(low[axis], vertex[axis])
|
|
28
|
+
high[axis] = Math.max(high[axis], vertex[axis])
|
|
29
|
+
}
|
|
30
|
+
const size = Math.max(...high.map((value, axis) => value - low[axis]))
|
|
31
|
+
return faces.map((face, index) => {
|
|
32
|
+
const origin = vertices[face[0]], points = face.map(vertex => subtract(vertices[vertex], origin))
|
|
33
|
+
let normal = [0, 0, 0]
|
|
34
|
+
for (let corner = 1; corner < points.length - 1; corner++) {
|
|
35
|
+
const area = cross(points[corner], points[corner + 1])
|
|
36
|
+
normal = normal.map((value, axis) => value + area[axis])
|
|
37
|
+
}
|
|
38
|
+
normal = unit(normal)
|
|
39
|
+
const span = Math.max(...points.map(point => Math.hypot(...point)))
|
|
40
|
+
if (points.some(point => Math.abs(dot(point, normal)) > span * 1e-6)) {
|
|
41
|
+
throw new Error(`mesh face ${index} is not planar; split it into planar faces before UV projection`)
|
|
42
|
+
}
|
|
43
|
+
let best = null
|
|
44
|
+
for (let corner = 0; corner < points.length; corner++) {
|
|
45
|
+
const edge = subtract(points[(corner + 1) % points.length], points[corner])
|
|
46
|
+
const tangent = edge.map((value, axis) => value - normal[axis] * dot(edge, normal))
|
|
47
|
+
const lengthSquared = dot(tangent, tangent)
|
|
48
|
+
if (!(lengthSquared > 0)) continue
|
|
49
|
+
let direction = unit(tangent)
|
|
50
|
+
const axis = [0, 1, 2].sort((a, b) => Math.abs(direction[b]) - Math.abs(direction[a]) || a - b)[0]
|
|
51
|
+
if (direction[axis] < 0) direction = direction.map(value => -value)
|
|
52
|
+
direction = direction.map(value => value === 0 ? 0 : value)
|
|
53
|
+
const rank = JSON.stringify(direction)
|
|
54
|
+
if (best === null || lengthSquared > best.lengthSquared || lengthSquared === best.lengthSquared && rank < best.rank) {
|
|
55
|
+
best = { lengthSquared, direction, rank }
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (best === null) throw new Error(`mesh face ${index} has no stable edge`)
|
|
59
|
+
const u = best.direction, v = unit(cross(normal, u))
|
|
60
|
+
let coordinates = points.map(point => [dot(point, u) / size * scale, dot(point, v) / size * scale])
|
|
61
|
+
for (let turn = 0; turn < quarterTurns; turn++) coordinates = coordinates.map(([x, y]) => [-y, x])
|
|
62
|
+
const minimum = [0, 1].map(axis => Math.min(...coordinates.map(point => point[axis])))
|
|
63
|
+
return coordinates.map(point => point.map((value, axis) => {
|
|
64
|
+
const result = value - minimum[axis]
|
|
65
|
+
if (!Number.isFinite(result)) throw new Error(`mesh face ${index} produced non-finite UVs`)
|
|
66
|
+
return result === 0 ? 0 : result
|
|
67
|
+
}))
|
|
68
|
+
})
|
|
69
|
+
}
|
package/lib/scene-patch.js
CHANGED
|
@@ -20,6 +20,7 @@ import { compileSchema, formatIssues } from './json-schema.js'
|
|
|
20
20
|
import { collectionForKind, sceneSpecDigest, specHash } from './scene-spec.js'
|
|
21
21
|
import { referenceImageIssues } from './reference-images.js'
|
|
22
22
|
import { specChangeAudit } from './spec-change-audit.js'
|
|
23
|
+
import { projectMeshFaceUvs } from './mesh-uv.js'
|
|
23
24
|
import scenePatchSchema from './schemas/scene-patch.schema.json' with { type: 'json' }
|
|
24
25
|
|
|
25
26
|
const validatePatchStructure = compileSchema(scenePatchSchema, { id: 'scene-patch.schema.json' })
|
|
@@ -69,6 +70,7 @@ export const SCENE_OPERATION_NAMES = Object.freeze([
|
|
|
69
70
|
'material.tangent.set',
|
|
70
71
|
'project.brief.set',
|
|
71
72
|
'project.reviewSubject.set',
|
|
73
|
+
'entity.uv.project',
|
|
72
74
|
])
|
|
73
75
|
|
|
74
76
|
/** The `id` grammar shared with SceneSpec. */const ID_PATTERN = /^[a-zA-Z][a-zA-Z0-9._-]*$/
|
|
@@ -478,6 +480,24 @@ export function applyPatchToSpec(spec, patch) {
|
|
|
478
480
|
break
|
|
479
481
|
}
|
|
480
482
|
|
|
483
|
+
case 'entity.uv.project': {
|
|
484
|
+
const at = indexOfId(next.entities, operation.entityId)
|
|
485
|
+
if (at < 0) fail('PATCH_TARGET_MISSING', `no entity "${operation.entityId}" exists in this scene`)
|
|
486
|
+
const entity = next.entities[at]
|
|
487
|
+
if (entity.type !== 'generator' || entity.generator?.shape !== 'mesh') {
|
|
488
|
+
fail('PATCH_OPERATION_INVALID', `${op} requires a mesh generator; imported assets and other shapes retain their UVs`)
|
|
489
|
+
}
|
|
490
|
+
let faceUvs
|
|
491
|
+
try { faceUvs = projectMeshFaceUvs(entity.generator, operation) }
|
|
492
|
+
catch (error) { fail('PATCH_OPERATION_INVALID', error.message) }
|
|
493
|
+
const changed = JSON.stringify(entity.generator.faceUvs) !== JSON.stringify(faceUvs)
|
|
494
|
+
if (changed) next.entities[at] = { ...entity, generator: { ...entity.generator, faceUvs } }
|
|
495
|
+
applied.push({ op, target: entity.id,
|
|
496
|
+
summary: changed ? `projected repeating texture UVs per face on entity "${entity.id}"` : `entity "${entity.id}" face UVs already match this projection`,
|
|
497
|
+
changedPaths: changed ? [`entities.${entity.id}.generator.faceUvs`] : [] })
|
|
498
|
+
break
|
|
499
|
+
}
|
|
500
|
+
|
|
481
501
|
case 'entity.generator.set':
|
|
482
502
|
case 'entity.modifiers.set': {
|
|
483
503
|
const at = indexOfId(next.entities, operation.entityId)
|
package/lib/schema-types.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export namespace SceneSpecSchema {
|
|
|
42
42
|
}
|
|
43
43
|
export type SceneSpec = SceneSpecSchema.Document;
|
|
44
44
|
|
|
45
|
-
/** Source SHA-256:
|
|
45
|
+
/** Source SHA-256: d2bb4d3c1d1cb8d288d29f94d3458008fe31e0ffed8cd66e1f9936a6fcf593b0 */
|
|
46
46
|
export namespace ScenePatchSchema {
|
|
47
47
|
export type Id = string;
|
|
48
48
|
export type License = { "source"?: string; "commercialUse"?: boolean; "attribution"?: string; };
|
|
@@ -60,7 +60,7 @@ export namespace ScenePatchSchema {
|
|
|
60
60
|
export type Camera = { "id": ScenePatchSchema.Id; "role"?: "active-camera" | "three-quarter" | "top" | "detail"; "lens"?: ScenePatchSchema.PositiveNumber; "sensorWidth"?: ScenePatchSchema.PositiveNumber; "clipping"?: [ScenePatchSchema.PositiveNumber, ScenePatchSchema.PositiveNumber]; "transform"?: { "location"?: ScenePatchSchema.Vec3; "rotationEuler"?: ScenePatchSchema.Vec3; "scale"?: ScenePatchSchema.Vec3; }; "targetEntityId"?: string; "targetPoint"?: ScenePatchSchema.Vec3; "fStop"?: ScenePatchSchema.PositiveNumber; "sensorHeight"?: ScenePatchSchema.PositiveNumber; "sensorFit"?: "AUTO" | "HORIZONTAL" | "VERTICAL"; "shift"?: [number, number]; "focusDistance"?: ScenePatchSchema.PositiveNumber; };
|
|
61
61
|
export type AnimationTrack = { "id": ScenePatchSchema.Id; "targetKind"?: "entity" | "camera" | "material"; "targetEntityId": string; "property": "location.x" | "location.y" | "location.z" | "rotationEuler.x" | "rotationEuler.y" | "rotationEuler.z" | "scale.x" | "scale.y" | "scale.z" | "emissionStrength" | "roughness" | "metallic" | "ior" | "alpha" | "coatWeight" | "transmissionWeight" | "baseColor.r" | "baseColor.g" | "baseColor.b" | "emissionColor.r" | "emissionColor.g" | "emissionColor.b" | "anisotropic" | "anisotropicRotation"; "keyframes": Array<{ "frame": number; "value": number; "interpolation"?: "constant" | "linear" | "bezier" | "ease_in" | "ease_out" | "ease_in_out"; }>; };
|
|
62
62
|
export type RenderProfile = { "engine"?: "eevee" | "cycles" | "workbench"; "resolution"?: [number, number]; "samples"?: number; "filmTransparent"?: boolean; "colorManagement"?: { "viewTransform"?: "Standard" | "AgX" | "Filmic" | "False Color" | "Raw"; "look"?: string; "exposure"?: number; }; "maxSamplesBudget"?: number; "raytracing"?: boolean; };
|
|
63
|
-
export type Operation = ({ "op": "entity.transform.update"; "entityId": ScenePatchSchema.Id; "location"?: ScenePatchSchema.Vec3; "rotationEuler"?: ScenePatchSchema.Vec3; "scale"?: ScenePatchSchema.Vec3; }) | ({ "op": "entity.visibility.set"; "entityId": ScenePatchSchema.Id; "visible": boolean; }) | ({ "op": "entity.tags.set"; "entityId": ScenePatchSchema.Id; "tags": Array<string>; }) | ({ "op": "entity.add"; "entity": ScenePatchSchema.Entity; }) | ({ "op": "entity.remove"; "entityId": ScenePatchSchema.Id; }) | ({ "op": "entity.material.set"; "entityId": ScenePatchSchema.Id; "materialId": string | null; }) | ({ "op": "material.texture.set"; "materialId": ScenePatchSchema.Id; "texture": (ScenePatchSchema.ProceduralTexture) | (null); }) | ({ "op": "material.add"; "material": { "id": ScenePatchSchema.Id; "shader": "principled" | "emission" | "glass"; "parameters"?: ScenePatchSchema.MaterialParameters; "texture"?: ScenePatchSchema.ProceduralTexture; "images"?: ScenePatchSchema.MaterialImages; "tangent"?: ScenePatchSchema.MaterialTangent; }; }) | ({ "op": "material.parameter.update"; "materialId": ScenePatchSchema.Id; "parameter": "baseColor" | "metallic" | "roughness" | "ior" | "alpha" | "emissionColor" | "emissionStrength" | "coatWeight" | "transmissionWeight" | "anisotropic" | "anisotropicRotation"; "value": (number) | (ScenePatchSchema.UnitColor); }) | ({ "op": "light.add"; "light": ScenePatchSchema.Light; }) | ({ "op": "light.update"; "lightId": ScenePatchSchema.Id; "transform"?: { "location"?: ScenePatchSchema.Vec3; "rotationEuler"?: ScenePatchSchema.Vec3; "scale"?: ScenePatchSchema.Vec3; }; "energy"?: ScenePatchSchema.NonNegativeNumber; "color"?: ScenePatchSchema.UnitColor; "size"?: ScenePatchSchema.PositiveNumber; "spotSize"?: number; "spotBlend"?: number; "angle"?: number; }) | ({ "op": "light.remove"; "lightId": ScenePatchSchema.Id; }) | ({ "op": "camera.add"; "camera": ScenePatchSchema.Camera; }) | ({ "op": "camera.update"; "cameraId": ScenePatchSchema.Id; "role"?: "active-camera" | "three-quarter" | "top" | "detail"; "lens"?: ScenePatchSchema.PositiveNumber; "sensorWidth"?: ScenePatchSchema.PositiveNumber; "clipping"?: [ScenePatchSchema.PositiveNumber, ScenePatchSchema.PositiveNumber]; "transform"?: { "location"?: ScenePatchSchema.Vec3; "rotationEuler"?: ScenePatchSchema.Vec3; "scale"?: ScenePatchSchema.Vec3; }; "targetEntityId"?: string; "targetPoint"?: ScenePatchSchema.Vec3; "fStop"?: ScenePatchSchema.PositiveNumber; "clearTarget"?: true; "sensorHeight"?: ScenePatchSchema.PositiveNumber; "sensorFit"?: "AUTO" | "HORIZONTAL" | "VERTICAL"; "shift"?: [number, number]; "focusDistance"?: ScenePatchSchema.PositiveNumber; }) | ({ "op": "camera.remove"; "cameraId": ScenePatchSchema.Id; }) | ({ "op": "animation.track.set"; "track": ScenePatchSchema.AnimationTrack; }) | ({ "op": "animation.track.remove"; "trackId": ScenePatchSchema.Id; }) | ({ "op": "shot.set"; "shot": { "id": ScenePatchSchema.Id; "cameraId": string; "frameRange"?: [number, number]; "description"?: string; }; }) | ({ "op": "shot.remove"; "shotId": ScenePatchSchema.Id; }) | ({ "op": "project.frameRange.set"; "frameStart": number; "frameEnd": number; "fps"?: number; }) | ({ "op": "render.profile.set"; "profileName": "preview" | "final"; "profile": ScenePatchSchema.RenderProfile; }) | ({ "op": "world.set"; "world": ScenePatchSchema.World; }) | ({ "op": "asset.add"; "asset": { "id": ScenePatchSchema.Id; "type": "glb" | "gltf" | "fbx" | "obj" | "usd" | "blend" | "png" | "jpg" | "jpeg" | "hdr" | "exr"; "path": string; "sha256"?: string; "license"?: ScenePatchSchema.License; }; }) | ({ "op": "asset.remove"; "assetId": ScenePatchSchema.Id; }) | ({ "op": "entity.generator.set"; "entityId": ScenePatchSchema.Id; "generator": ScenePatchSchema.Generator; }) | ({ "op": "entity.modifiers.set"; "entityId": ScenePatchSchema.Id; "modifiers": Array<ScenePatchSchema.ModelModifier>; }) | ({ "op": "material.images.set"; "materialId": ScenePatchSchema.Id; "images": (ScenePatchSchema.MaterialImages) | (null); }) | ({ "op": "entity.materialBindings.set"; "entityId": ScenePatchSchema.Id; "materialBindings": ScenePatchSchema.MaterialBindings; }) | ({ "op": "material.tangent.set"; "materialId": ScenePatchSchema.Id; "tangent": (ScenePatchSchema.MaterialTangent) | (null); }) | ({ "op": "project.brief.set"; "goal": string; "referenceImages": ScenePatchSchema.ReferenceImages; }) | ({ "op": "project.reviewSubject.set"; "entityId": (ScenePatchSchema.Id) | (null); });
|
|
63
|
+
export type Operation = ({ "op": "entity.transform.update"; "entityId": ScenePatchSchema.Id; "location"?: ScenePatchSchema.Vec3; "rotationEuler"?: ScenePatchSchema.Vec3; "scale"?: ScenePatchSchema.Vec3; }) | ({ "op": "entity.visibility.set"; "entityId": ScenePatchSchema.Id; "visible": boolean; }) | ({ "op": "entity.tags.set"; "entityId": ScenePatchSchema.Id; "tags": Array<string>; }) | ({ "op": "entity.add"; "entity": ScenePatchSchema.Entity; }) | ({ "op": "entity.remove"; "entityId": ScenePatchSchema.Id; }) | ({ "op": "entity.material.set"; "entityId": ScenePatchSchema.Id; "materialId": string | null; }) | ({ "op": "material.texture.set"; "materialId": ScenePatchSchema.Id; "texture": (ScenePatchSchema.ProceduralTexture) | (null); }) | ({ "op": "material.add"; "material": { "id": ScenePatchSchema.Id; "shader": "principled" | "emission" | "glass"; "parameters"?: ScenePatchSchema.MaterialParameters; "texture"?: ScenePatchSchema.ProceduralTexture; "images"?: ScenePatchSchema.MaterialImages; "tangent"?: ScenePatchSchema.MaterialTangent; }; }) | ({ "op": "material.parameter.update"; "materialId": ScenePatchSchema.Id; "parameter": "baseColor" | "metallic" | "roughness" | "ior" | "alpha" | "emissionColor" | "emissionStrength" | "coatWeight" | "transmissionWeight" | "anisotropic" | "anisotropicRotation"; "value": (number) | (ScenePatchSchema.UnitColor); }) | ({ "op": "light.add"; "light": ScenePatchSchema.Light; }) | ({ "op": "light.update"; "lightId": ScenePatchSchema.Id; "transform"?: { "location"?: ScenePatchSchema.Vec3; "rotationEuler"?: ScenePatchSchema.Vec3; "scale"?: ScenePatchSchema.Vec3; }; "energy"?: ScenePatchSchema.NonNegativeNumber; "color"?: ScenePatchSchema.UnitColor; "size"?: ScenePatchSchema.PositiveNumber; "spotSize"?: number; "spotBlend"?: number; "angle"?: number; }) | ({ "op": "light.remove"; "lightId": ScenePatchSchema.Id; }) | ({ "op": "camera.add"; "camera": ScenePatchSchema.Camera; }) | ({ "op": "camera.update"; "cameraId": ScenePatchSchema.Id; "role"?: "active-camera" | "three-quarter" | "top" | "detail"; "lens"?: ScenePatchSchema.PositiveNumber; "sensorWidth"?: ScenePatchSchema.PositiveNumber; "clipping"?: [ScenePatchSchema.PositiveNumber, ScenePatchSchema.PositiveNumber]; "transform"?: { "location"?: ScenePatchSchema.Vec3; "rotationEuler"?: ScenePatchSchema.Vec3; "scale"?: ScenePatchSchema.Vec3; }; "targetEntityId"?: string; "targetPoint"?: ScenePatchSchema.Vec3; "fStop"?: ScenePatchSchema.PositiveNumber; "clearTarget"?: true; "sensorHeight"?: ScenePatchSchema.PositiveNumber; "sensorFit"?: "AUTO" | "HORIZONTAL" | "VERTICAL"; "shift"?: [number, number]; "focusDistance"?: ScenePatchSchema.PositiveNumber; }) | ({ "op": "camera.remove"; "cameraId": ScenePatchSchema.Id; }) | ({ "op": "animation.track.set"; "track": ScenePatchSchema.AnimationTrack; }) | ({ "op": "animation.track.remove"; "trackId": ScenePatchSchema.Id; }) | ({ "op": "shot.set"; "shot": { "id": ScenePatchSchema.Id; "cameraId": string; "frameRange"?: [number, number]; "description"?: string; }; }) | ({ "op": "shot.remove"; "shotId": ScenePatchSchema.Id; }) | ({ "op": "project.frameRange.set"; "frameStart": number; "frameEnd": number; "fps"?: number; }) | ({ "op": "render.profile.set"; "profileName": "preview" | "final"; "profile": ScenePatchSchema.RenderProfile; }) | ({ "op": "world.set"; "world": ScenePatchSchema.World; }) | ({ "op": "asset.add"; "asset": { "id": ScenePatchSchema.Id; "type": "glb" | "gltf" | "fbx" | "obj" | "usd" | "blend" | "png" | "jpg" | "jpeg" | "hdr" | "exr"; "path": string; "sha256"?: string; "license"?: ScenePatchSchema.License; }; }) | ({ "op": "asset.remove"; "assetId": ScenePatchSchema.Id; }) | ({ "op": "entity.generator.set"; "entityId": ScenePatchSchema.Id; "generator": ScenePatchSchema.Generator; }) | ({ "op": "entity.modifiers.set"; "entityId": ScenePatchSchema.Id; "modifiers": Array<ScenePatchSchema.ModelModifier>; }) | ({ "op": "material.images.set"; "materialId": ScenePatchSchema.Id; "images": (ScenePatchSchema.MaterialImages) | (null); }) | ({ "op": "entity.materialBindings.set"; "entityId": ScenePatchSchema.Id; "materialBindings": ScenePatchSchema.MaterialBindings; }) | ({ "op": "material.tangent.set"; "materialId": ScenePatchSchema.Id; "tangent": (ScenePatchSchema.MaterialTangent) | (null); }) | ({ "op": "project.brief.set"; "goal": string; "referenceImages": ScenePatchSchema.ReferenceImages; }) | ({ "op": "project.reviewSubject.set"; "entityId": (ScenePatchSchema.Id) | (null); }) | ({ "op": "entity.uv.project"; "entityId": ScenePatchSchema.Id; "quarterTurns"?: number; "scale"?: number; });
|
|
64
64
|
export type ModelModifier = ({ "type": "solidify"; "thickness": number; "offset"?: number; }) | ({ "type": "mirror"; "axis": "x" | "y" | "z"; "merge"?: boolean; }) | ({ "type": "array"; "count": number; "offset": ScenePatchSchema.Vec3; }) | ({ "type": "boolean"; "operation": "union" | "difference" | "intersect"; "targetEntityId": ScenePatchSchema.Id; }) | ({ "type": "bevel"; "width": number; "segments"?: number; "angle"?: number; "miterInner"?: "arc" | "sharp"; }) | ({ "type": "subdivision"; "levels": number; "scheme"?: "catmull-clark" | "simple"; "boundaryMode"?: "all" | "preserve-corners"; }) | ({ "type": "surface_scatter"; "targetEntityIds": Array<ScenePatchSchema.Id>; "count": number; "seed"?: number; "anchorVertexIndices": Array<number>; "embedDepthMm"?: number; "scaleRange"?: [number, number]; "upwardBias"?: number; });
|
|
65
65
|
export type ImageBinding = { "assetId": ScenePatchSchema.Id; "scale"?: ScenePatchSchema.Vec3; "offset"?: ScenePatchSchema.Vec3; "uvMap"?: string; "channel"?: "r" | "g" | "b" | "a"; "strength"?: number; };
|
|
66
66
|
export type MaterialImages = { "baseColor"?: ScenePatchSchema.ImageBinding; "roughness"?: ScenePatchSchema.ImageBinding; "metallic"?: ScenePatchSchema.ImageBinding; "normal"?: ScenePatchSchema.ImageBinding; "alpha"?: ScenePatchSchema.ImageBinding; "emissionColor"?: ScenePatchSchema.ImageBinding; };
|
|
@@ -1827,6 +1827,34 @@
|
|
|
1827
1827
|
]
|
|
1828
1828
|
}
|
|
1829
1829
|
}
|
|
1830
|
+
},
|
|
1831
|
+
{
|
|
1832
|
+
"type": "object",
|
|
1833
|
+
"additionalProperties": false,
|
|
1834
|
+
"required": [
|
|
1835
|
+
"op",
|
|
1836
|
+
"entityId"
|
|
1837
|
+
],
|
|
1838
|
+
"properties": {
|
|
1839
|
+
"op": {
|
|
1840
|
+
"const": "entity.uv.project"
|
|
1841
|
+
},
|
|
1842
|
+
"entityId": {
|
|
1843
|
+
"$ref": "#/$defs/id"
|
|
1844
|
+
},
|
|
1845
|
+
"quarterTurns": {
|
|
1846
|
+
"type": "integer",
|
|
1847
|
+
"minimum": 0,
|
|
1848
|
+
"maximum": 3,
|
|
1849
|
+
"description": "Quarter turns after per-face projection; default 0."
|
|
1850
|
+
},
|
|
1851
|
+
"scale": {
|
|
1852
|
+
"type": "number",
|
|
1853
|
+
"minimum": 0.0001,
|
|
1854
|
+
"maximum": 10000,
|
|
1855
|
+
"description": "UV repetitions per longest local mesh extent; default 1. Larger values repeat the texture more often. Islands overlap and are not packed."
|
|
1856
|
+
}
|
|
1857
|
+
}
|
|
1830
1858
|
}
|
|
1831
1859
|
]
|
|
1832
1860
|
},
|
package/package.json
CHANGED