@3driseai/3drise-core 1.0.19 → 1.0.21
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/dist/animations/index.d.ts +2 -0
- package/dist/animations/index.d.ts.map +1 -0
- package/dist/animations/index.js +1 -0
- package/dist/animations/trackGenerators.d.ts +140 -0
- package/dist/animations/trackGenerators.d.ts.map +1 -0
- package/dist/animations/trackGenerators.js +443 -0
- package/dist/autoAnimate/bounds.d.ts +7 -0
- package/dist/autoAnimate/bounds.d.ts.map +1 -0
- package/dist/autoAnimate/bounds.js +23 -0
- package/dist/autoAnimate/composer.d.ts +30 -0
- package/dist/autoAnimate/composer.d.ts.map +1 -0
- package/dist/autoAnimate/composer.js +251 -0
- package/dist/autoAnimate/describeScene.d.ts +105 -0
- package/dist/autoAnimate/describeScene.d.ts.map +1 -0
- package/dist/autoAnimate/describeScene.js +165 -0
- package/dist/autoAnimate/draft.d.ts +59 -0
- package/dist/autoAnimate/draft.d.ts.map +1 -0
- package/dist/autoAnimate/draft.js +2 -0
- package/dist/autoAnimate/index.d.ts +14 -0
- package/dist/autoAnimate/index.d.ts.map +1 -0
- package/dist/autoAnimate/index.js +9 -0
- package/dist/autoAnimate/recipes.d.ts +87 -0
- package/dist/autoAnimate/recipes.d.ts.map +1 -0
- package/dist/autoAnimate/recipes.js +224 -0
- package/dist/autoAnimate/rng.d.ts +10 -0
- package/dist/autoAnimate/rng.d.ts.map +1 -0
- package/dist/autoAnimate/rng.js +16 -0
- package/dist/autoAnimate/sceneAnalyzer.d.ts +7 -0
- package/dist/autoAnimate/sceneAnalyzer.d.ts.map +1 -0
- package/dist/autoAnimate/sceneAnalyzer.js +291 -0
- package/dist/autoAnimate/types.d.ts +124 -0
- package/dist/autoAnimate/types.d.ts.map +1 -0
- package/dist/autoAnimate/types.js +1 -0
- package/dist/autoAnimate/validator.d.ts +10 -0
- package/dist/autoAnimate/validator.d.ts.map +1 -0
- package/dist/autoAnimate/validator.js +59 -0
- package/dist/data/effectsDefaults.d.ts +4 -0
- package/dist/data/effectsDefaults.d.ts.map +1 -1
- package/dist/data/effectsDefaults.js +393 -2
- package/dist/data/gridsDefaults.d.ts +5 -0
- package/dist/data/gridsDefaults.d.ts.map +1 -0
- package/dist/data/gridsDefaults.js +419 -0
- package/dist/data/index.d.ts +1 -0
- package/dist/data/index.d.ts.map +1 -1
- package/dist/data/index.js +1 -0
- package/dist/data/particlesDefaults.d.ts +3 -1
- package/dist/data/particlesDefaults.d.ts.map +1 -1
- package/dist/data/particlesDefaults.js +78 -0
- package/dist/environment/cloudConfigs.d.ts +313 -0
- package/dist/environment/cloudConfigs.d.ts.map +1 -0
- package/dist/environment/cloudConfigs.js +342 -0
- package/dist/environment/index.d.ts +5 -0
- package/dist/environment/index.d.ts.map +1 -0
- package/dist/environment/index.js +6 -0
- package/dist/environment/landscapeConfigs.d.ts +220 -0
- package/dist/environment/landscapeConfigs.d.ts.map +1 -0
- package/dist/environment/landscapeConfigs.js +256 -0
- package/dist/environment/oceanConfigs.d.ts +293 -0
- package/dist/environment/oceanConfigs.d.ts.map +1 -0
- package/dist/environment/oceanConfigs.js +380 -0
- package/dist/environment/terrainConfigs.d.ts +254 -0
- package/dist/environment/terrainConfigs.d.ts.map +1 -0
- package/dist/environment/terrainConfigs.js +292 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/properties/index.d.ts +4 -0
- package/dist/properties/index.d.ts.map +1 -0
- package/dist/properties/index.js +3 -0
- package/dist/properties/registry.d.ts +44 -0
- package/dist/properties/registry.d.ts.map +1 -0
- package/dist/properties/registry.js +343 -0
- package/dist/properties/tables/effectsProperties.d.ts +40 -0
- package/dist/properties/tables/effectsProperties.d.ts.map +1 -0
- package/dist/properties/tables/effectsProperties.js +512 -0
- package/dist/properties/tables/geometryProperties.d.ts +38 -0
- package/dist/properties/tables/geometryProperties.d.ts.map +1 -0
- package/dist/properties/tables/geometryProperties.js +91 -0
- package/dist/properties/tables/getPropertyConfig.d.ts +3 -0
- package/dist/properties/tables/getPropertyConfig.d.ts.map +1 -0
- package/dist/properties/tables/getPropertyConfig.js +16 -0
- package/dist/properties/tables/gridProperties.d.ts +6 -0
- package/dist/properties/tables/gridProperties.d.ts.map +1 -0
- package/dist/properties/tables/gridProperties.js +199 -0
- package/dist/properties/tables/index.d.ts +8 -0
- package/dist/properties/tables/index.d.ts.map +1 -0
- package/dist/properties/tables/index.js +7 -0
- package/dist/properties/tables/lightProperties.d.ts +14 -0
- package/dist/properties/tables/lightProperties.d.ts.map +1 -0
- package/dist/properties/tables/lightProperties.js +263 -0
- package/dist/properties/tables/materialBounds.d.ts +33 -0
- package/dist/properties/tables/materialBounds.d.ts.map +1 -0
- package/dist/properties/tables/materialBounds.js +180 -0
- package/dist/properties/tables/optionalProperties.d.ts +83 -0
- package/dist/properties/tables/optionalProperties.d.ts.map +1 -0
- package/dist/properties/tables/optionalProperties.js +710 -0
- package/dist/properties/tables/particlesProperties.d.ts +17 -0
- package/dist/properties/tables/particlesProperties.d.ts.map +1 -0
- package/dist/properties/tables/particlesProperties.js +334 -0
- package/dist/properties/types.d.ts +43 -0
- package/dist/properties/types.d.ts.map +1 -0
- package/dist/properties/types.js +12 -0
- package/dist/services/ShadersLibrary.d.ts +1 -1
- package/dist/services/ShadersLibrary.d.ts.map +1 -1
- package/dist/shaders/ApollonianGridMaterial.d.ts +70 -0
- package/dist/shaders/ApollonianGridMaterial.d.ts.map +1 -0
- package/dist/shaders/ApollonianGridMaterial.js +289 -0
- package/dist/shaders/ConformalGridMaterial.d.ts +91 -0
- package/dist/shaders/ConformalGridMaterial.d.ts.map +1 -0
- package/dist/shaders/ConformalGridMaterial.js +335 -0
- package/dist/shaders/HilbertGridMaterial.d.ts +79 -0
- package/dist/shaders/HilbertGridMaterial.d.ts.map +1 -0
- package/dist/shaders/HilbertGridMaterial.js +329 -0
- package/dist/shaders/LensingGridMaterial.d.ts +73 -0
- package/dist/shaders/LensingGridMaterial.d.ts.map +1 -0
- package/dist/shaders/LensingGridMaterial.js +253 -0
- package/dist/shaders/ParastichyGridMaterial.d.ts +76 -0
- package/dist/shaders/ParastichyGridMaterial.d.ts.map +1 -0
- package/dist/shaders/ParastichyGridMaterial.js +282 -0
- package/dist/shaders/PhyllotaxisGridMaterial.d.ts +85 -0
- package/dist/shaders/PhyllotaxisGridMaterial.d.ts.map +1 -0
- package/dist/shaders/PhyllotaxisGridMaterial.js +532 -0
- package/dist/shaders/TruchetGridMaterial.d.ts +76 -0
- package/dist/shaders/TruchetGridMaterial.d.ts.map +1 -0
- package/dist/shaders/TruchetGridMaterial.js +290 -0
- package/dist/shaders/WallpaperGridMaterial.d.ts.map +1 -1
- package/dist/shaders/WallpaperGridMaterial.js +6 -1
- package/dist/shaders/index.d.ts +7 -0
- package/dist/shaders/index.d.ts.map +1 -1
- package/dist/shaders/index.js +7 -0
- package/dist/three/GalleryLayoutV.d.ts.map +1 -1
- package/dist/three/GalleryLayoutV.js +0 -10
- package/dist/three/SceneBuilderV.d.ts.map +1 -1
- package/dist/three/SceneBuilderV.js +1 -7
- package/dist/types/generativeEffects.d.ts +0 -4
- package/dist/types/generativeEffects.d.ts.map +1 -1
- package/dist/types/generativeParticles.d.ts +175 -2
- package/dist/types/generativeParticles.d.ts.map +1 -1
- package/dist/types/objectSettings.d.ts +45 -4
- package/dist/types/objectSettings.d.ts.map +1 -1
- package/dist/types/scene3d.d.ts +3 -3
- package/dist/types/scene3d.d.ts.map +1 -1
- package/dist/utils/generativeAnimatable.d.ts +1 -1
- package/dist/utils/generativeAnimatable.d.ts.map +1 -1
- package/dist/utils/generativeAnimatable.js +7 -1
- package/dist/utils/getAnimatableProperties.d.ts +12 -1
- package/dist/utils/getAnimatableProperties.d.ts.map +1 -1
- package/dist/utils/getAnimatableProperties.js +35 -138
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/objectEffects.d.ts +6 -0
- package/dist/utils/objectEffects.d.ts.map +1 -0
- package/dist/utils/objectEffects.js +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import { LIGHTS_ANIMATABLE } from '../data/lightsDefaults.js';
|
|
2
|
+
import { GENERATIVE_PARTICLES_ANIMATABLE } from '../data/particlesDefaults.js';
|
|
3
|
+
import { EFFECTS_ANIMATABLE } from '../data/effectsDefaults.js';
|
|
4
|
+
import { GRIDS_ANIMATABLE } from '../data/gridsDefaults.js';
|
|
5
|
+
import { CLOUD_ANIMATABLE_PROPERTIES } from '../environment/cloudConfigs.js';
|
|
6
|
+
import { skyOptionalProperties, cloudDeckOptionalProperties, cirrusOptionalProperties, oceanSurfaceOptionalProperties, terrainOptionalProperties, rainOptionalProperties, cloudsOptionalProperties, textOptionalProperties, plainOptionalProperties, pathOptionalProperties, edgesOptionalProperties, } from './tables/optionalProperties.js';
|
|
7
|
+
import { SHAPE_CONTROLS, MODE_CONTROLS } from './tables/geometryProperties.js';
|
|
8
|
+
import { LIGHT_PROPERTIES, SHADOW_PROPERTIES } from './tables/lightProperties.js';
|
|
9
|
+
import { PARTICLES_PROPERTIES } from './tables/particlesProperties.js';
|
|
10
|
+
import { EFFECT_PROPERTIES } from './tables/effectsProperties.js';
|
|
11
|
+
import { GRID_PROPERTIES } from './tables/gridProperties.js';
|
|
12
|
+
import { MATERIAL_PROPERTY_BOUNDS } from './tables/materialBounds.js';
|
|
13
|
+
// =============================================================================
|
|
14
|
+
// Data owned here (was inline in getAnimatableProperties / the timeline)
|
|
15
|
+
// =============================================================================
|
|
16
|
+
/** Rain object knobs driven per frame. */
|
|
17
|
+
export const RAIN_ANIMATABLE_KEYS = ['color', 'size', 'opacity', 'speed', 'windStrength', 'windDirection', 'turbulence'];
|
|
18
|
+
/** Material keys that are engine bookkeeping, never a property. */
|
|
19
|
+
const MATERIAL_INTERNAL = new Set(['handlers', 'apply', 'uHasTexture', 'u_time', 'u_mouse', 'u_resolution']);
|
|
20
|
+
/** Material keys that are settable but never per frame (identity, render state). */
|
|
21
|
+
const MATERIAL_STRUCTURAL = new Set([
|
|
22
|
+
'materialType', 'materialVariant', 'materialName', 'name', 'side', 'visible', 'map',
|
|
23
|
+
'wireframe', 'transparent', 'flatShading',
|
|
24
|
+
]);
|
|
25
|
+
/**
|
|
26
|
+
* Objects that own their shader: their materialSettings (if any) never reach the
|
|
27
|
+
* renderer, so they have no material properties. They animate through config.
|
|
28
|
+
*/
|
|
29
|
+
export const SELF_MANAGED_MATERIAL_TYPES = new Set(['effect', 'grid', 'light', 'particles']);
|
|
30
|
+
const CAMERA_SPECS = [
|
|
31
|
+
{ key: 'position', name: 'position', label: 'Position', kind: 'vec3', domain: 'camera', animatable: true },
|
|
32
|
+
{ key: 'controls.target', name: 'target', label: 'Target', kind: 'vec3', domain: 'camera', animatable: true },
|
|
33
|
+
{ key: 'fov', name: 'fov', label: 'Field of view', kind: 'number', domain: 'camera', min: 10, max: 120, step: 1, unit: 'deg', animatable: true },
|
|
34
|
+
];
|
|
35
|
+
const TRANSFORM_SPECS = [
|
|
36
|
+
{ key: 'meshSettings.position', name: 'position', label: 'Position', kind: 'vec3', domain: 'transform', animatable: true },
|
|
37
|
+
{ key: 'meshSettings.rotation', name: 'rotation', label: 'Rotation', kind: 'vec3', domain: 'transform', animatable: true },
|
|
38
|
+
{ key: 'meshSettings.scale', name: 'scale', label: 'Scale', kind: 'vec3', domain: 'transform', animatable: true },
|
|
39
|
+
{ key: 'meshSettings.visible', name: 'visible', label: 'Visible', kind: 'boolean', domain: 'transform', animatable: true },
|
|
40
|
+
];
|
|
41
|
+
// =============================================================================
|
|
42
|
+
// Helpers
|
|
43
|
+
// =============================================================================
|
|
44
|
+
/** camelCase → "Title Case" (same as toAnimatableLabel). */
|
|
45
|
+
export const propertyLabel = (key) => key.replace(/([A-Z])/g, ' $1').replace(/^./, s => s.toUpperCase()).trim();
|
|
46
|
+
export function getSettingAtPath(obj, path) {
|
|
47
|
+
let cur = obj;
|
|
48
|
+
for (const part of path.split('.')) {
|
|
49
|
+
if (cur === null || cur === undefined)
|
|
50
|
+
return undefined;
|
|
51
|
+
cur = cur[part];
|
|
52
|
+
}
|
|
53
|
+
return cur;
|
|
54
|
+
}
|
|
55
|
+
const HEX = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
56
|
+
/** Kind of a value found on settings (material keys and table-only knobs have no spec to say). */
|
|
57
|
+
export function kindOfValue(key, v) {
|
|
58
|
+
if (Array.isArray(v)) {
|
|
59
|
+
if (v.every(n => typeof n === 'number'))
|
|
60
|
+
return v.length === 3 ? 'vec3' : v.length === 2 ? 'vec2' : null;
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
if (typeof v === 'number')
|
|
64
|
+
return 'number';
|
|
65
|
+
if (typeof v === 'boolean')
|
|
66
|
+
return 'boolean';
|
|
67
|
+
if (typeof v === 'string') {
|
|
68
|
+
if (HEX.test(v))
|
|
69
|
+
return 'color';
|
|
70
|
+
return /map$|texture/i.test(key) ? 'texture' : 'string';
|
|
71
|
+
}
|
|
72
|
+
if (v === null && /map$|texture/i.test(key))
|
|
73
|
+
return 'texture';
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
const OPTIONAL_KIND = {
|
|
77
|
+
number: 'number', string: 'string', boolean: 'boolean', color: 'color',
|
|
78
|
+
vector3: 'vec3', vector2: 'vec2', select: 'select',
|
|
79
|
+
};
|
|
80
|
+
const toOptions = (p) => p.options?.length ? p.options.map((value, i) => (p.optionLabels?.[i] ? { value, label: p.optionLabels[i] } : { value })) : undefined;
|
|
81
|
+
/** One controller row → spec. `animatable` is decided by the caller's rule. */
|
|
82
|
+
function fromOptional(p, prefix, domain, animatable) {
|
|
83
|
+
const spec = {
|
|
84
|
+
key: `${prefix}${p.name}`,
|
|
85
|
+
name: p.name,
|
|
86
|
+
label: p.label ?? propertyLabel(p.name),
|
|
87
|
+
kind: OPTIONAL_KIND[p.type] ?? 'number',
|
|
88
|
+
domain,
|
|
89
|
+
animatable,
|
|
90
|
+
};
|
|
91
|
+
if (p.description)
|
|
92
|
+
spec.description = p.description;
|
|
93
|
+
if (p.min !== undefined)
|
|
94
|
+
spec.min = p.min;
|
|
95
|
+
if (p.max !== undefined)
|
|
96
|
+
spec.max = p.max;
|
|
97
|
+
if (p.step !== undefined)
|
|
98
|
+
spec.step = p.step;
|
|
99
|
+
if (p.unit)
|
|
100
|
+
spec.unit = p.unit;
|
|
101
|
+
if (p.default !== undefined)
|
|
102
|
+
spec.default = p.default;
|
|
103
|
+
const options = toOptions(p);
|
|
104
|
+
if (options)
|
|
105
|
+
spec.options = options;
|
|
106
|
+
if (p.tab)
|
|
107
|
+
spec.group = p.tab;
|
|
108
|
+
return spec;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Controller rows → specs, for panels whose element is not in the registry's
|
|
112
|
+
* element list (stars, fog, rain environment, gallery…). Numbers / colours count
|
|
113
|
+
* as animatable unless the row says otherwise; panels ignore the flag.
|
|
114
|
+
*/
|
|
115
|
+
export function toPropertySpecs(list, prefix = '', domain = 'config') {
|
|
116
|
+
return list.map(p => fromOptional(p, prefix, domain, envAnimatable(p)));
|
|
117
|
+
}
|
|
118
|
+
/** Environment rule: numbers / colours animate unless the schema says otherwise; switches never. */
|
|
119
|
+
const envAnimatable = (p) => p.name !== 'enabled' && (p.type === 'number' || p.type === 'color') && p.animatable !== false;
|
|
120
|
+
const envSpecs = (list, prefix, domain) => list.map(p => fromOptional(p, prefix, domain, envAnimatable(p)));
|
|
121
|
+
// =============================================================================
|
|
122
|
+
// Object providers
|
|
123
|
+
// =============================================================================
|
|
124
|
+
function materialSpecs(material, prefix, domain) {
|
|
125
|
+
if (!material || typeof material !== 'object')
|
|
126
|
+
return [];
|
|
127
|
+
const out = [];
|
|
128
|
+
for (const [name, value] of Object.entries(material)) {
|
|
129
|
+
if (MATERIAL_INTERNAL.has(name))
|
|
130
|
+
continue;
|
|
131
|
+
const kind = kindOfValue(name, value);
|
|
132
|
+
if (!kind)
|
|
133
|
+
continue;
|
|
134
|
+
const bounds = MATERIAL_PROPERTY_BOUNDS[name];
|
|
135
|
+
const spec = {
|
|
136
|
+
key: `${prefix}${name}`,
|
|
137
|
+
name,
|
|
138
|
+
label: bounds?.label ?? propertyLabel(name),
|
|
139
|
+
kind,
|
|
140
|
+
domain,
|
|
141
|
+
animatable: !MATERIAL_STRUCTURAL.has(name) && (kind === 'number' || kind === 'color' || kind === 'boolean' || kind === 'vec3'),
|
|
142
|
+
};
|
|
143
|
+
if (bounds && kind === 'number') {
|
|
144
|
+
spec.min = bounds.min;
|
|
145
|
+
spec.max = bounds.max;
|
|
146
|
+
spec.step = bounds.step;
|
|
147
|
+
}
|
|
148
|
+
out.push(spec);
|
|
149
|
+
}
|
|
150
|
+
return out;
|
|
151
|
+
}
|
|
152
|
+
function edgesSpecs(obj) {
|
|
153
|
+
const edges = obj?.edgesSettings;
|
|
154
|
+
if (!edges)
|
|
155
|
+
return [];
|
|
156
|
+
const out = [];
|
|
157
|
+
for (const p of edgesOptionalProperties) {
|
|
158
|
+
// A size knob only exists for the edge type that draws it.
|
|
159
|
+
if (p.name === 'tubeRadius' && edges.type !== 'tube')
|
|
160
|
+
continue;
|
|
161
|
+
if (p.name === 'cubeSize' && edges.type !== 'cube')
|
|
162
|
+
continue;
|
|
163
|
+
out.push(fromOptional(p, 'edgesSettings.', 'edges', false));
|
|
164
|
+
}
|
|
165
|
+
out.push(...materialSpecs(edges.materialSettings, 'edgesSettings.materialSettings.', 'edges'));
|
|
166
|
+
return out;
|
|
167
|
+
}
|
|
168
|
+
/** Geometry shape / display mode controls → structural specs. */
|
|
169
|
+
function controlSpecs(controls, prefix, group) {
|
|
170
|
+
return (controls ?? []).map(c => {
|
|
171
|
+
const spec = {
|
|
172
|
+
key: `${prefix}${c.key}`,
|
|
173
|
+
name: c.key,
|
|
174
|
+
label: c.label,
|
|
175
|
+
kind: c.type === 'range' ? 'number' : c.type === 'toggle' ? 'boolean' : 'string',
|
|
176
|
+
domain: 'config',
|
|
177
|
+
group,
|
|
178
|
+
animatable: false,
|
|
179
|
+
default: c.default,
|
|
180
|
+
};
|
|
181
|
+
if (c.type === 'range') {
|
|
182
|
+
spec.min = c.min;
|
|
183
|
+
spec.max = c.max;
|
|
184
|
+
spec.step = c.step;
|
|
185
|
+
if (c.unit)
|
|
186
|
+
spec.unit = c.unit;
|
|
187
|
+
}
|
|
188
|
+
return spec;
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
const tableOf = (rows) => new Map((rows ?? []).map(r => [r.value, r.label]));
|
|
192
|
+
/** The config family of an object: by object type, else by config.type (as getAnimatableProperties does). */
|
|
193
|
+
function familyOf(obj) {
|
|
194
|
+
const t = obj?.config?.type;
|
|
195
|
+
const type = obj?.type;
|
|
196
|
+
const light = () => ({ domain: 'light', list: LIGHT_PROPERTIES[t] ?? [], animatable: tableOf(LIGHTS_ANIMATABLE[t]) });
|
|
197
|
+
const particles = () => ({ domain: 'particles', list: PARTICLES_PROPERTIES[t] ?? [], animatable: tableOf(GENERATIVE_PARTICLES_ANIMATABLE[t]) });
|
|
198
|
+
const effect = () => ({ domain: 'effect', list: EFFECT_PROPERTIES[t] ?? [], animatable: tableOf(EFFECTS_ANIMATABLE[t]) });
|
|
199
|
+
const grid = () => ({ domain: 'grid', list: GRID_PROPERTIES[t] ?? [], animatable: tableOf(GRIDS_ANIMATABLE[t]) });
|
|
200
|
+
if (t) {
|
|
201
|
+
if (type === 'light')
|
|
202
|
+
return light();
|
|
203
|
+
if (type === 'particles')
|
|
204
|
+
return particles();
|
|
205
|
+
if (type === 'effect')
|
|
206
|
+
return effect();
|
|
207
|
+
if (type === 'grid')
|
|
208
|
+
return grid();
|
|
209
|
+
if (t === 'rain')
|
|
210
|
+
return { domain: 'rain', list: rainOptionalProperties, animatable: new Map(RAIN_ANIMATABLE_KEYS.map(k => [k, propertyLabel(k)])) };
|
|
211
|
+
if (t === 'clouds')
|
|
212
|
+
return { domain: 'clouds', list: cloudsOptionalProperties, animatable: new Map(CLOUD_ANIMATABLE_PROPERTIES.map(k => [k, propertyLabel(k)])) };
|
|
213
|
+
// Older objects carry a generative config under another object type.
|
|
214
|
+
if (LIGHTS_ANIMATABLE[t])
|
|
215
|
+
return light();
|
|
216
|
+
if (EFFECTS_ANIMATABLE[t])
|
|
217
|
+
return effect();
|
|
218
|
+
if (GRIDS_ANIMATABLE[t])
|
|
219
|
+
return grid();
|
|
220
|
+
if (GENERATIVE_PARTICLES_ANIMATABLE[t])
|
|
221
|
+
return particles();
|
|
222
|
+
}
|
|
223
|
+
if (type === 'text')
|
|
224
|
+
return { domain: 'config', list: textOptionalProperties, animatable: null };
|
|
225
|
+
if (type === 'plain')
|
|
226
|
+
return { domain: 'config', list: plainOptionalProperties, animatable: null };
|
|
227
|
+
if (type === 'path')
|
|
228
|
+
return { domain: 'config', list: pathOptionalProperties, animatable: null };
|
|
229
|
+
return null;
|
|
230
|
+
}
|
|
231
|
+
function configSpecs(obj) {
|
|
232
|
+
// Created shapes: the shape's own knobs (by config.type) and its display mode's.
|
|
233
|
+
if (obj?.type === 'mesh' && obj.config?.type && SHAPE_CONTROLS[obj.config.type]) {
|
|
234
|
+
return [
|
|
235
|
+
...controlSpecs(SHAPE_CONTROLS[obj.config.type], 'config.', 'shape'),
|
|
236
|
+
...controlSpecs(MODE_CONTROLS[obj.modeConfig?.mode ?? 'solid'], 'modeConfig.', 'mode'),
|
|
237
|
+
];
|
|
238
|
+
}
|
|
239
|
+
const family = familyOf(obj);
|
|
240
|
+
if (!family)
|
|
241
|
+
return [];
|
|
242
|
+
const { domain, list, animatable } = family;
|
|
243
|
+
const out = [];
|
|
244
|
+
const seen = new Set();
|
|
245
|
+
for (const p of list) {
|
|
246
|
+
const spec = fromOptional(p, 'config.', domain, !!animatable?.has(p.name));
|
|
247
|
+
out.push(spec);
|
|
248
|
+
seen.add(p.name);
|
|
249
|
+
}
|
|
250
|
+
// Knobs the renderer drives per frame that the panel does not list.
|
|
251
|
+
for (const [name, label] of animatable ?? []) {
|
|
252
|
+
if (seen.has(name))
|
|
253
|
+
continue;
|
|
254
|
+
const kind = kindOfValue(name, obj?.config?.[name]) ?? 'number';
|
|
255
|
+
out.push({ key: `config.${name}`, name, label: label || propertyLabel(name), kind, domain, animatable: true });
|
|
256
|
+
}
|
|
257
|
+
if (domain === 'light') {
|
|
258
|
+
for (const p of SHADOW_PROPERTIES[obj.config.type] ?? []) {
|
|
259
|
+
out.push({ ...fromOptional(p, 'config.shadow.', 'shadow', false), group: 'shadow' });
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
return out;
|
|
263
|
+
}
|
|
264
|
+
function objectSpecs(obj) {
|
|
265
|
+
if (!obj)
|
|
266
|
+
return [];
|
|
267
|
+
const ownsMaterial = !SELF_MANAGED_MATERIAL_TYPES.has(obj.type);
|
|
268
|
+
return [
|
|
269
|
+
...TRANSFORM_SPECS,
|
|
270
|
+
...(ownsMaterial ? materialSpecs(obj.materialSettings, 'materialSettings.', 'material') : []),
|
|
271
|
+
...edgesSpecs(obj),
|
|
272
|
+
...configSpecs(obj),
|
|
273
|
+
];
|
|
274
|
+
}
|
|
275
|
+
// =============================================================================
|
|
276
|
+
// Environment providers
|
|
277
|
+
// =============================================================================
|
|
278
|
+
function environmentSpecs(element, settings) {
|
|
279
|
+
switch (element) {
|
|
280
|
+
case 'sky':
|
|
281
|
+
return envSpecs(skyOptionalProperties, '', 'sky');
|
|
282
|
+
case 'clouds':
|
|
283
|
+
return [
|
|
284
|
+
...envSpecs(cloudDeckOptionalProperties(settings?.config?.deckType), 'config.', 'clouds'),
|
|
285
|
+
...envSpecs(cirrusOptionalProperties, 'cirrus.', 'cirrus'),
|
|
286
|
+
];
|
|
287
|
+
case 'ocean':
|
|
288
|
+
return envSpecs(oceanSurfaceOptionalProperties(settings?.config?.waterType, settings?.config?.host), 'config.', 'ocean');
|
|
289
|
+
case 'terrain':
|
|
290
|
+
return envSpecs(terrainOptionalProperties(settings?.config?.terrainType), 'config.', 'terrain');
|
|
291
|
+
default:
|
|
292
|
+
return [];
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
// =============================================================================
|
|
296
|
+
// API
|
|
297
|
+
// =============================================================================
|
|
298
|
+
/** Every property that applies to this element (structural and animatable). */
|
|
299
|
+
export function getPropertySpecs(element, settings) {
|
|
300
|
+
if (element === 'object')
|
|
301
|
+
return objectSpecs(settings);
|
|
302
|
+
if (element === 'camera')
|
|
303
|
+
return CAMERA_SPECS.map(s => ({ ...s }));
|
|
304
|
+
return environmentSpecs(element, settings);
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* The property's layer is on: a hidden layer's knobs change nothing, so nothing
|
|
308
|
+
* offers them for animation (edges switched off, cloud deck / cirrus disabled).
|
|
309
|
+
*/
|
|
310
|
+
export function isPropertyLive(element, spec, settings) {
|
|
311
|
+
if (spec.domain === 'edges')
|
|
312
|
+
return settings?.edgesSettings?.enabled !== false;
|
|
313
|
+
if (element === 'clouds')
|
|
314
|
+
return spec.domain === 'cirrus' ? !!settings?.cirrus?.enabled : !!settings?.config?.enabled;
|
|
315
|
+
return true;
|
|
316
|
+
}
|
|
317
|
+
/** Properties that can be driven per frame on this element right now. */
|
|
318
|
+
export function getAnimatableSpecs(element, settings) {
|
|
319
|
+
return getPropertySpecs(element, settings).filter(s => s.animatable && isPropertyLive(element, s, settings));
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Object config families the animation timeline keys. The V2 applier drives
|
|
323
|
+
* `config.*` through the object's live config handle, which these four register;
|
|
324
|
+
* rain and the legacy cloud object have per-frame knobs for the keyframe /
|
|
325
|
+
* mouse-move systems only.
|
|
326
|
+
*/
|
|
327
|
+
export const TRACK_CONFIG_DOMAINS = new Set(['light', 'particles', 'effect', 'grid']);
|
|
328
|
+
/** What an animation clip can key on this element (timeline track picker, AI clips). */
|
|
329
|
+
export function getTrackSpecs(element, settings) {
|
|
330
|
+
const specs = getAnimatableSpecs(element, settings);
|
|
331
|
+
if (element !== 'object')
|
|
332
|
+
return specs;
|
|
333
|
+
return specs.filter(s => s.domain === 'transform' || s.domain === 'material' || s.domain === 'edges' || TRACK_CONFIG_DOMAINS.has(s.domain));
|
|
334
|
+
}
|
|
335
|
+
export function getPropertySpec(element, settings, key) {
|
|
336
|
+
return getPropertySpecs(element, settings).find(s => s.key === key);
|
|
337
|
+
}
|
|
338
|
+
/** Specs with the element's current values. */
|
|
339
|
+
export function describeProperties(element, settings) {
|
|
340
|
+
return getPropertySpecs(element, settings).map(s => ({ ...s, value: getSettingAtPath(settings, s.key) }));
|
|
341
|
+
}
|
|
342
|
+
/** The registry element for an animation / timeline state: env keys and camera as-is, anything else is an object id. */
|
|
343
|
+
export const elementOfState = (state) => state === 'camera' || state === 'sky' || state === 'clouds' || state === 'ocean' || state === 'terrain' ? state : 'object';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { OptionalProperty } from './optionalProperties';
|
|
2
|
+
import type { GenerativeEffectType } from '../../types/generativeEffects';
|
|
3
|
+
export declare const moleculesEffectProperties: OptionalProperty[];
|
|
4
|
+
export declare const shockwaveEffectProperties: OptionalProperty[];
|
|
5
|
+
export declare const auraEffectProperties: OptionalProperty[];
|
|
6
|
+
export declare const dataStreamEffectProperties: OptionalProperty[];
|
|
7
|
+
export declare const constellationEffectProperties: OptionalProperty[];
|
|
8
|
+
export declare const hologramEffectProperties: OptionalProperty[];
|
|
9
|
+
export declare const portalEffectProperties: OptionalProperty[];
|
|
10
|
+
export declare const dnaHelixEffectProperties: OptionalProperty[];
|
|
11
|
+
export declare const orbEffectProperties: OptionalProperty[];
|
|
12
|
+
export declare const lightningEffectProperties: OptionalProperty[];
|
|
13
|
+
export declare const auroraEffectProperties: OptionalProperty[];
|
|
14
|
+
export declare const fireEffectProperties: OptionalProperty[];
|
|
15
|
+
export declare const forcefieldEffectProperties: OptionalProperty[];
|
|
16
|
+
export declare const neuralNetworkEffectProperties: OptionalProperty[];
|
|
17
|
+
export declare const blackHoleEffectProperties: OptionalProperty[];
|
|
18
|
+
export declare const iceCrystalsEffectProperties: OptionalProperty[];
|
|
19
|
+
export declare const smokePlumeEffectProperties: OptionalProperty[];
|
|
20
|
+
export declare const volumetricFogEffectProperties: OptionalProperty[];
|
|
21
|
+
export declare const smokeRingEffectProperties: OptionalProperty[];
|
|
22
|
+
export declare const fieldLinesEffectProperties: OptionalProperty[];
|
|
23
|
+
export declare const strangeAttractorEffectProperties: OptionalProperty[];
|
|
24
|
+
export declare const harmonicShellEffectProperties: OptionalProperty[];
|
|
25
|
+
export declare const galaxyEffectProperties: OptionalProperty[];
|
|
26
|
+
export declare const fireflySwarmEffectProperties: OptionalProperty[];
|
|
27
|
+
export declare const murmurationEffectProperties: OptionalProperty[];
|
|
28
|
+
export declare const planetaryRingsEffectProperties: OptionalProperty[];
|
|
29
|
+
export declare const waterCausticsEffectProperties: OptionalProperty[];
|
|
30
|
+
export declare const iceHaloEffectProperties: OptionalProperty[];
|
|
31
|
+
export declare const fallingLeavesEffectProperties: OptionalProperty[];
|
|
32
|
+
export declare const lichtenbergEffectProperties: OptionalProperty[];
|
|
33
|
+
export declare const dandelionSeedsEffectProperties: OptionalProperty[];
|
|
34
|
+
export declare const flaresEffectProperties: OptionalProperty[];
|
|
35
|
+
export declare const sparklesBurstEffectProperties: OptionalProperty[];
|
|
36
|
+
export declare const bubblesEffectProperties: OptionalProperty[];
|
|
37
|
+
export declare const glyphsEffectProperties: OptionalProperty[];
|
|
38
|
+
export declare const smokeRibbonEffectProperties: OptionalProperty[];
|
|
39
|
+
export declare const EFFECT_PROPERTIES: Record<GenerativeEffectType, OptionalProperty[]>;
|
|
40
|
+
//# sourceMappingURL=effectsProperties.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effectsProperties.d.ts","sourceRoot":"","sources":["../../../src/properties/tables/effectsProperties.ts"],"names":[],"mappings":"AACA,OAAO,KAA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