@3driseai/3drise-viewer 0.1.26 → 0.1.27
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/animationsV2/ClipPlayer.d.ts +3 -0
- package/dist/animationsV2/ClipPlayer.d.ts.map +1 -1
- package/dist/animationsV2/ClipPlayer.js +67 -8
- package/dist/animationsV2/ClipsRuntime.d.ts +39 -0
- package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -1
- package/dist/animationsV2/ClipsRuntime.js +245 -14
- package/dist/animationsV2/appliers.d.ts +5 -0
- package/dist/animationsV2/appliers.d.ts.map +1 -1
- package/dist/animationsV2/appliers.js +25 -7
- package/dist/animationsV2/index.d.ts +1 -1
- package/dist/animationsV2/index.d.ts.map +1 -1
- package/dist/animationsV2/normalize.d.ts.map +1 -1
- package/dist/animationsV2/normalize.js +18 -7
- package/dist/animationsV2/sequenceUtils.d.ts +42 -1
- package/dist/animationsV2/sequenceUtils.d.ts.map +1 -1
- package/dist/animationsV2/sequenceUtils.js +103 -3
- package/dist/animationsV2/types.d.ts +20 -0
- package/dist/animationsV2/types.d.ts.map +1 -1
- package/dist/components/AdvancedGrid.d.ts +8 -2
- package/dist/components/AdvancedGrid.d.ts.map +1 -1
- package/dist/components/AdvancedGrid.js +31 -14
- package/dist/components/AnimatedObject.d.ts.map +1 -1
- package/dist/components/AnimatedObject.js +7 -5
- package/dist/components/Bubbles.d.ts +7 -1
- package/dist/components/Bubbles.d.ts.map +1 -1
- package/dist/components/Bubbles.js +42 -22
- package/dist/components/ChladniGrid.d.ts +8 -4
- package/dist/components/ChladniGrid.d.ts.map +1 -1
- package/dist/components/ChladniGrid.js +31 -13
- package/dist/components/CircuitGrid.d.ts +8 -11
- package/dist/components/CircuitGrid.d.ts.map +1 -1
- package/dist/components/CircuitGrid.js +31 -13
- package/dist/components/CloudsGenerator.d.ts +1 -1
- package/dist/components/CloudsGenerator.js +1 -1
- package/dist/components/ContourGrid.d.ts +8 -14
- package/dist/components/ContourGrid.d.ts.map +1 -1
- package/dist/components/ContourGrid.js +31 -13
- package/dist/components/EffectsGenerator.d.ts +7 -1
- package/dist/components/EffectsGenerator.d.ts.map +1 -1
- package/dist/components/EffectsGenerator.js +39 -38
- package/dist/components/EnvironmentManager.d.ts +4 -4
- package/dist/components/EnvironmentManager.d.ts.map +1 -1
- package/dist/components/FlowNetGrid.d.ts +8 -4
- package/dist/components/FlowNetGrid.d.ts.map +1 -1
- package/dist/components/FlowNetGrid.js +31 -13
- package/dist/components/FractalGrid.d.ts +8 -12
- package/dist/components/FractalGrid.d.ts.map +1 -1
- package/dist/components/FractalGrid.js +31 -13
- package/dist/components/GirihGrid.d.ts +8 -1
- package/dist/components/GirihGrid.d.ts.map +1 -1
- package/dist/components/GirihGrid.js +31 -13
- package/dist/components/Glyphs.d.ts +7 -1
- package/dist/components/Glyphs.d.ts.map +1 -1
- package/dist/components/Glyphs.js +40 -34
- package/dist/components/GravWaveGrid.d.ts +8 -1
- package/dist/components/GravWaveGrid.d.ts.map +1 -1
- package/dist/components/GravWaveGrid.js +31 -13
- package/dist/components/GridsGenerator.d.ts +7 -1
- package/dist/components/GridsGenerator.d.ts.map +1 -1
- package/dist/components/GridsGenerator.js +20 -18
- package/dist/components/HexGrid.d.ts +8 -10
- package/dist/components/HexGrid.d.ts.map +1 -1
- package/dist/components/HexGrid.js +31 -13
- package/dist/components/HyperbolicGrid.d.ts +8 -4
- package/dist/components/HyperbolicGrid.d.ts.map +1 -1
- package/dist/components/HyperbolicGrid.js +31 -13
- package/dist/components/LandscapeBuilder.d.ts +1 -1
- package/dist/components/LandscapeBuilder.d.ts.map +1 -1
- package/dist/components/LandscapeBuilder.js +1 -1
- package/dist/components/LandscapeObject.d.ts +1 -1
- package/dist/components/LandscapeObject.d.ts.map +1 -1
- package/dist/components/LandscapeObject.js +1 -1
- package/dist/components/MoireGrid.d.ts +8 -12
- package/dist/components/MoireGrid.d.ts.map +1 -1
- package/dist/components/MoireGrid.js +31 -13
- package/dist/components/ObjectNode.d.ts.map +1 -1
- package/dist/components/ObjectNode.js +2 -2
- package/dist/components/ObjectsRenderer.d.ts.map +1 -1
- package/dist/components/ObjectsRenderer.js +37 -3
- package/dist/components/OceanBuilder.d.ts +1 -1
- package/dist/components/OceanBuilder.js +1 -1
- package/dist/components/ParticlesGenerator.d.ts.map +1 -1
- package/dist/components/ParticlesGenerator.js +6 -0
- package/dist/components/QuasiGrid.d.ts +8 -11
- package/dist/components/QuasiGrid.d.ts.map +1 -1
- package/dist/components/QuasiGrid.js +31 -13
- package/dist/components/RadarGrid.d.ts +8 -13
- package/dist/components/RadarGrid.d.ts.map +1 -1
- package/dist/components/RadarGrid.js +31 -13
- package/dist/components/ReactionDiffusionGrid.d.ts +8 -1
- package/dist/components/ReactionDiffusionGrid.d.ts.map +1 -1
- package/dist/components/ReactionDiffusionGrid.js +33 -139
- package/dist/components/SceneBuilder.js +1 -1
- package/dist/components/SkySystem.d.ts +1 -1
- package/dist/components/SparklesBurst.d.ts +7 -1
- package/dist/components/SparklesBurst.d.ts.map +1 -1
- package/dist/components/SparklesBurst.js +31 -28
- package/dist/components/TerrainBuilder.d.ts +1 -1
- package/dist/components/TerrainBuilder.d.ts.map +1 -1
- package/dist/components/TerrainBuilder.js +1 -1
- package/dist/components/VoronoiGrid.d.ts +8 -10
- package/dist/components/VoronoiGrid.d.ts.map +1 -1
- package/dist/components/VoronoiGrid.js +31 -13
- package/dist/components/WallpaperGrid.d.ts +8 -1
- package/dist/components/WallpaperGrid.d.ts.map +1 -1
- package/dist/components/WallpaperGrid.js +33 -210
- package/dist/components/effects/AuraEffect.d.ts +8 -3
- package/dist/components/effects/AuraEffect.d.ts.map +1 -1
- package/dist/components/effects/AuraEffect.js +49 -24
- package/dist/components/effects/AuroraEffect.d.ts +8 -3
- package/dist/components/effects/AuroraEffect.d.ts.map +1 -1
- package/dist/components/effects/AuroraEffect.js +45 -25
- package/dist/components/effects/BlackHoleEffect.d.ts +8 -3
- package/dist/components/effects/BlackHoleEffect.d.ts.map +1 -1
- package/dist/components/effects/BlackHoleEffect.js +42 -21
- package/dist/components/effects/ConstellationEffect.d.ts +8 -3
- package/dist/components/effects/ConstellationEffect.d.ts.map +1 -1
- package/dist/components/effects/ConstellationEffect.js +49 -23
- package/dist/components/effects/DandelionSeedsEffect.d.ts +7 -2
- package/dist/components/effects/DandelionSeedsEffect.d.ts.map +1 -1
- package/dist/components/effects/DandelionSeedsEffect.js +19 -9
- package/dist/components/effects/DataStreamEffect.d.ts +8 -3
- package/dist/components/effects/DataStreamEffect.d.ts.map +1 -1
- package/dist/components/effects/DataStreamEffect.js +54 -26
- package/dist/components/effects/DnaHelixEffect.d.ts +8 -3
- package/dist/components/effects/DnaHelixEffect.d.ts.map +1 -1
- package/dist/components/effects/DnaHelixEffect.js +62 -30
- package/dist/components/effects/FallingLeavesEffect.d.ts +7 -2
- package/dist/components/effects/FallingLeavesEffect.d.ts.map +1 -1
- package/dist/components/effects/FallingLeavesEffect.js +19 -9
- package/dist/components/effects/FieldLinesEffect.d.ts +8 -3
- package/dist/components/effects/FieldLinesEffect.d.ts.map +1 -1
- package/dist/components/effects/FieldLinesEffect.js +30 -20
- package/dist/components/effects/Fire.d.ts +8 -3
- package/dist/components/effects/Fire.d.ts.map +1 -1
- package/dist/components/effects/Fire.js +47 -10
- package/dist/components/effects/FireflySwarmEffect.d.ts +7 -2
- package/dist/components/effects/FireflySwarmEffect.d.ts.map +1 -1
- package/dist/components/effects/FireflySwarmEffect.js +19 -9
- package/dist/components/effects/Flares.d.ts +10 -3
- package/dist/components/effects/Flares.d.ts.map +1 -1
- package/dist/components/effects/Flares.js +53 -56
- package/dist/components/effects/ForcefieldEffect.d.ts +8 -3
- package/dist/components/effects/ForcefieldEffect.d.ts.map +1 -1
- package/dist/components/effects/ForcefieldEffect.js +52 -33
- package/dist/components/effects/GalaxyEffect.d.ts +7 -2
- package/dist/components/effects/GalaxyEffect.d.ts.map +1 -1
- package/dist/components/effects/GalaxyEffect.js +19 -9
- package/dist/components/effects/HarmonicShellEffect.d.ts +8 -3
- package/dist/components/effects/HarmonicShellEffect.d.ts.map +1 -1
- package/dist/components/effects/HarmonicShellEffect.js +30 -22
- package/dist/components/effects/HologramEffect.d.ts +8 -3
- package/dist/components/effects/HologramEffect.d.ts.map +1 -1
- package/dist/components/effects/HologramEffect.js +52 -23
- package/dist/components/effects/IceCrystalsEffect.d.ts +8 -3
- package/dist/components/effects/IceCrystalsEffect.d.ts.map +1 -1
- package/dist/components/effects/IceCrystalsEffect.js +36 -21
- package/dist/components/effects/IceHaloEffect.d.ts +7 -2
- package/dist/components/effects/IceHaloEffect.d.ts.map +1 -1
- package/dist/components/effects/IceHaloEffect.js +19 -9
- package/dist/components/effects/LichtenbergEffect.d.ts +7 -2
- package/dist/components/effects/LichtenbergEffect.d.ts.map +1 -1
- package/dist/components/effects/LichtenbergEffect.js +19 -9
- package/dist/components/effects/LightningEffect.d.ts +8 -3
- package/dist/components/effects/LightningEffect.d.ts.map +1 -1
- package/dist/components/effects/LightningEffect.js +54 -32
- package/dist/components/effects/MoleculesEffect.d.ts +8 -3
- package/dist/components/effects/MoleculesEffect.d.ts.map +1 -1
- package/dist/components/effects/MoleculesEffect.js +31 -21
- package/dist/components/effects/MurmurationEffect.d.ts +7 -2
- package/dist/components/effects/MurmurationEffect.d.ts.map +1 -1
- package/dist/components/effects/MurmurationEffect.js +19 -9
- package/dist/components/effects/NeuralNetworkEffect.d.ts +8 -3
- package/dist/components/effects/NeuralNetworkEffect.d.ts.map +1 -1
- package/dist/components/effects/NeuralNetworkEffect.js +66 -33
- package/dist/components/effects/OrbEffect.d.ts +8 -3
- package/dist/components/effects/OrbEffect.d.ts.map +1 -1
- package/dist/components/effects/OrbEffect.js +89 -42
- package/dist/components/effects/PlanetaryRingsEffect.d.ts +7 -2
- package/dist/components/effects/PlanetaryRingsEffect.d.ts.map +1 -1
- package/dist/components/effects/PlanetaryRingsEffect.js +19 -9
- package/dist/components/effects/PortalEffect.d.ts +8 -3
- package/dist/components/effects/PortalEffect.d.ts.map +1 -1
- package/dist/components/effects/PortalEffect.js +41 -25
- package/dist/components/effects/ShockwaveEffect.d.ts +7 -2
- package/dist/components/effects/ShockwaveEffect.d.ts.map +1 -1
- package/dist/components/effects/ShockwaveEffect.js +19 -9
- package/dist/components/effects/SmokePlumeEffect.d.ts +8 -3
- package/dist/components/effects/SmokePlumeEffect.d.ts.map +1 -1
- package/dist/components/effects/SmokePlumeEffect.js +30 -20
- package/dist/components/effects/SmokeRibbon.d.ts +8 -2
- package/dist/components/effects/SmokeRibbon.d.ts.map +1 -1
- package/dist/components/effects/SmokeRibbon.js +34 -24
- package/dist/components/effects/SmokeRingEffect.d.ts +8 -3
- package/dist/components/effects/SmokeRingEffect.d.ts.map +1 -1
- package/dist/components/effects/SmokeRingEffect.js +33 -21
- package/dist/components/effects/StrangeAttractorEffect.d.ts +8 -3
- package/dist/components/effects/StrangeAttractorEffect.d.ts.map +1 -1
- package/dist/components/effects/StrangeAttractorEffect.js +30 -20
- package/dist/components/effects/VolumetricFogEffect.d.ts +8 -3
- package/dist/components/effects/VolumetricFogEffect.d.ts.map +1 -1
- package/dist/components/effects/VolumetricFogEffect.js +38 -20
- package/dist/components/effects/WaterCausticsEffect.d.ts +7 -2
- package/dist/components/effects/WaterCausticsEffect.d.ts.map +1 -1
- package/dist/components/effects/WaterCausticsEffect.js +19 -9
- package/dist/components/effects/index.d.ts +0 -1
- package/dist/components/effects/index.d.ts.map +1 -1
- package/dist/components/effects/index.js +0 -1
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +0 -1
- package/dist/components/landscape/LandscapeMesh.js +1 -1
- package/dist/components/landscape/types.d.ts +1 -1
- package/dist/components/landscape/types.d.ts.map +1 -1
- package/dist/components/particles/MagneticBottleParticles.d.ts +17 -0
- package/dist/components/particles/MagneticBottleParticles.d.ts.map +1 -0
- package/dist/components/particles/MagneticBottleParticles.js +618 -0
- package/dist/components/particles/ShapeBurstParticles.d.ts +17 -0
- package/dist/components/particles/ShapeBurstParticles.d.ts.map +1 -0
- package/dist/components/particles/ShapeBurstParticles.js +588 -0
- package/dist/components/particles/ShapeFlowParticles.d.ts +17 -0
- package/dist/components/particles/ShapeFlowParticles.d.ts.map +1 -0
- package/dist/components/particles/ShapeFlowParticles.js +755 -0
- package/dist/components/particles/index.d.ts +6 -0
- package/dist/components/particles/index.d.ts.map +1 -1
- package/dist/components/particles/index.js +3 -0
- package/dist/components/terrain/types.d.ts +1 -1
- package/dist/components/terrain/types.d.ts.map +1 -1
- package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts +1 -1
- package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts.map +1 -1
- package/dist/components/volumetricClouds/types.d.ts +1 -1
- package/dist/components/volumetricClouds/types.d.ts.map +1 -1
- package/dist/components/water/types.d.ts +1 -1
- package/dist/components/water/types.d.ts.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useConfigDriver.d.ts +22 -0
- package/dist/hooks/useConfigDriver.d.ts.map +1 -0
- package/dist/hooks/useConfigDriver.js +43 -0
- package/dist/hooks/useConfigLive.d.ts +1 -1
- package/dist/hooks/useConfigLive.d.ts.map +1 -1
- package/dist/hooks/useLandscapeMaps.d.ts +1 -1
- package/dist/hooks/useLandscapeMaps.d.ts.map +1 -1
- package/dist/hooks/useOceanMaterial.d.ts +1 -1
- package/dist/hooks/useThunder.d.ts +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/interactions/index.d.ts +2 -1
- package/dist/interactions/index.d.ts.map +1 -1
- package/dist/interactions/index.js +1 -1
- package/dist/interactions/runner.d.ts +18 -3
- package/dist/interactions/runner.d.ts.map +1 -1
- package/dist/interactions/runner.js +25 -2
- package/dist/operations/catalogue/curlSmoke.d.ts +3 -0
- package/dist/operations/catalogue/curlSmoke.d.ts.map +1 -0
- package/dist/operations/catalogue/curlSmoke.js +178 -0
- package/dist/operations/catalogue/displayImage.d.ts.map +1 -1
- package/dist/operations/catalogue/displayImage.js +1 -0
- package/dist/operations/catalogue/dissolve.d.ts +3 -0
- package/dist/operations/catalogue/dissolve.d.ts.map +1 -0
- package/dist/operations/catalogue/dissolve.js +57 -0
- package/dist/operations/catalogue/emberAsh.d.ts +3 -0
- package/dist/operations/catalogue/emberAsh.d.ts.map +1 -0
- package/dist/operations/catalogue/emberAsh.js +171 -0
- package/dist/operations/catalogue/fade.d.ts.map +1 -1
- package/dist/operations/catalogue/fade.js +1 -0
- package/dist/operations/catalogue/flip.d.ts +3 -0
- package/dist/operations/catalogue/flip.d.ts.map +1 -0
- package/dist/operations/catalogue/flip.js +69 -0
- package/dist/operations/catalogue/flock.d.ts +3 -0
- package/dist/operations/catalogue/flock.d.ts.map +1 -0
- package/dist/operations/catalogue/flock.js +163 -0
- package/dist/operations/catalogue/focus.d.ts.map +1 -1
- package/dist/operations/catalogue/focus.js +1 -0
- package/dist/operations/catalogue/frame.d.ts +3 -0
- package/dist/operations/catalogue/frame.d.ts.map +1 -0
- package/dist/operations/catalogue/frame.js +44 -0
- package/dist/operations/catalogue/frost.d.ts +3 -0
- package/dist/operations/catalogue/frost.d.ts.map +1 -0
- package/dist/operations/catalogue/frost.js +111 -0
- package/dist/operations/catalogue/fxInstances.d.ts +21 -0
- package/dist/operations/catalogue/fxInstances.d.ts.map +1 -0
- package/dist/operations/catalogue/fxInstances.js +47 -0
- package/dist/operations/catalogue/fxPoints.d.ts +22 -0
- package/dist/operations/catalogue/fxPoints.d.ts.map +1 -0
- package/dist/operations/catalogue/fxPoints.js +70 -0
- package/dist/operations/catalogue/glow.d.ts.map +1 -1
- package/dist/operations/catalogue/glow.js +2 -1
- package/dist/operations/catalogue/heatCracks.d.ts +3 -0
- package/dist/operations/catalogue/heatCracks.d.ts.map +1 -0
- package/dist/operations/catalogue/heatCracks.js +134 -0
- package/dist/operations/catalogue/hologram.d.ts +3 -0
- package/dist/operations/catalogue/hologram.d.ts.map +1 -0
- package/dist/operations/catalogue/hologram.js +118 -0
- package/dist/operations/catalogue/inkBloom.d.ts +3 -0
- package/dist/operations/catalogue/inkBloom.d.ts.map +1 -0
- package/dist/operations/catalogue/inkBloom.js +156 -0
- package/dist/operations/catalogue/ivy.d.ts +13 -0
- package/dist/operations/catalogue/ivy.d.ts.map +1 -0
- package/dist/operations/catalogue/ivy.js +469 -0
- package/dist/operations/catalogue/jelly.d.ts +3 -0
- package/dist/operations/catalogue/jelly.d.ts.map +1 -0
- package/dist/operations/catalogue/jelly.js +50 -0
- package/dist/operations/catalogue/kintsugi.d.ts +3 -0
- package/dist/operations/catalogue/kintsugi.d.ts.map +1 -0
- package/dist/operations/catalogue/kintsugi.js +173 -0
- package/dist/operations/catalogue/lidarScan.d.ts +3 -0
- package/dist/operations/catalogue/lidarScan.d.ts.map +1 -0
- package/dist/operations/catalogue/lidarScan.js +240 -0
- package/dist/operations/catalogue/liquidMetal.d.ts +3 -0
- package/dist/operations/catalogue/liquidMetal.d.ts.map +1 -0
- package/dist/operations/catalogue/liquidMetal.js +122 -0
- package/dist/operations/catalogue/metalize.d.ts +3 -0
- package/dist/operations/catalogue/metalize.d.ts.map +1 -0
- package/dist/operations/catalogue/metalize.js +135 -0
- package/dist/operations/catalogue/moveToFront.d.ts.map +1 -1
- package/dist/operations/catalogue/moveToFront.js +1 -0
- package/dist/operations/catalogue/orbit.d.ts +3 -0
- package/dist/operations/catalogue/orbit.d.ts.map +1 -0
- package/dist/operations/catalogue/orbit.js +29 -0
- package/dist/operations/catalogue/particleSwarm.d.ts +3 -0
- package/dist/operations/catalogue/particleSwarm.d.ts.map +1 -0
- package/dist/operations/catalogue/particleSwarm.js +138 -0
- package/dist/operations/catalogue/petalPeel.d.ts +3 -0
- package/dist/operations/catalogue/petalPeel.d.ts.map +1 -0
- package/dist/operations/catalogue/petalPeel.js +137 -0
- package/dist/operations/catalogue/petrify.d.ts +3 -0
- package/dist/operations/catalogue/petrify.d.ts.map +1 -0
- package/dist/operations/catalogue/petrify.js +94 -0
- package/dist/operations/catalogue/portal.d.ts +3 -0
- package/dist/operations/catalogue/portal.d.ts.map +1 -0
- package/dist/operations/catalogue/portal.js +224 -0
- package/dist/operations/catalogue/print3d.d.ts +3 -0
- package/dist/operations/catalogue/print3d.d.ts.map +1 -0
- package/dist/operations/catalogue/print3d.js +275 -0
- package/dist/operations/catalogue/rainBeads.d.ts +3 -0
- package/dist/operations/catalogue/rainBeads.d.ts.map +1 -0
- package/dist/operations/catalogue/rainBeads.js +223 -0
- package/dist/operations/catalogue/restPose.d.ts +21 -0
- package/dist/operations/catalogue/restPose.d.ts.map +1 -0
- package/dist/operations/catalogue/restPose.js +55 -0
- package/dist/operations/catalogue/rimLight.d.ts +3 -0
- package/dist/operations/catalogue/rimLight.d.ts.map +1 -0
- package/dist/operations/catalogue/rimLight.js +72 -0
- package/dist/operations/catalogue/sandErosion.d.ts +3 -0
- package/dist/operations/catalogue/sandErosion.d.ts.map +1 -0
- package/dist/operations/catalogue/sandErosion.js +167 -0
- package/dist/operations/catalogue/shaderLayers.d.ts +74 -0
- package/dist/operations/catalogue/shaderLayers.d.ts.map +1 -0
- package/dist/operations/catalogue/shaderLayers.js +322 -0
- package/dist/operations/catalogue/shatter.d.ts +3 -0
- package/dist/operations/catalogue/shatter.d.ts.map +1 -0
- package/dist/operations/catalogue/shatter.js +267 -0
- package/dist/operations/catalogue/silkDrape.d.ts +3 -0
- package/dist/operations/catalogue/silkDrape.d.ts.map +1 -0
- package/dist/operations/catalogue/silkDrape.js +340 -0
- package/dist/operations/catalogue/spin.d.ts +3 -0
- package/dist/operations/catalogue/spin.d.ts.map +1 -0
- package/dist/operations/catalogue/spin.js +42 -0
- package/dist/operations/catalogue/surfaceSample.d.ts +17 -0
- package/dist/operations/catalogue/surfaceSample.d.ts.map +1 -0
- package/dist/operations/catalogue/surfaceSample.js +187 -0
- package/dist/operations/catalogue/swirl.d.ts +3 -0
- package/dist/operations/catalogue/swirl.d.ts.map +1 -0
- package/dist/operations/catalogue/swirl.js +69 -0
- package/dist/operations/catalogue/teleport.d.ts +3 -0
- package/dist/operations/catalogue/teleport.d.ts.map +1 -0
- package/dist/operations/catalogue/teleport.js +213 -0
- package/dist/operations/catalogue/transitionField.d.ts +124 -0
- package/dist/operations/catalogue/transitionField.d.ts.map +1 -0
- package/dist/operations/catalogue/transitionField.js +278 -0
- package/dist/operations/catalogue/unweave.d.ts +3 -0
- package/dist/operations/catalogue/unweave.d.ts.map +1 -0
- package/dist/operations/catalogue/unweave.js +233 -0
- package/dist/operations/catalogue/visibility.d.ts.map +1 -1
- package/dist/operations/catalogue/visibility.js +1 -0
- package/dist/operations/catalogue/voxelize.d.ts +3 -0
- package/dist/operations/catalogue/voxelize.d.ts.map +1 -0
- package/dist/operations/catalogue/voxelize.js +148 -0
- package/dist/operations/catalogue/warmup.d.ts +22 -0
- package/dist/operations/catalogue/warmup.d.ts.map +1 -0
- package/dist/operations/catalogue/warmup.js +106 -0
- package/dist/operations/catalogue/zoom.d.ts.map +1 -1
- package/dist/operations/catalogue/zoom.js +1 -0
- package/dist/operations/index.d.ts +4 -2
- package/dist/operations/index.d.ts.map +1 -1
- package/dist/operations/index.js +4 -2
- package/dist/operations/objectEffects.d.ts +46 -0
- package/dist/operations/objectEffects.d.ts.map +1 -0
- package/dist/operations/objectEffects.js +136 -0
- package/dist/operations/registry.d.ts +7 -2
- package/dist/operations/registry.d.ts.map +1 -1
- package/dist/operations/registry.js +45 -3
- package/dist/operations/runtime.d.ts +40 -2
- package/dist/operations/runtime.d.ts.map +1 -1
- package/dist/operations/runtime.js +164 -8
- package/dist/operations/types.d.ts +29 -3
- package/dist/operations/types.d.ts.map +1 -1
- package/dist/operations/types.js +6 -0
- package/dist/operations/useObjectEffectLayers.d.ts +4 -0
- package/dist/operations/useObjectEffectLayers.d.ts.map +1 -0
- package/dist/operations/useObjectEffectLayers.js +42 -0
- package/dist/operations/useOperationsRuntime.d.ts.map +1 -1
- package/dist/operations/useOperationsRuntime.js +42 -4
- package/dist/presets/landscapePresets.d.ts +1 -1
- package/dist/presets/landscapePresets.d.ts.map +1 -1
- package/dist/presets/landscapePresets.js +1 -1
- package/dist/presets/landscapeTypes.d.ts +1 -1
- package/dist/presets/landscapeTypes.d.ts.map +1 -1
- package/dist/presets/landscapeTypes.js +1 -1
- package/dist/presets/oceanSurfacePresets.d.ts +1 -1
- package/dist/presets/terrainPresets.d.ts +1 -1
- package/dist/presets/terrainPresets.d.ts.map +1 -1
- package/dist/presets/volumetricCloudPresets.d.ts +1 -1
- package/dist/types/cloudConfigs.d.ts +2 -309
- package/dist/types/cloudConfigs.d.ts.map +1 -1
- package/dist/types/cloudConfigs.js +2 -339
- package/dist/types/index.d.ts +8 -8
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +4 -4
- package/dist/types/landscapeConfigs.d.ts +2 -217
- package/dist/types/landscapeConfigs.d.ts.map +1 -1
- package/dist/types/landscapeConfigs.js +2 -256
- package/dist/types/oceanConfigs.d.ts +2 -289
- package/dist/types/oceanConfigs.d.ts.map +1 -1
- package/dist/types/oceanConfigs.js +2 -380
- package/dist/types/terrainConfigs.d.ts +2 -250
- package/dist/types/terrainConfigs.d.ts.map +1 -1
- package/dist/types/terrainConfigs.js +2 -292
- package/dist/utils/cloudUniforms.d.ts +1 -1
- package/dist/utils/configAnimations.d.ts +6 -0
- package/dist/utils/configAnimations.d.ts.map +1 -1
- package/dist/utils/configAnimations.js +14 -0
- package/dist/utils/gridConfig.d.ts +19 -0
- package/dist/utils/gridConfig.d.ts.map +1 -0
- package/dist/utils/gridConfig.js +52 -0
- package/dist/utils/handleCloudsAnimations.d.ts +1 -1
- package/dist/utils/handleCloudsAnimations.js +1 -1
- package/dist/utils/hasHoverAnimation.d.ts.map +1 -1
- package/dist/utils/hasHoverAnimation.js +0 -2
- package/dist/utils/landscapeUniforms.d.ts +1 -1
- package/dist/utils/landscapeUniforms.d.ts.map +1 -1
- package/dist/utils/oceanUniforms.d.ts +1 -1
- package/dist/utils/particleShape.d.ts +33 -0
- package/dist/utils/particleShape.d.ts.map +1 -0
- package/dist/utils/particleShape.js +207 -0
- package/dist/utils/particleTrails.d.ts.map +1 -1
- package/dist/utils/particleTrails.js +29 -14
- package/dist/utils/terrainUniforms.d.ts +1 -1
- package/dist/utils/terrainUniforms.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,43 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// ClipsRuntime — plays, poses and restores clips and sequences. Execution only.
|
|
3
|
+
// =============================================================================
|
|
4
|
+
//
|
|
5
|
+
// Data lives in Redux (animationClipsSlice, animationSequencesSlice); this holds
|
|
6
|
+
// runtime instances:
|
|
7
|
+
//
|
|
8
|
+
// clip instance — one clip on its own clock. Honours the clip's loop, yoyo
|
|
9
|
+
// and endMode.
|
|
10
|
+
// sequence instance — one clock over a resolved schedule (sequenceUtils). Each
|
|
11
|
+
// scheduled clip plays once, forward, at its own local time;
|
|
12
|
+
// loop / yoyo / reverse / endMode act on the whole sequence.
|
|
13
|
+
//
|
|
14
|
+
// Either kind is `playing` (time advances by frame delta × speed, not wall clock,
|
|
15
|
+
// so pause / seek / speed are exact) or posed (held at a time: the editor
|
|
16
|
+
// playhead, a finished 'hold', a seek).
|
|
17
|
+
//
|
|
18
|
+
// Each frame every active driver proposes a value per property; the proposals are
|
|
19
|
+
// merged in priority order (activation order; inside a sequence, schedule order)
|
|
20
|
+
// so the last one wins, and only a property whose WINNING value changed is
|
|
21
|
+
// written. Writing a material property every frame would flag it for recompile,
|
|
22
|
+
// and re-writing an unchanged camera would fight the user's orbit.
|
|
23
|
+
//
|
|
24
|
+
// A property that stops being driven (stop, a 'restore' end, a sequence entry
|
|
25
|
+
// scrubbed back before its start) is written back to its authored value.
|
|
26
|
+
//
|
|
27
|
+
// Sequence cues switch actions (SceneActions) by time: each tick a sequence works
|
|
28
|
+
// out which of its actions should be on at its current time and applies / reverts
|
|
29
|
+
// only what changed. It reverts only what it applied itself — an action already on
|
|
30
|
+
// (a click, the API) is left alone. Effects run while the sequence plays (or is
|
|
31
|
+
// driven); a posed sequence (the editor's scrub) applies patches only. Stopping
|
|
32
|
+
// the sequence reverts its actions; a 'hold' finish keeps them.
|
|
33
|
+
//
|
|
34
|
+
import { SceneActions } from '@3driseai/3drise-core';
|
|
1
35
|
import { getAtPath, sampleTrack } from './clipUtils.js';
|
|
2
|
-
import { applyValue, clearApplierCaches } from './appliers.js';
|
|
36
|
+
import { applyValue, clearApplierCaches, isTargetMounted } from './appliers.js';
|
|
3
37
|
import { restoreNodeTrack } from './nodeTracks.js';
|
|
4
|
-
import { entryLocalTime, isEntryActive, resolveSequence, } from './sequenceUtils.js';
|
|
38
|
+
import { cueStatesAt, entryLocalTime, isEntryActive, resolveSequence, } from './sequenceUtils.js';
|
|
39
|
+
/** Longest an autoplaying sequence waits for its targets. */
|
|
40
|
+
const MAX_TARGET_WAIT_MS = 8000;
|
|
5
41
|
const targetKey = (state, node, path) => `${state}|${node ?? ''}|${path}`;
|
|
6
42
|
class ClipsRuntime {
|
|
7
43
|
clips = new Map();
|
|
@@ -10,26 +46,79 @@ class ClipsRuntime {
|
|
|
10
46
|
order = 0;
|
|
11
47
|
version = 0;
|
|
12
48
|
listeners = new Set();
|
|
49
|
+
/** Coarse: play / pause / stop / start / end / reset / data edits — never per frame. */
|
|
50
|
+
stateVersion = 0;
|
|
51
|
+
stateListeners = new Set();
|
|
13
52
|
eventListeners = new Set();
|
|
14
53
|
/** tracks whose authored value must be written back on the next tick */
|
|
15
54
|
pendingRestore = [];
|
|
16
55
|
/** last written value per property (targetKey -> JSON) */
|
|
17
56
|
written = new Map();
|
|
57
|
+
// --- diagnostics ------------------------------------------------------------------
|
|
58
|
+
// On with `?animdebug=1` in the URL, or localStorage '3drise.animdebug' = '1'
|
|
59
|
+
// (ClipPlayer reads it). Logs every lifecycle call on sequences (with the caller's
|
|
60
|
+
// stack for the ones that stop / pose / pause), the target wait, progress once a
|
|
61
|
+
// second, and writes that don't land. Nothing changes behaviour.
|
|
62
|
+
debug = false;
|
|
63
|
+
logAt = new Map();
|
|
64
|
+
dlog(...args) {
|
|
65
|
+
if (this.debug)
|
|
66
|
+
console.log('%c[anim]', 'color:#a78bfa;font-weight:bold', `${(performance.now() / 1000).toFixed(2)}s`, ...args);
|
|
67
|
+
}
|
|
68
|
+
/** At most once per `ms` per key. */
|
|
69
|
+
dlogEvery(key, ms, ...args) {
|
|
70
|
+
if (!this.debug)
|
|
71
|
+
return;
|
|
72
|
+
const now = performance.now();
|
|
73
|
+
if (now - (this.logAt.get(key) ?? -Infinity) < ms)
|
|
74
|
+
return;
|
|
75
|
+
this.logAt.set(key, now);
|
|
76
|
+
this.dlog(...args);
|
|
77
|
+
}
|
|
78
|
+
caller() {
|
|
79
|
+
return (new Error().stack ?? '').split('\n').slice(3, 8).map(l => l.trim()).join(' ← ');
|
|
80
|
+
}
|
|
18
81
|
// --- wiring -------------------------------------------------------------------
|
|
19
82
|
setContext(ctx) {
|
|
83
|
+
this.dlog('setContext', ctx ? { camera: !!ctx.camera, controls: !!ctx.controls, getAction: !!ctx.getAction } : null);
|
|
20
84
|
this.ctx = ctx;
|
|
21
85
|
this.written.clear();
|
|
22
86
|
clearApplierCaches();
|
|
23
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Every change, including each frame's time while anything plays. For UI that
|
|
90
|
+
* follows the playhead, write through refs in the listener — never re-render React
|
|
91
|
+
* per frame (the timeline panels would re-render ~60×/s on the render thread).
|
|
92
|
+
*/
|
|
24
93
|
subscribe(listener) {
|
|
25
94
|
this.listeners.add(listener);
|
|
26
95
|
return () => this.listeners.delete(listener);
|
|
27
96
|
}
|
|
28
97
|
getVersion() { return this.version; }
|
|
98
|
+
/** State changes only (play / pause / stop / start / end / reset / edits) — safe for React. */
|
|
99
|
+
subscribeState(listener) {
|
|
100
|
+
this.stateListeners.add(listener);
|
|
101
|
+
return () => this.stateListeners.delete(listener);
|
|
102
|
+
}
|
|
103
|
+
getStateVersion() { return this.stateVersion; }
|
|
29
104
|
on(listener) {
|
|
30
105
|
this.eventListeners.add(listener);
|
|
31
106
|
return () => this.eventListeners.delete(listener);
|
|
32
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Forget every instance without writing anything back — a new scene is loading
|
|
110
|
+
* (the singleton outlives a route change: whatever the studio was playing must not
|
|
111
|
+
* carry into the published view).
|
|
112
|
+
*/
|
|
113
|
+
reset() {
|
|
114
|
+
this.dlog('reset', { clips: this.clips.size, sequences: [...this.sequences.values()].map(i => i.seq.name) }, this.caller());
|
|
115
|
+
this.clips.clear();
|
|
116
|
+
this.sequences.clear();
|
|
117
|
+
this.pendingRestore = [];
|
|
118
|
+
this.written.clear();
|
|
119
|
+
clearApplierCaches();
|
|
120
|
+
this.bumpState();
|
|
121
|
+
}
|
|
33
122
|
// --- clips ----------------------------------------------------------------------
|
|
34
123
|
play(clip, opts = {}) {
|
|
35
124
|
const existing = this.clips.get(clip.id);
|
|
@@ -42,21 +131,21 @@ class ClipsRuntime {
|
|
|
42
131
|
time = clip.duration;
|
|
43
132
|
this.clips.set(clip.id, { clip, time, speed: opts.speed ?? 1, direction, playing: true, order: ++this.order });
|
|
44
133
|
this.emit({ type: 'start', kind: 'clip', id: clip.id });
|
|
45
|
-
this.
|
|
134
|
+
this.bumpState();
|
|
46
135
|
}
|
|
47
136
|
pause(clipId) {
|
|
48
137
|
const inst = this.clips.get(clipId);
|
|
49
138
|
if (!inst)
|
|
50
139
|
return;
|
|
51
140
|
inst.playing = false;
|
|
52
|
-
this.
|
|
141
|
+
this.bumpState();
|
|
53
142
|
}
|
|
54
143
|
resume(clipId) {
|
|
55
144
|
const inst = this.clips.get(clipId);
|
|
56
145
|
if (!inst)
|
|
57
146
|
return;
|
|
58
147
|
inst.playing = true;
|
|
59
|
-
this.
|
|
148
|
+
this.bumpState();
|
|
60
149
|
}
|
|
61
150
|
/** Stop and put the clip's properties back to their authored values. */
|
|
62
151
|
stop(clipId) {
|
|
@@ -65,7 +154,7 @@ class ClipsRuntime {
|
|
|
65
154
|
return;
|
|
66
155
|
this.clips.delete(clipId);
|
|
67
156
|
this.pendingRestore.push(...inst.clip.tracks);
|
|
68
|
-
this.
|
|
157
|
+
this.bumpState();
|
|
69
158
|
}
|
|
70
159
|
/** Hold the clip at t (seconds) — the editor playhead, or seek() from outside. */
|
|
71
160
|
pose(clip, t) {
|
|
@@ -74,11 +163,12 @@ class ClipsRuntime {
|
|
|
74
163
|
if (inst) {
|
|
75
164
|
inst.clip = clip;
|
|
76
165
|
inst.time = time;
|
|
166
|
+
this.bump();
|
|
77
167
|
}
|
|
78
168
|
else {
|
|
79
169
|
this.clips.set(clip.id, { clip, time, speed: 1, direction: 1, playing: false, order: ++this.order });
|
|
170
|
+
this.bumpState();
|
|
80
171
|
}
|
|
81
|
-
this.bump();
|
|
82
172
|
}
|
|
83
173
|
/** The clip data changed (editor edit): keep time and play state, use the new tracks. */
|
|
84
174
|
updateClip(clip) {
|
|
@@ -91,7 +181,7 @@ class ClipsRuntime {
|
|
|
91
181
|
inst.clip = clip;
|
|
92
182
|
inst.time = Math.min(inst.time, clip.duration);
|
|
93
183
|
this.written.clear(); // values may have changed under the same time
|
|
94
|
-
this.
|
|
184
|
+
this.bumpState();
|
|
95
185
|
}
|
|
96
186
|
getTime(clipId) { return this.clips.get(clipId)?.time ?? 0; }
|
|
97
187
|
isPlaying(clipId) { return !!this.clips.get(clipId)?.playing; }
|
|
@@ -128,9 +218,16 @@ class ClipsRuntime {
|
|
|
128
218
|
playing: true,
|
|
129
219
|
order: ++this.order,
|
|
130
220
|
active: existing?.active ?? new Set(),
|
|
221
|
+
cueState: existing?.cueState ?? new Map(),
|
|
222
|
+
owned: existing?.owned ?? new Set(),
|
|
223
|
+
waitUntil: opts.waitForTargets ? Date.now() + MAX_TARGET_WAIT_MS : undefined,
|
|
131
224
|
});
|
|
225
|
+
this.dlog('playSequence', seq.name, {
|
|
226
|
+
id: seq.id, driven, driver: seq.driver, time, duration: schedule.duration, entries: schedule.entries.length,
|
|
227
|
+
steps: seq.steps.length, cues: schedule.cues.length, waitForTargets: !!opts.waitForTargets, replaced: !!existing,
|
|
228
|
+
}, this.caller());
|
|
132
229
|
this.emit({ type: 'start', kind: 'sequence', id: seq.id });
|
|
133
|
-
this.
|
|
230
|
+
this.bumpState();
|
|
134
231
|
}
|
|
135
232
|
// --- input drivers --------------------------------------------------------------
|
|
136
233
|
/** Driven sequences that are running — what the input layer (ClipPlayer) feeds. */
|
|
@@ -194,28 +291,33 @@ class ClipsRuntime {
|
|
|
194
291
|
const inst = this.sequences.get(seqId);
|
|
195
292
|
if (!inst)
|
|
196
293
|
return;
|
|
294
|
+
this.dlog('pauseSequence', inst.seq.name, this.caller());
|
|
197
295
|
inst.playing = false;
|
|
198
|
-
this.
|
|
296
|
+
this.bumpState();
|
|
199
297
|
}
|
|
200
298
|
resumeSequence(seqId) {
|
|
201
299
|
const inst = this.sequences.get(seqId);
|
|
202
300
|
if (!inst)
|
|
203
301
|
return;
|
|
302
|
+
this.dlog('resumeSequence', inst.seq.name);
|
|
204
303
|
inst.playing = true;
|
|
205
|
-
this.
|
|
304
|
+
this.bumpState();
|
|
206
305
|
}
|
|
207
306
|
/** Stop and put every property the sequence drove back to its authored value. */
|
|
208
307
|
stopSequence(seqId) {
|
|
209
308
|
const inst = this.sequences.get(seqId);
|
|
210
309
|
if (!inst)
|
|
211
310
|
return;
|
|
311
|
+
this.dlog('stopSequence', inst.seq.name, this.caller());
|
|
212
312
|
this.sequences.delete(seqId);
|
|
213
313
|
inst.schedule.entries.forEach(e => this.pendingRestore.push(...e.clip.tracks));
|
|
214
|
-
this.
|
|
314
|
+
this.releaseActions(inst);
|
|
315
|
+
this.bumpState();
|
|
215
316
|
}
|
|
216
317
|
/** Hold the sequence at T (sequence seconds) — the panel's scrub, or seek(). */
|
|
217
318
|
poseSequence(seq, clips, T) {
|
|
218
319
|
const inst = this.sequences.get(seq.id);
|
|
320
|
+
this.dlog('poseSequence', seq.name, { T, existing: !!inst, wasPlaying: !!inst?.playing }, this.caller());
|
|
219
321
|
if (inst) {
|
|
220
322
|
// Edited data goes through the re-resolve path (restores what the old schedule drove).
|
|
221
323
|
if (inst.seq !== seq)
|
|
@@ -229,7 +331,10 @@ class ClipsRuntime {
|
|
|
229
331
|
this.sequences.set(seq.id, {
|
|
230
332
|
seq, schedule, time, target: time, driven: false,
|
|
231
333
|
speed: 1, direction: 1, baseDirection: 1, playing: false, order: ++this.order, active: new Set(),
|
|
334
|
+
cueState: new Map(), owned: new Set(),
|
|
232
335
|
});
|
|
336
|
+
this.bumpState();
|
|
337
|
+
return;
|
|
233
338
|
}
|
|
234
339
|
this.bump();
|
|
235
340
|
}
|
|
@@ -238,6 +343,7 @@ class ClipsRuntime {
|
|
|
238
343
|
const inst = this.sequences.get(seq.id);
|
|
239
344
|
if (!inst)
|
|
240
345
|
return;
|
|
346
|
+
this.dlog('updateSequence', seq.name, { playing: inst.playing, time: inst.time }, this.caller());
|
|
241
347
|
// Restore everything the old schedule drove; whatever is still driven re-writes this frame.
|
|
242
348
|
inst.schedule.entries.forEach(e => this.pendingRestore.push(...e.clip.tracks));
|
|
243
349
|
inst.seq = seq;
|
|
@@ -248,7 +354,27 @@ class ClipsRuntime {
|
|
|
248
354
|
if (inst.playing)
|
|
249
355
|
inst.driven = isDriven(seq);
|
|
250
356
|
inst.active = new Set();
|
|
251
|
-
this.
|
|
357
|
+
this.bumpState();
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Whether a PLAYING clip or sequence writes the camera right now. The player then
|
|
361
|
+
* holds OrbitControls off so its own update (damping, distance / angle limits,
|
|
362
|
+
* auto-rotate) doesn't fight the animation. A posed (paused) one doesn't count —
|
|
363
|
+
* in the editor you can still orbit around a held pose.
|
|
364
|
+
*/
|
|
365
|
+
isDrivingCamera() {
|
|
366
|
+
const camera = (tracks) => tracks.some(t => t.state === 'camera' && !t.muted && t.keys.length > 0);
|
|
367
|
+
for (const inst of this.clips.values())
|
|
368
|
+
if (inst.playing && camera(inst.clip.tracks))
|
|
369
|
+
return true;
|
|
370
|
+
for (const inst of this.sequences.values()) {
|
|
371
|
+
if (!inst.playing)
|
|
372
|
+
continue;
|
|
373
|
+
for (const e of inst.schedule.entries)
|
|
374
|
+
if (inst.active.has(e.id) && camera(e.clip.tracks))
|
|
375
|
+
return true;
|
|
376
|
+
}
|
|
377
|
+
return false;
|
|
252
378
|
}
|
|
253
379
|
getSequenceTime(seqId) { return this.sequences.get(seqId)?.time ?? 0; }
|
|
254
380
|
getSequenceDuration(seqId) { return this.sequences.get(seqId)?.schedule.duration ?? 0; }
|
|
@@ -257,8 +383,11 @@ class ClipsRuntime {
|
|
|
257
383
|
// --- frame ------------------------------------------------------------------
|
|
258
384
|
tick(delta) {
|
|
259
385
|
const ctx = this.ctx;
|
|
260
|
-
if (!ctx)
|
|
386
|
+
if (!ctx) {
|
|
387
|
+
if (this.sequences.size || this.clips.size)
|
|
388
|
+
this.dlogEvery('noctx', 1000, 'tick skipped: no context yet', { sequences: this.sequences.size });
|
|
261
389
|
return;
|
|
390
|
+
}
|
|
262
391
|
const dt = Math.min(delta, 0.1);
|
|
263
392
|
let anyPlaying = false;
|
|
264
393
|
for (const inst of this.clips.values()) {
|
|
@@ -271,7 +400,20 @@ class ClipsRuntime {
|
|
|
271
400
|
if (!inst.playing)
|
|
272
401
|
continue;
|
|
273
402
|
anyPlaying = true;
|
|
403
|
+
if (inst.waitUntil !== undefined) {
|
|
404
|
+
const missing = this.missingTargets(ctx, inst);
|
|
405
|
+
if (Date.now() < inst.waitUntil && missing.length) {
|
|
406
|
+
this.dlogEvery(`wait:${inst.seq.id}`, 1000, 'waiting for targets', inst.seq.name, missing);
|
|
407
|
+
continue; // hold at the start
|
|
408
|
+
}
|
|
409
|
+
this.dlog('wait over', inst.seq.name, missing.length ? { reason: 'timeout', stillMissing: missing } : { reason: 'all targets mounted' });
|
|
410
|
+
inst.waitUntil = undefined;
|
|
411
|
+
}
|
|
274
412
|
this.advanceSequence(inst, dt);
|
|
413
|
+
this.dlogEvery(`adv:${inst.seq.id}`, 1000, 'playing', inst.seq.name, {
|
|
414
|
+
time: round2(inst.time), duration: round2(inst.schedule.duration), driven: inst.driven,
|
|
415
|
+
...(inst.driven ? { target: round2(inst.target) } : {}), delta: round2(delta),
|
|
416
|
+
});
|
|
275
417
|
}
|
|
276
418
|
// Sequence entries that stopped writing (scrubbed back before their start, or
|
|
277
419
|
// a 'restore' clip past its end) give their properties back.
|
|
@@ -289,12 +431,20 @@ class ClipsRuntime {
|
|
|
289
431
|
}
|
|
290
432
|
inst.active = now;
|
|
291
433
|
}
|
|
434
|
+
// Cued actions: patches land before this frame's restores and writes read them.
|
|
435
|
+
// A sequence still waiting for its targets doesn't fire its cues yet — their
|
|
436
|
+
// effects would run on objects that aren't there (and never run again).
|
|
437
|
+
for (const inst of this.sequences.values()) {
|
|
438
|
+
if (inst.waitUntil === undefined)
|
|
439
|
+
this.syncCues(ctx, inst);
|
|
440
|
+
}
|
|
292
441
|
if (this.pendingRestore.length)
|
|
293
442
|
this.runRestores(ctx);
|
|
294
443
|
// Proposals in priority order; the last one per property wins.
|
|
295
444
|
const winners = new Map();
|
|
296
445
|
for (const p of this.proposals())
|
|
297
446
|
winners.set(targetKey(p.state, p.node, p.path), p);
|
|
447
|
+
const failed = [];
|
|
298
448
|
for (const [key, p] of winners) {
|
|
299
449
|
const json = JSON.stringify(p.value);
|
|
300
450
|
if (this.written.get(key) === json)
|
|
@@ -303,10 +453,81 @@ class ClipsRuntime {
|
|
|
303
453
|
// loading) is retried next frame instead of being skipped for good.
|
|
304
454
|
if (applyValue(ctx, p.state, p.path, p.value, p.node))
|
|
305
455
|
this.written.set(key, json);
|
|
456
|
+
else if (this.debug)
|
|
457
|
+
failed.push(key);
|
|
306
458
|
}
|
|
459
|
+
if (failed.length)
|
|
460
|
+
this.dlogEvery('failed', 1000, `writes not landed (${failed.length})`, failed.slice(0, 12));
|
|
307
461
|
if (anyPlaying)
|
|
308
462
|
this.bump();
|
|
309
463
|
}
|
|
464
|
+
/** Objects / nodes the sequence animates — or its cued actions touch — that aren't in the scene yet. */
|
|
465
|
+
missingTargets(ctx, inst) {
|
|
466
|
+
const missing = new Set();
|
|
467
|
+
for (const e of inst.schedule.entries) {
|
|
468
|
+
for (const t of e.clip.tracks) {
|
|
469
|
+
if (t.muted || !t.keys.length)
|
|
470
|
+
continue;
|
|
471
|
+
if (!isTargetMounted(ctx, t.state, t.node))
|
|
472
|
+
missing.add(t.node ? `${t.state} › ${t.node}` : t.state);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
if (ctx.getAction) {
|
|
476
|
+
for (const sc of inst.schedule.cues) {
|
|
477
|
+
const action = ctx.getAction(sc.cue.actionId);
|
|
478
|
+
if (!action)
|
|
479
|
+
continue;
|
|
480
|
+
for (const t of action.targets ?? [])
|
|
481
|
+
if (!isTargetMounted(ctx, t.state))
|
|
482
|
+
missing.add(t.state);
|
|
483
|
+
for (const eff of action.effects ?? []) {
|
|
484
|
+
for (const id of eff.targets ?? [])
|
|
485
|
+
if (id !== 'self' && !isTargetMounted(ctx, id))
|
|
486
|
+
missing.add(id);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
return [...missing];
|
|
491
|
+
}
|
|
492
|
+
/** Apply / revert the actions whose cue state changed since the last tick. */
|
|
493
|
+
syncCues(ctx, inst) {
|
|
494
|
+
if (!ctx.getAction)
|
|
495
|
+
return;
|
|
496
|
+
const wanted = cueStatesAt(inst.schedule, inst.time);
|
|
497
|
+
const ids = new Set([...wanted.keys(), ...inst.cueState.keys()]);
|
|
498
|
+
for (const id of ids) {
|
|
499
|
+
const on = wanted.get(id) ?? false; // a removed cue counts as off
|
|
500
|
+
if ((inst.cueState.get(id) ?? false) === on) {
|
|
501
|
+
if (!wanted.has(id))
|
|
502
|
+
inst.cueState.delete(id);
|
|
503
|
+
continue;
|
|
504
|
+
}
|
|
505
|
+
if (wanted.has(id))
|
|
506
|
+
inst.cueState.set(id, on);
|
|
507
|
+
else
|
|
508
|
+
inst.cueState.delete(id);
|
|
509
|
+
if (on) {
|
|
510
|
+
if (SceneActions.isActionApplied(id))
|
|
511
|
+
continue; // someone else's — leave it
|
|
512
|
+
const action = ctx.getAction(id);
|
|
513
|
+
if (!action)
|
|
514
|
+
continue;
|
|
515
|
+
SceneActions.applyAction(action, { effects: inst.playing });
|
|
516
|
+
inst.owned.add(id);
|
|
517
|
+
}
|
|
518
|
+
else if (inst.owned.has(id)) {
|
|
519
|
+
inst.owned.delete(id);
|
|
520
|
+
SceneActions.revertAction(id);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
/** Revert every action the sequence applied (stop / close). */
|
|
525
|
+
releaseActions(inst) {
|
|
526
|
+
for (const id of inst.owned)
|
|
527
|
+
SceneActions.revertAction(id);
|
|
528
|
+
inst.owned.clear();
|
|
529
|
+
inst.cueState.clear();
|
|
530
|
+
}
|
|
310
531
|
/** Every driver's values for this frame, lowest priority first. */
|
|
311
532
|
*proposals() {
|
|
312
533
|
const drivers = [];
|
|
@@ -391,6 +612,7 @@ class ClipsRuntime {
|
|
|
391
612
|
}
|
|
392
613
|
finishClip(inst) {
|
|
393
614
|
inst.playing = false;
|
|
615
|
+
this.bumpState();
|
|
394
616
|
this.emit({ type: 'end', kind: 'clip', id: inst.clip.id });
|
|
395
617
|
if (inst.clip.endMode === 'restore')
|
|
396
618
|
this.stop(inst.clip.id);
|
|
@@ -443,7 +665,9 @@ class ClipsRuntime {
|
|
|
443
665
|
this.finishSequence(inst);
|
|
444
666
|
}
|
|
445
667
|
finishSequence(inst) {
|
|
668
|
+
this.dlog('finished', inst.seq.name, { time: inst.time, endMode: inst.seq.endMode });
|
|
446
669
|
inst.playing = false;
|
|
670
|
+
this.bumpState();
|
|
447
671
|
this.emit({ type: 'end', kind: 'sequence', id: inst.seq.id });
|
|
448
672
|
if (inst.seq.endMode === 'restore')
|
|
449
673
|
this.stopSequence(inst.seq.id);
|
|
@@ -460,7 +684,14 @@ class ClipsRuntime {
|
|
|
460
684
|
this.version += 1;
|
|
461
685
|
this.listeners.forEach(l => l());
|
|
462
686
|
}
|
|
687
|
+
/** A state change: notifies both kinds of subscribers. */
|
|
688
|
+
bumpState() {
|
|
689
|
+
this.stateVersion += 1;
|
|
690
|
+
this.stateListeners.forEach(l => l());
|
|
691
|
+
this.bump();
|
|
692
|
+
}
|
|
463
693
|
}
|
|
694
|
+
const round2 = (n) => Math.round(n * 100) / 100;
|
|
464
695
|
const isDriven = (seq) => !!seq.driver && seq.driver !== 'time';
|
|
465
696
|
function* sampleTracks(tracks, t) {
|
|
466
697
|
for (const track of tracks) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ActionSequence } from '@3driseai/3drise-core';
|
|
1
2
|
import type { PerspectiveCamera } from 'three';
|
|
2
3
|
import type { KeyValue } from './types';
|
|
3
4
|
export interface ApplyContext {
|
|
@@ -6,11 +7,15 @@ export interface ApplyContext {
|
|
|
6
7
|
controls: any;
|
|
7
8
|
/** Authored settings for an element (object id or 'camera'), action patches included. */
|
|
8
9
|
getSettings: (state: string) => any;
|
|
10
|
+
/** Action definitions, for sequence cues. Without it cues are ignored. */
|
|
11
|
+
getAction?: (id: string) => ActionSequence | undefined;
|
|
9
12
|
}
|
|
10
13
|
export declare function clearApplierCaches(): void;
|
|
11
14
|
/** Write one value. Unknown paths are ignored (the track picker never offers them). */
|
|
12
15
|
/** Write one value to the live scene. False when its target is not mounted yet. */
|
|
13
16
|
export declare function applyValue(ctx: ApplyContext, state: string, path: string, value: KeyValue, node?: string): boolean;
|
|
17
|
+
/** Whether a track's target is in the scene yet (a model may still be loading). */
|
|
18
|
+
export declare function isTargetMounted(ctx: ApplyContext, state: string, node?: string): boolean;
|
|
14
19
|
/** Whether a (state, path) has an applier — used by the track picker. */
|
|
15
20
|
export declare function isApplicable(state: string, path: string): boolean;
|
|
16
21
|
//# sourceMappingURL=appliers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appliers.d.ts","sourceRoot":"","sources":["../../src/animationsV2/appliers.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAc/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGxC,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACjC,qDAAqD;IACrD,QAAQ,EAAE,GAAG,CAAC;IACd,yFAAyF;IACzF,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"appliers.d.ts","sourceRoot":"","sources":["../../src/animationsV2/appliers.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAc/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGxC,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACjC,qDAAqD;IACrD,QAAQ,EAAE,GAAG,CAAC;IACd,yFAAyF;IACzF,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,GAAG,CAAC;IACpC,0EAA0E;IAC1E,SAAS,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,cAAc,GAAG,SAAS,CAAC;CACxD;AAWD,wBAAgB,kBAAkB,IAAI,IAAI,CAIzC;AA2KD,uFAAuF;AACvF,mFAAmF;AACnF,wBAAgB,UAAU,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAIlH;AAED,mFAAmF;AACnF,wBAAgB,eAAe,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAKxF;AAED,yEAAyE;AACzE,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjE"}
|
|
@@ -4,7 +4,7 @@ import { CLOUD_LIVE_KEY } from '../hooks/useCloudLive.js';
|
|
|
4
4
|
import { OCEAN_LIVE_KEY } from '../hooks/useOceanLive.js';
|
|
5
5
|
import { TERRAIN_LIVE_KEY } from '../hooks/useTerrainLive.js';
|
|
6
6
|
import { createSunPosition } from '../utils/utils3d.js';
|
|
7
|
-
import { applyNodeValue, clearNodeCaches } from './nodeTracks.js';
|
|
7
|
+
import { applyNodeValue, clearNodeCaches, nodesFor } from './nodeTracks.js';
|
|
8
8
|
// --- live-target caches (cleared when the scene changes under us) -------------
|
|
9
9
|
const objectCache = new Map();
|
|
10
10
|
const handleCache = new Map();
|
|
@@ -53,10 +53,18 @@ const applyCamera = (ctx, _state, path, value) => {
|
|
|
53
53
|
const cam = ctx.camera;
|
|
54
54
|
if (!cam)
|
|
55
55
|
return false;
|
|
56
|
+
const target = ctx.controls?.target;
|
|
56
57
|
if (path === 'position') {
|
|
57
58
|
const v = asVec3(value);
|
|
58
|
-
if (v)
|
|
59
|
-
|
|
59
|
+
if (!v)
|
|
60
|
+
return;
|
|
61
|
+
cam.position.set(...v);
|
|
62
|
+
// Face the orbit target NOW: OrbitControls oriented the camera earlier this frame
|
|
63
|
+
// from the old position, so without this the view lags a frame behind and wobbles.
|
|
64
|
+
// With the controls switched off (authored), the camera keeps its own orientation.
|
|
65
|
+
const orbiting = ctx.getSettings('camera')?.controls?.enabled !== false;
|
|
66
|
+
if (target && orbiting)
|
|
67
|
+
cam.lookAt(target);
|
|
60
68
|
}
|
|
61
69
|
else if (path === 'fov' && typeof value === 'number') {
|
|
62
70
|
cam.fov = value;
|
|
@@ -64,10 +72,10 @@ const applyCamera = (ctx, _state, path, value) => {
|
|
|
64
72
|
}
|
|
65
73
|
else if (path === 'controls.target') {
|
|
66
74
|
const v = asVec3(value);
|
|
67
|
-
if (v
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
75
|
+
if (!v || !target)
|
|
76
|
+
return false;
|
|
77
|
+
target.set(...v);
|
|
78
|
+
cam.lookAt(target);
|
|
71
79
|
}
|
|
72
80
|
};
|
|
73
81
|
const applyTransform = (_ctx, state, path, value) => {
|
|
@@ -198,6 +206,16 @@ export function applyValue(ctx, state, path, value, node) {
|
|
|
198
206
|
const entry = APPLIERS.find(a => a.match(state, path));
|
|
199
207
|
return entry ? entry.apply(ctx, state, path, value) !== false : false;
|
|
200
208
|
}
|
|
209
|
+
/** Whether a track's target is in the scene yet (a model may still be loading). */
|
|
210
|
+
export function isTargetMounted(ctx, state, node) {
|
|
211
|
+
if (state === 'camera')
|
|
212
|
+
return !!ctx.camera;
|
|
213
|
+
if (state === 'sky' || state === 'clouds' || state === 'ocean' || state === 'terrain')
|
|
214
|
+
return true;
|
|
215
|
+
if (node)
|
|
216
|
+
return nodesFor(state, node).length > 0;
|
|
217
|
+
return !!objectFor(state);
|
|
218
|
+
}
|
|
201
219
|
/** Whether a (state, path) has an applier — used by the track picker. */
|
|
202
220
|
export function isApplicable(state, path) {
|
|
203
221
|
return APPLIERS.some(a => a.match(state, path));
|
|
@@ -10,7 +10,7 @@ export type { ApplyContext } from './appliers';
|
|
|
10
10
|
export { readNodeValue, NODE_TRANSFORM_PATHS, NODE_MATERIAL_KEYS } from './nodeTracks';
|
|
11
11
|
export { resolveElementSettings, isEnvironmentState, ENVIRONMENT_STATES as CLIP_ENVIRONMENT_STATES } from './elementSettings';
|
|
12
12
|
export type { ElementSources } from './elementSettings';
|
|
13
|
-
export type { AnimationClip, Track as ClipTrack, Keyframe as ClipKeyframe, KeyValue as ClipKeyValue, EaseName as ClipEaseName, SequenceStep, StepClip, AnimationSequence as ClipSequence, SequenceDriver, SequenceDriverSettings, } from './types';
|
|
13
|
+
export type { AnimationClip, Track as ClipTrack, Keyframe as ClipKeyframe, KeyValue as ClipKeyValue, EaseName as ClipEaseName, SequenceStep, StepClip, SequenceCue, AnimationSequence as ClipSequence, SequenceDriver, SequenceDriverSettings, } from './types';
|
|
14
14
|
export { DEFAULT_DRIVER_SETTINGS } from './types';
|
|
15
15
|
export { DEFAULT_EASE as CLIP_DEFAULT_EASE, FPS_PRESETS as CLIP_FPS_PRESETS } from './types';
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/animationsV2/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC5D,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvF,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,kBAAkB,IAAI,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC9H,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,YAAY,EACR,aAAa,EAAE,KAAK,IAAI,SAAS,EAAE,QAAQ,IAAI,YAAY,EAAE,QAAQ,IAAI,YAAY,EAAE,QAAQ,IAAI,YAAY,EAC/G,YAAY,EAAE,QAAQ,EAAE,iBAAiB,IAAI,YAAY,EAAE,cAAc,EAAE,sBAAsB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/animationsV2/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC5D,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvF,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,kBAAkB,IAAI,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC9H,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,YAAY,EACR,aAAa,EAAE,KAAK,IAAI,SAAS,EAAE,QAAQ,IAAI,YAAY,EAAE,QAAQ,IAAI,YAAY,EAAE,QAAQ,IAAI,YAAY,EAC/G,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,iBAAiB,IAAI,YAAY,EAAE,cAAc,EAAE,sBAAsB,GACjH,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,YAAY,IAAI,iBAAiB,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../src/animationsV2/normalize.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAkB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../src/animationsV2/normalize.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAkB,MAAM,SAAS,CAAC;AAQhF,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,GAAG,aAAa,CAarD;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,GAAG,GAAG,iBAAiB,CAyC7D"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { DEFAULT_DRIVER_SETTINGS } from './types.js';
|
|
2
2
|
const DRIVERS = ['time', 'mouseWheel', 'mouseX', 'mouseY'];
|
|
3
|
+
/** A stored flag: true / 1 / '1' / 'true' only — `!!'0'` would be true. */
|
|
4
|
+
const flag = (v) => v === true || v === 1 || v === '1' || v === 'true';
|
|
3
5
|
export function normalizeClip(row) {
|
|
4
6
|
return {
|
|
5
7
|
id: row.id,
|
|
@@ -8,8 +10,8 @@ export function normalizeClip(row) {
|
|
|
8
10
|
description: row.description ?? undefined,
|
|
9
11
|
duration: Number(row.duration) || 4,
|
|
10
12
|
fps: Number(row.fps) || 30,
|
|
11
|
-
loop:
|
|
12
|
-
yoyo:
|
|
13
|
+
loop: flag(row.loop),
|
|
14
|
+
yoyo: flag(row.yoyo),
|
|
13
15
|
endMode: row.endMode === 'restore' ? 'restore' : 'hold',
|
|
14
16
|
tracks: Array.isArray(row.tracks) ? row.tracks : [],
|
|
15
17
|
};
|
|
@@ -34,16 +36,25 @@ export function normalizeSequence(row) {
|
|
|
34
36
|
}))
|
|
35
37
|
: [],
|
|
36
38
|
})),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
cues: (Array.isArray(row.cues) ? row.cues : [])
|
|
40
|
+
.filter((c) => c && typeof c.actionId === 'string' && typeof c.stepId === 'string')
|
|
41
|
+
.map((c, i) => ({
|
|
42
|
+
id: c.id ?? `cue-${i}`,
|
|
43
|
+
actionId: c.actionId,
|
|
44
|
+
stepId: c.stepId,
|
|
45
|
+
at: Math.max(0, Number(c.at) || 0),
|
|
46
|
+
mode: c.mode === 'revert' ? 'revert' : 'apply',
|
|
47
|
+
})),
|
|
48
|
+
loop: flag(row.loop),
|
|
49
|
+
yoyo: flag(row.yoyo),
|
|
50
|
+
reverse: flag(row.reverse),
|
|
40
51
|
endMode: row.endMode === 'restore' ? 'restore' : 'hold',
|
|
41
52
|
driver: DRIVERS.includes(row.driver) ? row.driver : 'time',
|
|
42
53
|
driverSettings: {
|
|
43
54
|
sensitivity: Number(row.driverSettings?.sensitivity) > 0 ? Number(row.driverSettings.sensitivity) : DEFAULT_DRIVER_SETTINGS.sensitivity,
|
|
44
55
|
smoothing: Number(row.driverSettings?.smoothing) >= 0 ? Number(row.driverSettings.smoothing) : DEFAULT_DRIVER_SETTINGS.smoothing,
|
|
45
|
-
invert:
|
|
56
|
+
invert: flag(row.driverSettings?.invert),
|
|
46
57
|
},
|
|
47
|
-
autoplay:
|
|
58
|
+
autoplay: flag(row.autoplay),
|
|
48
59
|
};
|
|
49
60
|
}
|