@automovie/render 0.3.0 → 0.3.2

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.
Files changed (110) hide show
  1. package/lib/AutoMovieFrameGrid.d.ts +54 -0
  2. package/lib/AutoMovieFrameGrid.js +71 -0
  3. package/lib/AutoMovieFrameGrid.js.map +1 -0
  4. package/lib/AutoMovieFrameGrid.mjs +20 -0
  5. package/lib/AutoMovieFrameGrid.mjs.map +1 -0
  6. package/lib/caption/canonicalProductionWebVtt.d.ts +5 -3
  7. package/lib/caption/canonicalProductionWebVtt.js +19 -4
  8. package/lib/caption/canonicalProductionWebVtt.js.map +1 -1
  9. package/lib/caption/canonicalProductionWebVtt.mjs +15 -4
  10. package/lib/caption/canonicalProductionWebVtt.mjs.map +1 -1
  11. package/lib/draw/bindAutoMovieDrawSceneSoftProps.d.ts +15 -0
  12. package/lib/draw/bindAutoMovieDrawSceneSoftProps.js +41 -0
  13. package/lib/draw/bindAutoMovieDrawSceneSoftProps.js.map +1 -0
  14. package/lib/draw/bindAutoMovieDrawSceneSoftProps.mjs +36 -0
  15. package/lib/draw/bindAutoMovieDrawSceneSoftProps.mjs.map +1 -0
  16. package/lib/draw/index.d.ts +1 -0
  17. package/lib/draw/index.js +1 -0
  18. package/lib/draw/index.js.map +1 -1
  19. package/lib/draw/index.mjs +2 -1
  20. package/lib/index.d.ts +1 -0
  21. package/lib/index.js +1 -0
  22. package/lib/index.js.map +1 -1
  23. package/lib/index.mjs +12 -7
  24. package/lib/planSequenceRender.d.ts +5 -5
  25. package/lib/planSequenceRender.js +12 -6
  26. package/lib/planSequenceRender.js.map +1 -1
  27. package/lib/planSequenceRender.mjs +12 -8
  28. package/lib/planSequenceRender.mjs.map +1 -1
  29. package/lib/scene/IAutoMovieSceneObject.d.ts +4 -1
  30. package/lib/scene/IAutoMovieSceneSoftProps.d.ts +36 -0
  31. package/lib/scene/IAutoMovieSceneSoftProps.js +3 -0
  32. package/lib/scene/IAutoMovieSceneSoftProps.js.map +1 -0
  33. package/lib/scene/IAutoMovieSceneSoftProps.mjs +0 -0
  34. package/lib/scene/IChunkObject.d.ts +7 -3
  35. package/lib/scene/applyPracticalSurfaceMaterials.d.ts +31 -0
  36. package/lib/scene/applyPracticalSurfaceMaterials.js +87 -0
  37. package/lib/scene/applyPracticalSurfaceMaterials.js.map +1 -0
  38. package/lib/scene/applyPracticalSurfaceMaterials.mjs +47 -0
  39. package/lib/scene/applyPracticalSurfaceMaterials.mjs.map +1 -0
  40. package/lib/scene/buildInstancedFormation.d.ts +1 -1
  41. package/lib/scene/buildInstancedFormation.js +44 -19
  42. package/lib/scene/buildInstancedFormation.js.map +1 -1
  43. package/lib/scene/buildInstancedFormation.mjs +30 -13
  44. package/lib/scene/buildInstancedFormation.mjs.map +1 -1
  45. package/lib/scene/buildScene.d.ts +10 -7
  46. package/lib/scene/buildScene.js +21 -7
  47. package/lib/scene/buildScene.js.map +1 -1
  48. package/lib/scene/buildScene.mjs +27 -9
  49. package/lib/scene/buildScene.mjs.map +1 -1
  50. package/lib/scene/buildSceneSoftProps.d.ts +15 -0
  51. package/lib/scene/buildSceneSoftProps.js +71 -0
  52. package/lib/scene/buildSceneSoftProps.js.map +1 -0
  53. package/lib/scene/buildSceneSoftProps.mjs +67 -0
  54. package/lib/scene/buildSceneSoftProps.mjs.map +1 -0
  55. package/lib/scene/human-polygon/AutoMovieHumanPolygon.d.ts +52 -1
  56. package/lib/scene/human-polygon/buildHumanPolygon.d.ts +3 -1
  57. package/lib/scene/human-polygon/buildHumanPolygon.js +14 -2
  58. package/lib/scene/human-polygon/buildHumanPolygon.js.map +1 -1
  59. package/lib/scene/human-polygon/buildHumanPolygon.mjs +11 -2
  60. package/lib/scene/human-polygon/buildHumanPolygon.mjs.map +1 -1
  61. package/lib/scene/human-polygon/buildPolygonShotActor.d.ts +40 -0
  62. package/lib/scene/human-polygon/buildPolygonShotActor.js +69 -0
  63. package/lib/scene/human-polygon/buildPolygonShotActor.js.map +1 -0
  64. package/lib/scene/human-polygon/buildPolygonShotActor.mjs +74 -0
  65. package/lib/scene/human-polygon/buildPolygonShotActor.mjs.map +1 -0
  66. package/lib/scene/human-polygon/index.d.ts +1 -0
  67. package/lib/scene/human-polygon/index.js +3 -1
  68. package/lib/scene/human-polygon/index.js.map +1 -1
  69. package/lib/scene/human-polygon/index.mjs +2 -1
  70. package/lib/scene/human-polygon/prepareHumanPolygonPresentation.d.ts +17 -0
  71. package/lib/scene/human-polygon/prepareHumanPolygonPresentation.js +231 -0
  72. package/lib/scene/human-polygon/prepareHumanPolygonPresentation.js.map +1 -0
  73. package/lib/scene/human-polygon/prepareHumanPolygonPresentation.mjs +189 -0
  74. package/lib/scene/human-polygon/prepareHumanPolygonPresentation.mjs.map +1 -0
  75. package/lib/scene/index.d.ts +3 -0
  76. package/lib/scene/index.js +3 -0
  77. package/lib/scene/index.js.map +1 -1
  78. package/lib/scene/index.mjs +45 -42
  79. package/lib/scene/renderAutoMovieFilmFrame.d.ts +6 -4
  80. package/lib/scene/renderAutoMovieFilmFrame.js +12 -8
  81. package/lib/scene/renderAutoMovieFilmFrame.js.map +1 -1
  82. package/lib/scene/renderAutoMovieFilmFrame.mjs +12 -8
  83. package/lib/scene/renderAutoMovieFilmFrame.mjs.map +1 -1
  84. package/lib/scene/softPropCordSurface.d.ts +14 -0
  85. package/lib/scene/softPropCordSurface.js +128 -0
  86. package/lib/scene/softPropCordSurface.js.map +1 -0
  87. package/lib/scene/softPropCordSurface.mjs +88 -0
  88. package/lib/scene/softPropCordSurface.mjs.map +1 -0
  89. package/package.json +4 -4
  90. package/src/AutoMovieFrameGrid.ts +70 -0
  91. package/src/caption/canonicalProductionWebVtt.ts +20 -4
  92. package/src/draw/bindAutoMovieDrawSceneSoftProps.ts +43 -0
  93. package/src/draw/index.ts +1 -0
  94. package/src/index.ts +1 -0
  95. package/src/planSequenceRender.ts +21 -10
  96. package/src/scene/IAutoMovieSceneObject.ts +6 -1
  97. package/src/scene/IAutoMovieSceneSoftProps.ts +38 -0
  98. package/src/scene/IChunkObject.ts +10 -3
  99. package/src/scene/applyPracticalSurfaceMaterials.ts +79 -0
  100. package/src/scene/buildInstancedFormation.ts +86 -55
  101. package/src/scene/buildScene.ts +22 -6
  102. package/src/scene/buildSceneSoftProps.ts +83 -0
  103. package/src/scene/human-polygon/AutoMovieHumanPolygon.ts +61 -1
  104. package/src/scene/human-polygon/buildHumanPolygon.ts +22 -2
  105. package/src/scene/human-polygon/buildPolygonShotActor.ts +112 -0
  106. package/src/scene/human-polygon/index.ts +1 -0
  107. package/src/scene/human-polygon/prepareHumanPolygonPresentation.ts +328 -0
  108. package/src/scene/index.ts +3 -0
  109. package/src/scene/renderAutoMovieFilmFrame.ts +14 -9
  110. package/src/scene/softPropCordSurface.ts +132 -0
package/lib/index.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import "./caption/index.mjs";
2
2
  import "./capture/index.mjs";
3
3
  import "./delivery/index.mjs";
4
+ import { AutoMovieFrameGrid } from "./AutoMovieFrameGrid.mjs";
4
5
  import { auditAutoMovieRenderObservation } from "./auditAutoMovieRenderObservation.mjs";
5
6
  import "./draw/index.mjs";
6
7
  import { parseAutoMovieCaptionLanguage } from "./caption/parseAutoMovieCaptionLanguage.mjs";
@@ -78,6 +79,14 @@ import { decodeAutoMovieDrawPixels } from "./draw/decodeAutoMovieDrawPixels.mjs"
78
79
  import { planAutoMovieDrawCall } from "./draw/planAutoMovieDrawCall.mjs";
79
80
  import { stampAutoMovieDrawLegend } from "./draw/stampAutoMovieDrawLegend.mjs";
80
81
  import { AutoMovieDrawSession } from "./draw/AutoMovieDrawSession.mjs";
82
+ import { SPACE_GROUP_NAME } from "./scene/SPACE_GROUP_NAME.mjs";
83
+ import { buildSpaceObject } from "./scene/buildSpaceObject.mjs";
84
+ import { applyAutoMovieShadowParticipation } from "./scene/applyAutoMovieShadowParticipation.mjs";
85
+ import { restoreAutoMovieRenderModeOnce } from "./scene/restoreAutoMovieRenderModeOnce.mjs";
86
+ import { restoreAutoMovieRenderModeState } from "./scene/restoreAutoMovieRenderModeState.mjs";
87
+ import { buildSoftBodyObject } from "./scene/buildSoftBodyObject.mjs";
88
+ import { buildSceneSoftProps } from "./scene/buildSceneSoftProps.mjs";
89
+ import { bindAutoMovieDrawSceneSoftProps } from "./draw/bindAutoMovieDrawSceneSoftProps.mjs";
81
90
  import { AUTO_MOVIE_INSPECTION_PALETTE } from "./scene/inspection/AUTO_MOVIE_INSPECTION_PALETTE.mjs";
82
91
  import { autoMovieInspectionPathOf } from "./scene/inspection/autoMovieInspectionPathOf.mjs";
83
92
  import { listAutoMovieInspectionPaths } from "./scene/inspection/listAutoMovieInspectionPaths.mjs";
@@ -91,8 +100,6 @@ import { frameAutoMovieViewerSubject } from "./scene/subjectViewpoint/frameAutoM
91
100
  import { resolveAutoMovieInspectionView } from "./scene/inspection/resolveAutoMovieInspectionView.mjs";
92
101
  import { sampleAutoMovieInspectionTrails } from "./scene/inspection/sampleAutoMovieInspectionTrails.mjs";
93
102
  import { applyAutoMovieSectionPlanes } from "./scene/applyAutoMovieSectionPlanes.mjs";
94
- import { restoreAutoMovieRenderModeOnce } from "./scene/restoreAutoMovieRenderModeOnce.mjs";
95
- import { restoreAutoMovieRenderModeState } from "./scene/restoreAutoMovieRenderModeState.mjs";
96
103
  import { applyAutoMovieInspectionSection } from "./scene/inspection/applyAutoMovieInspectionSection.mjs";
97
104
  import { DEPTH_NORMALIZATION_RANGE } from "./scene/DEPTH_NORMALIZATION_RANGE.mjs";
98
105
  import { EDGE_WIDTH } from "./scene/EDGE_WIDTH.mjs";
@@ -217,17 +224,15 @@ import { applyObjectMotion } from "./scene/applyObjectMotion.mjs";
217
224
  import { applyObjectMotions } from "./scene/applyObjectMotions.mjs";
218
225
  import { applyLightState } from "./scene/applyLightState.mjs";
219
226
  import { applyLightMotion } from "./scene/applyLightMotion.mjs";
227
+ import { applyPracticalSurfaceMaterials } from "./scene/applyPracticalSurfaceMaterials.mjs";
220
228
  import { readAutoMovieDisplayDestinationEncoding } from "./scene/readAutoMovieDisplayDestinationEncoding.mjs";
221
229
  import { renderCrossDissolveFrames } from "./scene/renderCrossDissolveFrames.mjs";
222
230
  import { renderCrossDissolve } from "./scene/renderCrossDissolve.mjs";
223
231
  import { disposeCrossDissolve } from "./scene/disposeCrossDissolve.mjs";
224
- import { SPACE_GROUP_NAME } from "./scene/SPACE_GROUP_NAME.mjs";
225
- import { buildSpaceObject } from "./scene/buildSpaceObject.mjs";
226
232
  import { applyAutoMovieDeliveryCrop } from "./scene/applyAutoMovieDeliveryCrop.mjs";
227
233
  import { readAutoMovieDeliveryCrop } from "./scene/readAutoMovieDeliveryCrop.mjs";
228
234
  import { evaluateAutoMovieViewerCameraDepthPrecision } from "./scene/evaluateAutoMovieViewerCameraDepthPrecision.mjs";
229
235
  import { assertAutoMovieViewerCameraDepthPrecision } from "./scene/assertAutoMovieViewerCameraDepthPrecision.mjs";
230
- import { applyAutoMovieShadowParticipation } from "./scene/applyAutoMovieShadowParticipation.mjs";
231
236
  import { applySceneEnvironment } from "./scene/applySceneEnvironment.mjs";
232
237
  import { applySceneFog } from "./scene/applySceneFog.mjs";
233
238
  import { buildLight } from "./scene/buildLight.mjs";
@@ -260,7 +265,6 @@ import { buildInstancedEffect } from "./scene/buildInstancedEffect.mjs";
260
265
  import { sampleCompiledEffect } from "./scene/effect.mjs";
261
266
  import { buildFluidSurfaceObject } from "./scene/buildFluidSurfaceObject.mjs";
262
267
  import { buildFluidSprayObject } from "./scene/buildFluidSprayObject.mjs";
263
- import { buildSoftBodyObject } from "./scene/buildSoftBodyObject.mjs";
264
268
  import { buildPlantingObject } from "./scene/buildPlantingObject.mjs";
265
269
  import { autoMovieViewerSubjectKey } from "./scene/subjectViewpoint/autoMovieViewerSubjectKey.mjs";
266
270
  import { parseAutoMovieViewerSubjectKey } from "./scene/subjectViewpoint/parseAutoMovieViewerSubjectKey.mjs";
@@ -278,6 +282,7 @@ import { createAutoMovieSurfaceAppearance } from "./scene/createAutoMovieSurface
278
282
  import { createAutoMoviePhysicalPoseAdapter } from "./scene/createAutoMoviePhysicalPoseAdapter.mjs";
279
283
  import { buildHumanPolygon } from "./scene/human-polygon/buildHumanPolygon.mjs";
280
284
  import { buildHumanCartoonFace } from "./scene/human-polygon/buildHumanCartoonFace.mjs";
285
+ import { buildPolygonShotActor } from "./scene/human-polygon/buildPolygonShotActor.mjs";
281
286
  import { createAutoMovieHumanPolygonFigure } from "./scene/human-polygon/createAutoMovieHumanPolygonFigure.mjs";
282
287
  import { AutoMovieResourceRetirementScope } from "./scene/AutoMovieResourceRetirementScope.mjs";
283
288
  import { mixAutoMovieAudioPcm } from "./audio/mixAutoMovieAudioPcm.mjs";
@@ -286,4 +291,4 @@ import { assertProductionOpusProfile } from "./delivery/assertProductionOpusProf
286
291
  import { productionOpusDescription } from "./delivery/productionOpusDescription.mjs";
287
292
  import { AUTOMOVIE_MP4_SRGB_COLOUR } from "./delivery/AUTOMOVIE_MP4_SRGB_COLOUR.mjs";
288
293
  import { AUTOMOVIE_MP4_UNITY_MATRIX } from "./delivery/AUTOMOVIE_MP4_UNITY_MATRIX.mjs";
289
- export { AUTOMOVIE_FORMATION_CYCLE_SAMPLES, AUTOMOVIE_GUIDE_PASSES, AUTOMOVIE_MP4_SRGB_COLOUR, AUTOMOVIE_MP4_UNITY_MATRIX, AUTOMOVIE_PRODUCTION_OPUS_PROFILE, AUTO_MOVIE_CAPTURE_PLAN_KEYS, AUTO_MOVIE_DRAW_GLOBALS, AUTO_MOVIE_INSPECTION_DEPTH_LEAD, AUTO_MOVIE_INSPECTION_KEYS, AUTO_MOVIE_INSPECTION_KINDS, AUTO_MOVIE_INSPECTION_PALETTE, AutoMovieCaptureFolder, AutoMovieDrawSession, AutoMovieGeometryPhysicalVertices, AutoMoviePlayer, AutoMovieRasterSheet, AutoMovieResourceRetirementScope, AutoMovieSkinnedMesh, AutoMovieTextureCache, DEPTH_NORMALIZATION_RANGE, DETAIL_NORMAL_TARGET, EDGE_SHELL_NAME, EDGE_WIDTH, POSE_OVERLAY_NAME, RELIEF_WEIGHT_TARGET, SPACE_GROUP_NAME, SUBSURFACE_TARGET, addMaterialShaderPatch, applyAutoMovieDeliveryCrop, applyAutoMovieInspection, applyAutoMovieInspectionSection, applyAutoMovieInspectionShade, applyAutoMovieRigLocals, applyAutoMovieSectionPlanes, applyAutoMovieSemanticMask, applyAutoMovieShadowParticipation, applyAutoMovieViewerSubjectPose, applyDetailNormal, applyDualQuaternionSkinning, applyExpression, applyFormationCycleCadence, applyFormationCycleMaterial, applyLightMotion, applyLightState, applyMaterialOverlays, applyMaterialShaderPatches, applyObjectMotion, applyObjectMotions, applyPose, applyReliefWeights, applyRenderMode, applyRendererEnvironment, applySceneEnvironment, applySceneFog, applySubsurfaceShading, applyTransform, assertAutoMovieCaptureClock, assertAutoMovieSceneShadowProfile, assertAutoMovieViewerCameraDepthPrecision, assertProductionOpusProfile, assertProductionPngPicture, assertProductionVideoProfile, assessAutoMovieRenderBudget, attachAutoMovieSemanticMask, auditAutoMovieDecodedFrames, auditAutoMovieEncodedPresentation, auditAutoMovieRenderObservation, auditAutoMovieSemanticMaskScene, autoMovieAnalysisRampColor, autoMovieCaptionLanguageComparisonKey, autoMovieInspectionPathOf, autoMovieRenderBudgetEvidence, autoMovieRenderBudgetRefusal, autoMovieRenderTargetRendererOfGraphics, autoMovieRenderTargetSettingsOfShot, autoMovieSemanticMaskOf, autoMovieViewerNamedViewpoints, autoMovieViewerPoseFromHeading, autoMovieViewerSubjectKey, autoMovieViewerTurntableViewpoints, bakeFormationCycle, beatCaptions, buildAnalysisOverlayObject, buildAutoMovieConstruction, buildAutoMovieInspectionMarks, buildAutoMovieMaterialLibrary, buildFluidSprayObject, buildFluidSurfaceObject, buildGeometry, buildHumanCartoonFace, buildHumanPolygon, buildInstancedEffect, buildInstancedFormation, buildInstancedInstanceSet, buildLight, buildMaterial, buildModel, buildPlantingObject, buildPropArticulation, buildScene, buildSoftBodyObject, buildSpaceObject, canonicalProductionWebVtt, canonicalizeAutoMovieCaptionText, captureAutoMovieFramebufferRestore, captureAutoMovieMetricFrame, captureAutoMovieViewerSubjectView, captureViewerSnapshot, chooseAutoMovieInspectionMarks, collectAutoMovieOwnedResources, colorAutoMovieInspectionObjects, compareAutoMovieCaptureRounds, compareAutoMovieRasters, constructAutoMovieOwnedResources, createAutoMovieClosedSphereGeometry, createAutoMovieHttpArtifactStore, createAutoMovieHumanPolygonFigure, createAutoMovieInspectionDots, createAutoMovieInspectionStrokes, createAutoMovieMetricOrthographicCamera, createAutoMoviePhysicalPoseAdapter, createAutoMovieResourceRetirement, createAutoMovieSurfaceAppearance, createDetailNormalShaderPatch, createDualQuaternionSkinningShaderPatch, createImportedModelObject, createReliefWeightShaderPatch, decodeAutoMovieDrawPixels, decodeAutoMovieRasterPng, defaultMaterial, describeAutoMovieDrawScene, detailNormalFragment, detailNormalVertex, disposeCrossDissolve, disposeFadeToBlack, dualQuaternionSkinningOf, dualQuaternionSkinningVertex, encodeAutoMovieDrawPixels, encodeAutoMovieRasterPng, encodeAutoMovieWavPcm16, equalOrderedScalars, evaluateAutoMovieViewerCameraDepthPrecision, expandAutoMovieInspectionSweep, ffmpegArgs, flattenInstancedModel, flattenInstancedObject, focusAutoMovieInspection, formatAutoMovieCapturePlanRequest, formatAutoMovieInspectionCameraView, formatAutoMovieInspectionRequest, formatAutoMovieInspectionView, formationCycleCadence, formationCycleGait, formationCycleOf, formationCyclePosition, formationCycleStride, frameAutoMovieViewerSubject, frameName, framePattern, frameTimes, guardAutoMovieRenderModeRetirement, guardAutoMovieSceneShadowRetirement, guidePassFrameName, guidePassFramePattern, hashAutoMovieRasterImage, inspectAutoMovieCaptionReadabilityWithRuntime, installAutoMovieDraw, instancedModelParts, invalidateAutoMovieSceneShadowPrograms, invalidateAutoMovieSkinnedPose, isAutoMovieWebVttIdentifier, isGuidePass, legendAutoMovieInspectionMarks, listAutoMovieInspectionKinds, listAutoMovieInspectionPaths, mapImportedHumanoidBones, markAutoMovieInspectionTrails, maskColor, matchAutoMovieInspectionPath, materialOverlayFragment, materialOverlayVertex, materialTextureBindings, measureAutoMovieInspectionBounds, measureAutoMovieInspectionDefects, measureAutoMovieInspectionEdges, measureAutoMovieInspectionMeshes, measureAutoMovieInspectionPaths, mergeAutoMovieInspectionLegends, mixAutoMovieAudioPcm, normalizeGuidePasses, observeAutoMovieRendererFrame, parseAutoMovieCaptionLanguage, parseAutoMovieCapturePlanRequest, parseAutoMovieInspectionRequest, parseAutoMovieInspectionView, parseAutoMovieViewerSubjectKey, placeAutoMovieInspectionLabels, planAutoMovieCapture, planAutoMovieCaptureFrames, planAutoMovieCaptureLayout, planAutoMovieCaptureUrl, planAutoMovieDrawCall, planAutoMovieInspectionTrailTimes, planAutoMovieVideoEncoding, planAutoMovieVideoFrames, planAutoMovieVideoSceneCuts, planCaptionSidecar, planChunkedSequenceRender, planGuidePassOutputs, planPoseKeypointSidecar, planProductionRenderJob, planSequenceRender, planViewerFrameTimes, productionOpusDescription, productionVisualDeliveryOccurrence, readAutoMovieCaptureArguments, readAutoMovieCubeShadowDepth, readAutoMovieDeliveryCrop, readAutoMovieDisplayDestinationEncoding, readAutoMovieFilmDisplayTextureResidency, readAutoMovieMaterialTextureSources, readAutoMovieRenderTextureTarget, readAutoMovieShadowLightSource, readAutoMovieShadowTextureTargets, readAutoMovieTextureSource, readAutoMovieTransmissionTextureTarget, readAutoMovieVideoSceneCuts, regenerateFormationSlot, regenerateInstanceSlot, releaseViewerRenderer, reliefWeightFragment, reliefWeightVertex, renderAndSee, renderAutoMovieDrawnVideo, renderAutoMovieFilmFrame, renderAutoMovieScenePass, renderCaptionSidecar, renderCrossDissolve, renderCrossDissolveFrames, renderFadeToBlackFrame, renderPathStem, renderPoseKeypointSidecar, renderScreenplay, renderSequenceAndSee, renderSequenceVideo, renderVideo, replaceAutoMovieDrawInspection, reportAutoMovieResourceRetirement, resetAutoMovieSceneShadowTargets, resolveAutoMovieCapturePatterns, resolveAutoMovieFilmBeautyComposition, resolveAutoMovieInspectionColors, resolveAutoMovieInspectionView, resolveProductionPngProfile, resolveProductionRenderTierFrameFormat, resolveProductionVideoProfile, restoreAutoMovieRenderModeOnce, restoreAutoMovieRenderModeState, retireAutoMovieCubeShadowDepth, runAutoMovieCapture, runAutoMovieVideoCapture, sampleAutoMovieInspectionTrails, sampleCompiledEffect, sampleFormationCycleMatrix, sampleFormationMotion, sampleFormationSlotMotion, scaleAutoMovieCaptureLabels, selectAutoMovieDrawSubject, selectAutoMovieRenderBudget, selectFormationLod, serializeAutoMovieWebVttCueText, serializeAutoMovieWebVttIdentifier, serializeAutoMovieWebVttSingleLineText, sliceCaptionSidecar, spliceTangentNormal, stampAutoMovieDrawLegend, stampAutoMovieRasterLabel, subsurfaceFragment, subsurfacePhysicalChunk, subsurfaceTable, textureBindingAsset, updateAutoMovieComparisonCamera };
294
+ export { AUTOMOVIE_FORMATION_CYCLE_SAMPLES, AUTOMOVIE_GUIDE_PASSES, AUTOMOVIE_MP4_SRGB_COLOUR, AUTOMOVIE_MP4_UNITY_MATRIX, AUTOMOVIE_PRODUCTION_OPUS_PROFILE, AUTO_MOVIE_CAPTURE_PLAN_KEYS, AUTO_MOVIE_DRAW_GLOBALS, AUTO_MOVIE_INSPECTION_DEPTH_LEAD, AUTO_MOVIE_INSPECTION_KEYS, AUTO_MOVIE_INSPECTION_KINDS, AUTO_MOVIE_INSPECTION_PALETTE, AutoMovieCaptureFolder, AutoMovieDrawSession, AutoMovieFrameGrid, AutoMovieGeometryPhysicalVertices, AutoMoviePlayer, AutoMovieRasterSheet, AutoMovieResourceRetirementScope, AutoMovieSkinnedMesh, AutoMovieTextureCache, DEPTH_NORMALIZATION_RANGE, DETAIL_NORMAL_TARGET, EDGE_SHELL_NAME, EDGE_WIDTH, POSE_OVERLAY_NAME, RELIEF_WEIGHT_TARGET, SPACE_GROUP_NAME, SUBSURFACE_TARGET, addMaterialShaderPatch, applyAutoMovieDeliveryCrop, applyAutoMovieInspection, applyAutoMovieInspectionSection, applyAutoMovieInspectionShade, applyAutoMovieRigLocals, applyAutoMovieSectionPlanes, applyAutoMovieSemanticMask, applyAutoMovieShadowParticipation, applyAutoMovieViewerSubjectPose, applyDetailNormal, applyDualQuaternionSkinning, applyExpression, applyFormationCycleCadence, applyFormationCycleMaterial, applyLightMotion, applyLightState, applyMaterialOverlays, applyMaterialShaderPatches, applyObjectMotion, applyObjectMotions, applyPose, applyPracticalSurfaceMaterials, applyReliefWeights, applyRenderMode, applyRendererEnvironment, applySceneEnvironment, applySceneFog, applySubsurfaceShading, applyTransform, assertAutoMovieCaptureClock, assertAutoMovieSceneShadowProfile, assertAutoMovieViewerCameraDepthPrecision, assertProductionOpusProfile, assertProductionPngPicture, assertProductionVideoProfile, assessAutoMovieRenderBudget, attachAutoMovieSemanticMask, auditAutoMovieDecodedFrames, auditAutoMovieEncodedPresentation, auditAutoMovieRenderObservation, auditAutoMovieSemanticMaskScene, autoMovieAnalysisRampColor, autoMovieCaptionLanguageComparisonKey, autoMovieInspectionPathOf, autoMovieRenderBudgetEvidence, autoMovieRenderBudgetRefusal, autoMovieRenderTargetRendererOfGraphics, autoMovieRenderTargetSettingsOfShot, autoMovieSemanticMaskOf, autoMovieViewerNamedViewpoints, autoMovieViewerPoseFromHeading, autoMovieViewerSubjectKey, autoMovieViewerTurntableViewpoints, bakeFormationCycle, beatCaptions, bindAutoMovieDrawSceneSoftProps, buildAnalysisOverlayObject, buildAutoMovieConstruction, buildAutoMovieInspectionMarks, buildAutoMovieMaterialLibrary, buildFluidSprayObject, buildFluidSurfaceObject, buildGeometry, buildHumanCartoonFace, buildHumanPolygon, buildInstancedEffect, buildInstancedFormation, buildInstancedInstanceSet, buildLight, buildMaterial, buildModel, buildPlantingObject, buildPolygonShotActor, buildPropArticulation, buildScene, buildSceneSoftProps, buildSoftBodyObject, buildSpaceObject, canonicalProductionWebVtt, canonicalizeAutoMovieCaptionText, captureAutoMovieFramebufferRestore, captureAutoMovieMetricFrame, captureAutoMovieViewerSubjectView, captureViewerSnapshot, chooseAutoMovieInspectionMarks, collectAutoMovieOwnedResources, colorAutoMovieInspectionObjects, compareAutoMovieCaptureRounds, compareAutoMovieRasters, constructAutoMovieOwnedResources, createAutoMovieClosedSphereGeometry, createAutoMovieHttpArtifactStore, createAutoMovieHumanPolygonFigure, createAutoMovieInspectionDots, createAutoMovieInspectionStrokes, createAutoMovieMetricOrthographicCamera, createAutoMoviePhysicalPoseAdapter, createAutoMovieResourceRetirement, createAutoMovieSurfaceAppearance, createDetailNormalShaderPatch, createDualQuaternionSkinningShaderPatch, createImportedModelObject, createReliefWeightShaderPatch, decodeAutoMovieDrawPixels, decodeAutoMovieRasterPng, defaultMaterial, describeAutoMovieDrawScene, detailNormalFragment, detailNormalVertex, disposeCrossDissolve, disposeFadeToBlack, dualQuaternionSkinningOf, dualQuaternionSkinningVertex, encodeAutoMovieDrawPixels, encodeAutoMovieRasterPng, encodeAutoMovieWavPcm16, equalOrderedScalars, evaluateAutoMovieViewerCameraDepthPrecision, expandAutoMovieInspectionSweep, ffmpegArgs, flattenInstancedModel, flattenInstancedObject, focusAutoMovieInspection, formatAutoMovieCapturePlanRequest, formatAutoMovieInspectionCameraView, formatAutoMovieInspectionRequest, formatAutoMovieInspectionView, formationCycleCadence, formationCycleGait, formationCycleOf, formationCyclePosition, formationCycleStride, frameAutoMovieViewerSubject, frameName, framePattern, frameTimes, guardAutoMovieRenderModeRetirement, guardAutoMovieSceneShadowRetirement, guidePassFrameName, guidePassFramePattern, hashAutoMovieRasterImage, inspectAutoMovieCaptionReadabilityWithRuntime, installAutoMovieDraw, instancedModelParts, invalidateAutoMovieSceneShadowPrograms, invalidateAutoMovieSkinnedPose, isAutoMovieWebVttIdentifier, isGuidePass, legendAutoMovieInspectionMarks, listAutoMovieInspectionKinds, listAutoMovieInspectionPaths, mapImportedHumanoidBones, markAutoMovieInspectionTrails, maskColor, matchAutoMovieInspectionPath, materialOverlayFragment, materialOverlayVertex, materialTextureBindings, measureAutoMovieInspectionBounds, measureAutoMovieInspectionDefects, measureAutoMovieInspectionEdges, measureAutoMovieInspectionMeshes, measureAutoMovieInspectionPaths, mergeAutoMovieInspectionLegends, mixAutoMovieAudioPcm, normalizeGuidePasses, observeAutoMovieRendererFrame, parseAutoMovieCaptionLanguage, parseAutoMovieCapturePlanRequest, parseAutoMovieInspectionRequest, parseAutoMovieInspectionView, parseAutoMovieViewerSubjectKey, placeAutoMovieInspectionLabels, planAutoMovieCapture, planAutoMovieCaptureFrames, planAutoMovieCaptureLayout, planAutoMovieCaptureUrl, planAutoMovieDrawCall, planAutoMovieInspectionTrailTimes, planAutoMovieVideoEncoding, planAutoMovieVideoFrames, planAutoMovieVideoSceneCuts, planCaptionSidecar, planChunkedSequenceRender, planGuidePassOutputs, planPoseKeypointSidecar, planProductionRenderJob, planSequenceRender, planViewerFrameTimes, productionOpusDescription, productionVisualDeliveryOccurrence, readAutoMovieCaptureArguments, readAutoMovieCubeShadowDepth, readAutoMovieDeliveryCrop, readAutoMovieDisplayDestinationEncoding, readAutoMovieFilmDisplayTextureResidency, readAutoMovieMaterialTextureSources, readAutoMovieRenderTextureTarget, readAutoMovieShadowLightSource, readAutoMovieShadowTextureTargets, readAutoMovieTextureSource, readAutoMovieTransmissionTextureTarget, readAutoMovieVideoSceneCuts, regenerateFormationSlot, regenerateInstanceSlot, releaseViewerRenderer, reliefWeightFragment, reliefWeightVertex, renderAndSee, renderAutoMovieDrawnVideo, renderAutoMovieFilmFrame, renderAutoMovieScenePass, renderCaptionSidecar, renderCrossDissolve, renderCrossDissolveFrames, renderFadeToBlackFrame, renderPathStem, renderPoseKeypointSidecar, renderScreenplay, renderSequenceAndSee, renderSequenceVideo, renderVideo, replaceAutoMovieDrawInspection, reportAutoMovieResourceRetirement, resetAutoMovieSceneShadowTargets, resolveAutoMovieCapturePatterns, resolveAutoMovieFilmBeautyComposition, resolveAutoMovieInspectionColors, resolveAutoMovieInspectionView, resolveProductionPngProfile, resolveProductionRenderTierFrameFormat, resolveProductionVideoProfile, restoreAutoMovieRenderModeOnce, restoreAutoMovieRenderModeState, retireAutoMovieCubeShadowDepth, runAutoMovieCapture, runAutoMovieVideoCapture, sampleAutoMovieInspectionTrails, sampleCompiledEffect, sampleFormationCycleMatrix, sampleFormationMotion, sampleFormationSlotMotion, scaleAutoMovieCaptureLabels, selectAutoMovieDrawSubject, selectAutoMovieRenderBudget, selectFormationLod, serializeAutoMovieWebVttCueText, serializeAutoMovieWebVttIdentifier, serializeAutoMovieWebVttSingleLineText, sliceCaptionSidecar, spliceTangentNormal, stampAutoMovieDrawLegend, stampAutoMovieRasterLabel, subsurfaceFragment, subsurfacePhysicalChunk, subsurfaceTable, textureBindingAsset, updateAutoMovieComparisonCamera };
@@ -1,13 +1,13 @@
1
1
  import type { IAutoMoviePlanSequenceRenderProps, IAutoMovieSequenceRenderPlan } from "@automovie/interface";
2
2
  /**
3
- * Build the render-layer manifest for a committed sequence. The output FPS is controlled by the render spec; the cut's fps is preserved as editorial metadata. Trim and transition arithmetic is delegated to the engine playback timeline, then copied into the manifest so the capture host has no hidden timing rules.
3
+ * Build the render-layer manifest for a committed sequence. The output FPS is controlled by the render spec; the cut's fps is preserved as editorial metadata. Trim, playback-rate and transition arithmetic is delegated to the engine playback timeline, then copied into the manifest so the capture host has no hidden timing rules.
4
4
  *
5
- * @evidence contracts/development/implementation.md#principled-implementation sequenceTimeline owns trim and overlap arithmetic, frameTimes supplies increasing half-open output samples, and one playbackCursor resolves those samples without changing the sequence's editorial fps.
5
+ * @evidence contracts/development/implementation.md#principled-implementation preparePlaybackTimeline owns trim, playback-rate and overlap arithmetic, and editorial markers use the prepared layout and shot index; frameTimes supplies increasing half-open output samples, and one playbackCursor resolves those samples without changing the sequence's editorial fps.
6
6
  * @evidence contracts/development/implementation.md#clear-and-simple-structure The manifest gathers timeline spans, resolved frame samples and paths so a capture host reads one plan instead of independently implementing the cut.
7
7
  * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts A mismatched render target or empty schedule refuses; output path overrides are caller data and no sequence identity is specially recognized.
8
8
  * @evidence contracts/development/common.md#meaningful-documentation The planner documents editorial versus output fps and target equality; manifest members state seconds, trim offsets, blend weights and host paths.
9
- * @evidence contracts/development/implementation.md#efficient-algorithms For S supplied shots, E timeline entries and F output frames, the engine first indexes all S shots, including unused extras; layout and the forward cursor then cost O(E+F), for O(S+E+F) planning time and peak metadata space. The returned manifest retains O(E+F) records and no per-frame full timeline scan occurs.
10
- * @evidence contracts/development/implementation.md#reuse-equivalent-work One resolved timeline feeds shot spans, transitions and every frame sample; the forward cursor retains its current entry across increasing sample times only within this call.
11
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The returned plan retains shot-span and frame metadata proportional to the output schedule; the temporary cursor and timeline are released on return, and planning opens no host resource.
9
+ * @evidence contracts/development/implementation.md#efficient-algorithms For S supplied shots, E timeline entries, F output frames, M marker visits across plays and K retained placements, planning takes O(S+E+F+M+K log K) time and O(S+E+F+K) peak metadata space. One forward cursor avoids a full timeline scan per frame.
10
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work One prepared layout and index feed editorial marker placement, shot spans, transitions and every frame sample; the forward cursor retains its current entry across increasing sample times only within this call.
11
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The returned plan retains shot spans, frame metadata proportional to the output schedule, and retained editorial marker placements; the temporary cursor and timeline are released on return, and planning opens no host resource.
12
12
  */
13
13
  export declare const planSequenceRender: (props: IAutoMoviePlanSequenceRenderProps) => IAutoMovieSequenceRenderPlan;
@@ -8,20 +8,21 @@ const framePattern_js_1 = require("./framePattern.js");
8
8
  const frameTimes_js_1 = require("./frameTimes.js");
9
9
  const renderPathStem_js_1 = require("./renderPathStem.js");
10
10
  /**
11
- * Build the render-layer manifest for a committed sequence. The output FPS is controlled by the render spec; the cut's fps is preserved as editorial metadata. Trim and transition arithmetic is delegated to the engine playback timeline, then copied into the manifest so the capture host has no hidden timing rules.
11
+ * Build the render-layer manifest for a committed sequence. The output FPS is controlled by the render spec; the cut's fps is preserved as editorial metadata. Trim, playback-rate and transition arithmetic is delegated to the engine playback timeline, then copied into the manifest so the capture host has no hidden timing rules.
12
12
  *
13
- * @evidence contracts/development/implementation.md#principled-implementation sequenceTimeline owns trim and overlap arithmetic, frameTimes supplies increasing half-open output samples, and one playbackCursor resolves those samples without changing the sequence's editorial fps.
13
+ * @evidence contracts/development/implementation.md#principled-implementation preparePlaybackTimeline owns trim, playback-rate and overlap arithmetic, and editorial markers use the prepared layout and shot index; frameTimes supplies increasing half-open output samples, and one playbackCursor resolves those samples without changing the sequence's editorial fps.
14
14
  * @evidence contracts/development/implementation.md#clear-and-simple-structure The manifest gathers timeline spans, resolved frame samples and paths so a capture host reads one plan instead of independently implementing the cut.
15
15
  * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts A mismatched render target or empty schedule refuses; output path overrides are caller data and no sequence identity is specially recognized.
16
16
  * @evidence contracts/development/common.md#meaningful-documentation The planner documents editorial versus output fps and target equality; manifest members state seconds, trim offsets, blend weights and host paths.
17
- * @evidence contracts/development/implementation.md#efficient-algorithms For S supplied shots, E timeline entries and F output frames, the engine first indexes all S shots, including unused extras; layout and the forward cursor then cost O(E+F), for O(S+E+F) planning time and peak metadata space. The returned manifest retains O(E+F) records and no per-frame full timeline scan occurs.
18
- * @evidence contracts/development/implementation.md#reuse-equivalent-work One resolved timeline feeds shot spans, transitions and every frame sample; the forward cursor retains its current entry across increasing sample times only within this call.
19
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The returned plan retains shot-span and frame metadata proportional to the output schedule; the temporary cursor and timeline are released on return, and planning opens no host resource.
17
+ * @evidence contracts/development/implementation.md#efficient-algorithms For S supplied shots, E timeline entries, F output frames, M marker visits across plays and K retained placements, planning takes O(S+E+F+M+K log K) time and O(S+E+F+K) peak metadata space. One forward cursor avoids a full timeline scan per frame.
18
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work One prepared layout and index feed editorial marker placement, shot spans, transitions and every frame sample; the forward cursor retains its current entry across increasing sample times only within this call.
19
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The returned plan retains shot spans, frame metadata proportional to the output schedule, and retained editorial marker placements; the temporary cursor and timeline are released on return, and planning opens no host resource.
20
20
  */
21
21
  const planSequenceRender = (props) => {
22
22
  if (props.spec.target !== props.sequence.id)
23
23
  throw new Error(`render spec target "${props.spec.target}" must equal sequence "${props.sequence.id}"`);
24
- const timeline = (0, engine_1.sequenceTimeline)(props.sequence, props.shots);
24
+ const playback = (0, engine_1.preparePlaybackTimeline)(props.sequence, props.shots);
25
+ const timeline = playback.timeline;
25
26
  const times = (0, frameTimes_js_1.frameTimes)(props.spec.frameFormat.fps, timeline.runtime);
26
27
  if (times.length === 0)
27
28
  throw new Error(`planSequenceRender requires at least one frame; fps ${props.spec.frameFormat.fps} and duration ${timeline.runtime} produced zero frames`);
@@ -29,8 +30,10 @@ const planSequenceRender = (props) => {
29
30
  const frameDir = props.frameDir ?? `frames/${stem}`;
30
31
  const outputPath = props.outputPath ?? `${stem}.mp4`;
31
32
  const inputPattern = `${frameDir}/${(0, framePattern_js_1.framePattern)()}`;
33
+ const editorialMarkers = (0, engine_1.sequenceEditorialMarkerTimeline)(props.sequence, playback);
32
34
  return {
33
35
  target: { kind: "sequence", id: props.sequence.id },
36
+ ...(editorialMarkers.length === 0 ? {} : { editorialMarkers }),
34
37
  sequenceFps: props.sequence.fps,
35
38
  renderFps: props.spec.frameFormat.fps,
36
39
  durationSeconds: timeline.runtime,
@@ -44,6 +47,9 @@ const planSequenceRender = (props) => {
44
47
  played: entry.played,
45
48
  offset: entry.offset,
46
49
  trim: props.sequence.shots[entry.entry].trim,
50
+ ...(entry.playbackRate === undefined
51
+ ? {}
52
+ : { playbackRate: entry.playbackRate }),
47
53
  })),
48
54
  transitionSpans: transitionSpans(props.sequence, timeline),
49
55
  frames: frameSamples(props.sequence, timeline, times, frameDir),
@@ -1 +1 @@
1
- {"version":3,"file":"planSequenceRender.js","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AAQ,EAAE,UAAU,CAAC,QAAQ;SAC9B;KACF,CAAC;AACJ,CAAC,CACF,CAAC;AAEJ;;GAEG;AACH,MAAM,YAAY,GAKqB,CACrC,QAA4B,EAC5B,QAAoC,EACpC,KAAe,EACf,QAAgB,EACiB,EAAE;IACnC,MAAM,MAAM,GAAsC,IAAA,uBAAc,EAC9D,QAAQ,EACR,QAAQ,CACT,CAAC;IACF,OAAO,KAAK,CAAC,GAAG,CACd,CAAC,IAAY,EAAE,KAAa,EAAiC,EAAE;QAC7D,MAAM,MAAM,GAA8B,MAAM,CAAC,IAAI,CAAC,CAAC;QACvD,OAAO;YACL,KAAK;YACL,WAAW,EAAE,IAAI;YACjB,IAAI,EAAE,GAAG,QAAQ,IAAI,IAAA,wBAAS,EAAC,KAAK,CAAC,EAAE;YACvC,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,eAAe,EAAE,MAAM,CAAC,IAAI;YAC5B,KAAK,EACH,MAAM,CAAC,KAAK,KAAK,IAAI;gBACnB,CAAC,CAAC,IAAI;gBACN,CAAC,CAAC;oBACE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI;oBACvB,eAAe,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI;oBAClC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK;iBAC1B;SACR,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CAAC"}
@@ -3,33 +3,36 @@ import { frameName } from "./frameName.mjs";
3
3
  import { framePattern } from "./framePattern.mjs";
4
4
  import { frameTimes } from "./frameTimes.mjs";
5
5
  import { renderPathStem } from "./renderPathStem.mjs";
6
- import { playbackCursor, sequenceTimeline } from "@automovie/engine";
6
+ import { playbackCursor, preparePlaybackTimeline, sequenceEditorialMarkerTimeline } from "@automovie/engine";
7
7
  // src/planSequenceRender.ts
8
8
  /**
9
- * Build the render-layer manifest for a committed sequence. The output FPS is controlled by the render spec; the cut's fps is preserved as editorial metadata. Trim and transition arithmetic is delegated to the engine playback timeline, then copied into the manifest so the capture host has no hidden timing rules.
9
+ * Build the render-layer manifest for a committed sequence. The output FPS is controlled by the render spec; the cut's fps is preserved as editorial metadata. Trim, playback-rate and transition arithmetic is delegated to the engine playback timeline, then copied into the manifest so the capture host has no hidden timing rules.
10
10
  *
11
- * @evidence contracts/development/implementation.md#principled-implementation sequenceTimeline owns trim and overlap arithmetic, frameTimes supplies increasing half-open output samples, and one playbackCursor resolves those samples without changing the sequence's editorial fps.
11
+ * @evidence contracts/development/implementation.md#principled-implementation preparePlaybackTimeline owns trim, playback-rate and overlap arithmetic, and editorial markers use the prepared layout and shot index; frameTimes supplies increasing half-open output samples, and one playbackCursor resolves those samples without changing the sequence's editorial fps.
12
12
  * @evidence contracts/development/implementation.md#clear-and-simple-structure The manifest gathers timeline spans, resolved frame samples and paths so a capture host reads one plan instead of independently implementing the cut.
13
13
  * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts A mismatched render target or empty schedule refuses; output path overrides are caller data and no sequence identity is specially recognized.
14
14
  * @evidence contracts/development/common.md#meaningful-documentation The planner documents editorial versus output fps and target equality; manifest members state seconds, trim offsets, blend weights and host paths.
15
- * @evidence contracts/development/implementation.md#efficient-algorithms For S supplied shots, E timeline entries and F output frames, the engine first indexes all S shots, including unused extras; layout and the forward cursor then cost O(E+F), for O(S+E+F) planning time and peak metadata space. The returned manifest retains O(E+F) records and no per-frame full timeline scan occurs.
16
- * @evidence contracts/development/implementation.md#reuse-equivalent-work One resolved timeline feeds shot spans, transitions and every frame sample; the forward cursor retains its current entry across increasing sample times only within this call.
17
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The returned plan retains shot-span and frame metadata proportional to the output schedule; the temporary cursor and timeline are released on return, and planning opens no host resource.
15
+ * @evidence contracts/development/implementation.md#efficient-algorithms For S supplied shots, E timeline entries, F output frames, M marker visits across plays and K retained placements, planning takes O(S+E+F+M+K log K) time and O(S+E+F+K) peak metadata space. One forward cursor avoids a full timeline scan per frame.
16
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work One prepared layout and index feed editorial marker placement, shot spans, transitions and every frame sample; the forward cursor retains its current entry across increasing sample times only within this call.
17
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The returned plan retains shot spans, frame metadata proportional to the output schedule, and retained editorial marker placements; the temporary cursor and timeline are released on return, and planning opens no host resource.
18
18
  */
19
19
  const planSequenceRender = (props) => {
20
20
  if (props.spec.target !== props.sequence.id) throw new Error(`render spec target "${props.spec.target}" must equal sequence "${props.sequence.id}"`);
21
- const timeline = sequenceTimeline(props.sequence, props.shots);
21
+ const playback = preparePlaybackTimeline(props.sequence, props.shots);
22
+ const timeline = playback.timeline;
22
23
  const times = frameTimes(props.spec.frameFormat.fps, timeline.runtime);
23
24
  if (times.length === 0) throw new Error(`planSequenceRender requires at least one frame; fps ${props.spec.frameFormat.fps} and duration ${timeline.runtime} produced zero frames`);
24
25
  const stem = renderPathStem(props.sequence.id);
25
26
  const frameDir = props.frameDir ?? `frames/${stem}`;
26
27
  const outputPath = props.outputPath ?? `${stem}.mp4`;
27
28
  const inputPattern = `${frameDir}/${framePattern()}`;
29
+ const editorialMarkers = sequenceEditorialMarkerTimeline(props.sequence, playback);
28
30
  return {
29
31
  target: {
30
32
  kind: "sequence",
31
33
  id: props.sequence.id
32
34
  },
35
+ ...editorialMarkers.length === 0 ? {} : { editorialMarkers },
33
36
  sequenceFps: props.sequence.fps,
34
37
  renderFps: props.spec.frameFormat.fps,
35
38
  durationSeconds: timeline.runtime,
@@ -42,7 +45,8 @@ const planSequenceRender = (props) => {
42
45
  end: entry.start + entry.played,
43
46
  played: entry.played,
44
47
  offset: entry.offset,
45
- trim: props.sequence.shots[entry.entry].trim
48
+ trim: props.sequence.shots[entry.entry].trim,
49
+ ...entry.playbackRate === void 0 ? {} : { playbackRate: entry.playbackRate }
46
50
  })),
47
51
  transitionSpans: transitionSpans(props.sequence, timeline),
48
52
  frames: frameSamples(props.sequence, timeline, times, frameDir),
@@ -1 +1 @@
1
- {"version":3,"file":"planSequenceRender.mjs","names":[],"sources":["../src/planSequenceRender.ts"],"sourcesContent":["import { playbackCursor, sequenceTimeline } from \"@automovie/engine\";\nimport type {\n IAutoMoviePlanSequenceRenderProps,\n IAutoMoviePlaybackTimeline,\n IAutoMovieSequence,\n IAutoMovieSequenceRenderFrame,\n IAutoMovieSequenceRenderPlan,\n IAutoMovieSequenceRenderTransitionSpan,\n} from \"@automovie/interface\";\n\nimport { ffmpegArgs } from \"./ffmpegArgs.js\";\nimport { frameName } from \"./frameName.js\";\nimport { framePattern } from \"./framePattern.js\";\nimport { frameTimes } from \"./frameTimes.js\";\nimport { renderPathStem } from \"./renderPathStem.js\";\n\n/**\n * Build the render-layer manifest for a committed sequence. The output FPS is controlled by the render spec; the cut's fps is preserved as editorial metadata. Trim and transition arithmetic is delegated to the engine playback timeline, then copied into the manifest so the capture host has no hidden timing rules.\n *\n * @evidence contracts/development/implementation.md#principled-implementation sequenceTimeline owns trim and overlap arithmetic, frameTimes supplies increasing half-open output samples, and one playbackCursor resolves those samples without changing the sequence's editorial fps.\n * @evidence contracts/development/implementation.md#clear-and-simple-structure The manifest gathers timeline spans, resolved frame samples and paths so a capture host reads one plan instead of independently implementing the cut.\n * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts A mismatched render target or empty schedule refuses; output path overrides are caller data and no sequence identity is specially recognized.\n * @evidence contracts/development/common.md#meaningful-documentation The planner documents editorial versus output fps and target equality; manifest members state seconds, trim offsets, blend weights and host paths.\n * @evidence contracts/development/implementation.md#efficient-algorithms For S supplied shots, E timeline entries and F output frames, the engine first indexes all S shots, including unused extras; layout and the forward cursor then cost O(E+F), for O(S+E+F) planning time and peak metadata space. The returned manifest retains O(E+F) records and no per-frame full timeline scan occurs.\n * @evidence contracts/development/implementation.md#reuse-equivalent-work One resolved timeline feeds shot spans, transitions and every frame sample; the forward cursor retains its current entry across increasing sample times only within this call.\n * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The returned plan retains shot-span and frame metadata proportional to the output schedule; the temporary cursor and timeline are released on return, and planning opens no host resource.\n */\nexport const planSequenceRender: (\n props: IAutoMoviePlanSequenceRenderProps,\n) => IAutoMovieSequenceRenderPlan = (\n props: IAutoMoviePlanSequenceRenderProps,\n): IAutoMovieSequenceRenderPlan => {\n if (props.spec.target !== props.sequence.id)\n throw new Error(\n `render spec target \"${props.spec.target}\" must equal sequence \"${props.sequence.id}\"`,\n );\n\n const timeline: IAutoMoviePlaybackTimeline = sequenceTimeline(\n props.sequence,\n props.shots,\n );\n const times: number[] = frameTimes(\n props.spec.frameFormat.fps,\n timeline.runtime,\n );\n if (times.length === 0)\n throw new Error(\n `planSequenceRender requires at least one frame; fps ${props.spec.frameFormat.fps} and duration ${timeline.runtime} produced zero frames`,\n );\n\n const stem: string = renderPathStem(props.sequence.id);\n const frameDir: string = props.frameDir ?? `frames/${stem}`;\n const outputPath: string = props.outputPath ?? `${stem}.mp4`;\n const inputPattern: string = `${frameDir}/${framePattern()}`;\n return {\n target: { kind: \"sequence\", id: props.sequence.id },\n sequenceFps: props.sequence.fps,\n renderFps: props.spec.frameFormat.fps,\n durationSeconds: timeline.runtime,\n frameCount: times.length,\n times,\n shots: timeline.entries.map(\n (\n entry: IAutoMoviePlaybackTimeline[\"entries\"][number],\n ): IAutoMovieSequenceRenderPlan[\"shots\"][number] => ({\n entry: entry.entry,\n shot: entry.shot,\n start: entry.start,\n end: entry.start + entry.played,\n played: entry.played,\n offset: entry.offset,\n trim: props.sequence.shots[entry.entry]!.trim,\n }),\n ),\n transitionSpans: transitionSpans(props.sequence, timeline),\n frames: frameSamples(props.sequence, timeline, times, frameDir),\n frameDir,\n firstFrame: `${frameDir}/${frameName(0)}`,\n lastFrame: `${frameDir}/${frameName(times.length - 1)}`,\n inputPattern,\n outputPath,\n ffmpegArgs: ffmpegArgs(props.spec, inputPattern, outputPath),\n };\n};\n\nconst transitionSpans: (\n sequence: IAutoMovieSequence,\n timeline: IAutoMoviePlaybackTimeline,\n) => IAutoMovieSequenceRenderTransitionSpan[] = (\n sequence: IAutoMovieSequence,\n timeline: IAutoMoviePlaybackTimeline,\n): IAutoMovieSequenceRenderTransitionSpan[] =>\n timeline.entries.flatMap(\n (\n entry: IAutoMoviePlaybackTimeline[\"entries\"][number],\n ): IAutoMovieSequenceRenderTransitionSpan[] => {\n const transition: IAutoMovieSequence[\"shots\"][number][\"transition\"] =\n sequence.shots[entry.entry]!.transition;\n if (transition === null) return [];\n const outgoing: IAutoMoviePlaybackTimeline[\"entries\"][number] =\n timeline.entries[entry.entry - 1]!;\n return [\n {\n entry: entry.entry,\n from: outgoing.shot,\n to: entry.shot,\n kind: transition.kind,\n start: entry.start,\n end: entry.start + transition.duration,\n duration: transition.duration,\n },\n ];\n },\n );\n\n/**\n * Resolve every output frame in one forward sweep. Frame times come from {@link frameTimes} (`i / fps`, strictly increasing), so a single {@link playbackCursor} walks the timeline once, O(frames + entries) instead of a per-frame scan, landing on the same live entry a per-frame resolve would, so the samples are byte-identical.\n */\nconst frameSamples: (\n sequence: IAutoMovieSequence,\n timeline: IAutoMoviePlaybackTimeline,\n times: number[],\n frameDir: string,\n) => IAutoMovieSequenceRenderFrame[] = (\n sequence: IAutoMovieSequence,\n timeline: IAutoMoviePlaybackTimeline,\n times: number[],\n frameDir: string,\n): IAutoMovieSequenceRenderFrame[] => {\n const cursor: ReturnType<typeof playbackCursor> = playbackCursor(\n sequence,\n timeline,\n );\n return times.map(\n (time: number, index: number): IAutoMovieSequenceRenderFrame => {\n const sample: ReturnType<typeof cursor> = cursor(time);\n return {\n index,\n timeSeconds: time,\n path: `${frameDir}/${frameName(index)}`,\n shot: sample.shot,\n shotTimeSeconds: sample.time,\n blend:\n sample.blend === null\n ? null\n : {\n shot: sample.blend.shot,\n shotTimeSeconds: sample.blend.time,\n alpha: sample.blend.alpha,\n },\n };\n },\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AA2BA,MAAa,sBAGX,UACiC;CACjC,IAAI,MAAM,KAAK,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C/B,IAAI,eAAe,MAAM,OAAO,CAAC;CACjC,MAAM,WACJ,SAAS,QAAQ,MAAM,QAAQ;CACjC,OAAO,CACL;EACE,OAAO,MAAM;EACb,MAAM,SAAS;EACf,IAAI,MAAM;EACV,MAAM,WAAW;EACjB,OAAO,MAAM;EACb,KAAK,MAAM,QAAQ,WAAW;EAC9B,UAAU,WAAW;CACvB,CACF;AACF,CACF;;;;AAKF,MAAM,gBAMJ,UACA,UACA,OACA,aACoC;CACpC,MAAM,SAA4C,eAChD,UACA,QACF;CACA,OAAO,MAAM,KACV,MAAc,UAAiD;EAC9D,MAAM,SAAoC,OAAO,IAAI;EACrD,OAAO;GACL;GACA,aAAa;GACb,MAAM,GAAG,SAAS,GAAG,UAAU,KAAK;GACpC,MAAM,OAAO;GACb,iBAAiB,OAAO;GACxB,OACE,OAAO,UAAU,OACb,OACA;IACE,MAAM,OAAO,MAAM;IACnB,iBAAiB,OAAO,MAAM;IAC9B,OAAO,OAAO,MAAM;GACtB;EACR;CACF,CACF;AACF"}
1
+ {"version":3,"file":"planSequenceRender.mjs","names":[],"sources":["../src/planSequenceRender.ts"],"sourcesContent":["import {\n playbackCursor,\n preparePlaybackTimeline,\n sequenceEditorialMarkerTimeline,\n} from \"@automovie/engine\";\nimport type {\n IAutoMoviePlanSequenceRenderProps,\n IAutoMoviePlaybackEditorialMarker,\n IAutoMoviePlaybackTimeline,\n IAutoMoviePreparePlaybackTimeline,\n IAutoMovieSequence,\n IAutoMovieSequenceRenderFrame,\n IAutoMovieSequenceRenderPlan,\n IAutoMovieSequenceRenderTransitionSpan,\n} from \"@automovie/interface\";\n\nimport { ffmpegArgs } from \"./ffmpegArgs.js\";\nimport { frameName } from \"./frameName.js\";\nimport { framePattern } from \"./framePattern.js\";\nimport { frameTimes } from \"./frameTimes.js\";\nimport { renderPathStem } from \"./renderPathStem.js\";\n\n/**\n * Build the render-layer manifest for a committed sequence. The output FPS is controlled by the render spec; the cut's fps is preserved as editorial metadata. Trim, playback-rate and transition arithmetic is delegated to the engine playback timeline, then copied into the manifest so the capture host has no hidden timing rules.\n *\n * @evidence contracts/development/implementation.md#principled-implementation preparePlaybackTimeline owns trim, playback-rate and overlap arithmetic, and editorial markers use the prepared layout and shot index; frameTimes supplies increasing half-open output samples, and one playbackCursor resolves those samples without changing the sequence's editorial fps.\n * @evidence contracts/development/implementation.md#clear-and-simple-structure The manifest gathers timeline spans, resolved frame samples and paths so a capture host reads one plan instead of independently implementing the cut.\n * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts A mismatched render target or empty schedule refuses; output path overrides are caller data and no sequence identity is specially recognized.\n * @evidence contracts/development/common.md#meaningful-documentation The planner documents editorial versus output fps and target equality; manifest members state seconds, trim offsets, blend weights and host paths.\n * @evidence contracts/development/implementation.md#efficient-algorithms For S supplied shots, E timeline entries, F output frames, M marker visits across plays and K retained placements, planning takes O(S+E+F+M+K log K) time and O(S+E+F+K) peak metadata space. One forward cursor avoids a full timeline scan per frame.\n * @evidence contracts/development/implementation.md#reuse-equivalent-work One prepared layout and index feed editorial marker placement, shot spans, transitions and every frame sample; the forward cursor retains its current entry across increasing sample times only within this call.\n * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The returned plan retains shot spans, frame metadata proportional to the output schedule, and retained editorial marker placements; the temporary cursor and timeline are released on return, and planning opens no host resource.\n */\nexport const planSequenceRender: (\n props: IAutoMoviePlanSequenceRenderProps,\n) => IAutoMovieSequenceRenderPlan = (\n props: IAutoMoviePlanSequenceRenderProps,\n): IAutoMovieSequenceRenderPlan => {\n if (props.spec.target !== props.sequence.id)\n throw new Error(\n `render spec target \"${props.spec.target}\" must equal sequence \"${props.sequence.id}\"`,\n );\n\n const playback: IAutoMoviePreparePlaybackTimeline.IResult =\n preparePlaybackTimeline(props.sequence, props.shots);\n const timeline: IAutoMoviePlaybackTimeline = playback.timeline;\n const times: number[] = frameTimes(\n props.spec.frameFormat.fps,\n timeline.runtime,\n );\n if (times.length === 0)\n throw new Error(\n `planSequenceRender requires at least one frame; fps ${props.spec.frameFormat.fps} and duration ${timeline.runtime} produced zero frames`,\n );\n\n const stem: string = renderPathStem(props.sequence.id);\n const frameDir: string = props.frameDir ?? `frames/${stem}`;\n const outputPath: string = props.outputPath ?? `${stem}.mp4`;\n const inputPattern: string = `${frameDir}/${framePattern()}`;\n const editorialMarkers: IAutoMoviePlaybackEditorialMarker[] =\n sequenceEditorialMarkerTimeline(props.sequence, playback);\n return {\n target: { kind: \"sequence\", id: props.sequence.id },\n ...(editorialMarkers.length === 0 ? {} : { editorialMarkers }),\n sequenceFps: props.sequence.fps,\n renderFps: props.spec.frameFormat.fps,\n durationSeconds: timeline.runtime,\n frameCount: times.length,\n times,\n shots: timeline.entries.map(\n (\n entry: IAutoMoviePlaybackTimeline[\"entries\"][number],\n ): IAutoMovieSequenceRenderPlan[\"shots\"][number] => ({\n entry: entry.entry,\n shot: entry.shot,\n start: entry.start,\n end: entry.start + entry.played,\n played: entry.played,\n offset: entry.offset,\n trim: props.sequence.shots[entry.entry]!.trim,\n ...(entry.playbackRate === undefined\n ? {}\n : { playbackRate: entry.playbackRate }),\n }),\n ),\n transitionSpans: transitionSpans(props.sequence, timeline),\n frames: frameSamples(props.sequence, timeline, times, frameDir),\n frameDir,\n firstFrame: `${frameDir}/${frameName(0)}`,\n lastFrame: `${frameDir}/${frameName(times.length - 1)}`,\n inputPattern,\n outputPath,\n ffmpegArgs: ffmpegArgs(props.spec, inputPattern, outputPath),\n };\n};\n\nconst transitionSpans: (\n sequence: IAutoMovieSequence,\n timeline: IAutoMoviePlaybackTimeline,\n) => IAutoMovieSequenceRenderTransitionSpan[] = (\n sequence: IAutoMovieSequence,\n timeline: IAutoMoviePlaybackTimeline,\n): IAutoMovieSequenceRenderTransitionSpan[] =>\n timeline.entries.flatMap(\n (\n entry: IAutoMoviePlaybackTimeline[\"entries\"][number],\n ): IAutoMovieSequenceRenderTransitionSpan[] => {\n const transition: IAutoMovieSequence[\"shots\"][number][\"transition\"] =\n sequence.shots[entry.entry]!.transition;\n if (transition === null) return [];\n const outgoing: IAutoMoviePlaybackTimeline[\"entries\"][number] =\n timeline.entries[entry.entry - 1]!;\n return [\n {\n entry: entry.entry,\n from: outgoing.shot,\n to: entry.shot,\n kind: transition.kind,\n start: entry.start,\n end: entry.start + transition.duration,\n duration: transition.duration,\n },\n ];\n },\n );\n\n/**\n * Resolve every output frame in one forward sweep. Frame times come from {@link frameTimes} (`i / fps`, strictly increasing), so a single {@link playbackCursor} walks the timeline once, O(frames + entries) instead of a per-frame scan, landing on the same live entry a per-frame resolve would, so the samples are byte-identical.\n */\nconst frameSamples: (\n sequence: IAutoMovieSequence,\n timeline: IAutoMoviePlaybackTimeline,\n times: number[],\n frameDir: string,\n) => IAutoMovieSequenceRenderFrame[] = (\n sequence: IAutoMovieSequence,\n timeline: IAutoMoviePlaybackTimeline,\n times: number[],\n frameDir: string,\n): IAutoMovieSequenceRenderFrame[] => {\n const cursor: ReturnType<typeof playbackCursor> = playbackCursor(\n sequence,\n timeline,\n );\n return times.map(\n (time: number, index: number): IAutoMovieSequenceRenderFrame => {\n const sample: ReturnType<typeof cursor> = cursor(time);\n return {\n index,\n timeSeconds: time,\n path: `${frameDir}/${frameName(index)}`,\n shot: sample.shot,\n shotTimeSeconds: sample.time,\n blend:\n sample.blend === null\n ? null\n : {\n shot: sample.blend.shot,\n shotTimeSeconds: sample.blend.time,\n alpha: sample.blend.alpha,\n },\n };\n },\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiCA,MAAa,sBAGX,UACiC;CACjC,IAAI,MAAM,KAAK,WAAW,MAAM,SAAS,IACvC,MAAM,IAAI,MACR,uBAAuB,MAAM,KAAK,OAAO,yBAAyB,MAAM,SAAS,GAAG,EACtF;CAEF,MAAM,WACJ,wBAAwB,MAAM,UAAU,MAAM,KAAK;CACrD,MAAM,WAAuC,SAAS;CACtD,MAAM,QAAkB,WACtB,MAAM,KAAK,YAAY,KACvB,SAAS,OACX;CACA,IAAI,MAAM,W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,WACJ,SAAS,QAAQ,MAAM,QAAQ;CACjC,OAAO,CACL;EACE,OAAO,MAAM;EACb,MAAM,SAAS;EACf,IAAI,MAAM;EACV,MAAM,WAAW;EACjB,OAAO,MAAM;EACb,KAAK,MAAM,QAAQ,WAAW;EAC9B,UAAU,WAAW;CACvB,CACF;AACF,CACF;;;;AAKF,MAAM,gBAMJ,UACA,UACA,OACA,aACoC;CACpC,MAAM,SAA4C,eAChD,UACA,QACF;CACA,OAAO,MAAM,KACV,MAAc,UAAiD;EAC9D,MAAM,SAAoC,OAAO,IAAI;EACrD,OAAO;GACL;GACA,aAAa;GACb,MAAM,GAAG,SAAS,GAAG,UAAU,KAAK;GACpC,MAAM,OAAO;GACb,iBAAiB,OAAO;GACxB,OACE,OAAO,UAAU,OACb,OACA;IACE,MAAM,OAAO,MAAM;IACnB,iBAAiB,OAAO,MAAM;IAC9B,OAAO,OAAO,MAAM;GACtB;EACR;CACF,CACF;AACF"}
@@ -1,10 +1,11 @@
1
1
  import type * as THREE from "three";
2
+ import type { IAutoMovieSceneSoftProps } from "./IAutoMovieSceneSoftProps.js";
2
3
  /**
3
4
  * Result of building a scene: the `three.js` scene, its cameras (first is
4
5
  * default), and its lights indexed by id.
5
6
  *
6
7
  * @evidence contracts/development/design.md#principled-representation Keeps the built scene with ordered cameras and an id-keyed light map; leading node-child order preserves mask addressing while light motion resolves semantic ids independently of child position.
7
- * @evidence contracts/development/design.md#minimal-and-owned-surface Scene mounting, default camera selection and light animation each receive the lookup form their existing consumer needs.
8
+ * @evidence contracts/development/design.md#minimal-and-owned-surface Scene mounting, default camera selection and light animation each receive their existing lookup. The optional soft-prop handle owns further updates and retirement of the opted-in layer.
8
9
  * @evidence contracts/development/design.md#prohibited-design-shortcuts Lights are never found by counting scene children, and authored camera order remains intact rather than selecting a preferred fixture camera.
9
10
  * @evidence contracts/development/common.md#meaningful-documentation Documents leading compiled node order, first-camera default and id-based light animation lookup rationale.
10
11
  */
@@ -23,4 +24,6 @@ export interface IAutoMovieSceneObject {
23
24
  * counting.
24
25
  */
25
26
  lights: Map<string, THREE.Light>;
27
+ /** Present when a caller supplies soft props to buildScene, including an empty initial frame. */
28
+ softProps?: IAutoMovieSceneSoftProps;
26
29
  }
@@ -0,0 +1,36 @@
1
+ import type { IAutoMovieRenderSoftPropFrame } from "@automovie/interface";
2
+ /**
3
+ * The soft meshes one scene projection owns for its current film instant.
4
+ *
5
+ * @evidence contracts/development/common.md#meaningful-documentation Documents full-frame replacement, subject identity and the release boundary.
6
+ * @evidence contracts/development/design.md#principled-representation One owner updates from world-metre frame data and handles geometry and material lifetimes.
7
+ * @evidence contracts/development/design.md#minimal-and-owned-surface buildScene and draw subjects call the same update and release operations.
8
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts The caller supplies the whole frame and producer status. The handle neither samples time nor owns the scene's other objects.
9
+ */
10
+ export interface IAutoMovieSceneSoftProps {
11
+ /**
12
+ * Replace the projected set from the given film instant. Existing subjects
13
+ * keep their mesh identity, and omitted subjects are removed.
14
+ *
15
+ * @evidence contracts/development/common.md#meaningful-documentation States the full-frame input, retained identity and omitted-subject outcome.
16
+ * @evidenceExclude contracts/development/implementation.md#principled-implementation The signature has no algorithm; buildSceneSoftProps provides it.
17
+ * @evidenceExclude contracts/development/implementation.md#clear-and-simple-structure The signature has no body; buildSceneSoftProps supplies the decomposition.
18
+ * @evidenceExclude contracts/development/implementation.md#prohibited-implementation-shortcuts The signature defines the replacement boundary; buildSceneSoftProps owns admission and projection.
19
+ * @evidenceExclude contracts/development/implementation.md#efficient-algorithms The signature chooses no traversal or allocation strategy.
20
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The signature establishes subject identity; buildSceneSoftProps owns reuse.
21
+ * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The signature acquires no resources; buildSceneSoftProps owns their lifetime.
22
+ */
23
+ update(frames: readonly IAutoMovieRenderSoftPropFrame[]): void;
24
+ /**
25
+ * Remove and release the meshes held by the projection, then close updates.
26
+ *
27
+ * @evidence contracts/development/common.md#meaningful-documentation States the resources released and the closed lifetime.
28
+ * @evidenceExclude contracts/development/implementation.md#principled-implementation The signature has no algorithm; buildSceneSoftProps provides it.
29
+ * @evidenceExclude contracts/development/implementation.md#clear-and-simple-structure The signature has no body; buildSceneSoftProps supplies the decomposition.
30
+ * @evidenceExclude contracts/development/implementation.md#prohibited-implementation-shortcuts The signature defines a lifetime boundary; buildSceneSoftProps owns independent release attempts.
31
+ * @evidenceExclude contracts/development/implementation.md#efficient-algorithms The signature chooses no traversal or allocation strategy.
32
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The signature starts no new operation after closure; buildSceneSoftProps supplies the guard.
33
+ * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The signature acquires no resources; buildSceneSoftProps owns their release.
34
+ */
35
+ dispose(): void;
36
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IAutoMovieSceneSoftProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAutoMovieSceneSoftProps.js","sourceRoot":"","sources":["../../src/scene/IAutoMovieSceneSoftProps.ts"],"names":[],"mappings":""}
File without changes
@@ -13,10 +13,14 @@ export interface IChunkObject {
13
13
  * Retains the compiled chunk identity, bounds and anonymous membership used by runtime culling.
14
14
  */
15
15
  runtime: IAutoMovieCompiledFormation["chunks"][number];
16
- /**
17
- * Stores the metre-space chunk radius used with the model projection radius in frustum admission.
18
- */
16
+ /** Group-local metre center of the current base arrangement. */
17
+ center: THREE.Vector3;
18
+ /** Conservative radius of the compiled rest placement bounds, in metres. */
19
+ restRadius: number;
20
+ /** Group-local radius of the base arrangement, before sparse offsets and model extent. */
19
21
  radius: number;
22
+ /** Greatest distance from center among the present sparse exceptions at the current time. */
23
+ exceptionRadius: number;
20
24
  /**
21
25
  * Retains exact compiled placements for the anonymous members represented by this chunk.
22
26
  */
@@ -0,0 +1,31 @@
1
+ import type { IAutoMovieShot } from "@automovie/interface";
2
+ import * as THREE from "three";
3
+ import type { IAutoMovieModelObject } from "./IAutoMovieModelObject.js";
4
+ /**
5
+ * Apply an admitted shot's practical surface cues to built prop instances.
6
+ *
7
+ * Before drawing a frame of the shot, call this with its shot-local seconds in
8
+ * [0, duration). Resolve scene node ids to the distinct model objects mounted
9
+ * for those placements, for example by keeping the results supplied to
10
+ * buildScene. Resolve each model-scoped material id to a prepared, geometry-
11
+ * compatible material for that node and part. The host can use buildMaterial
12
+ * with its existing texture resolver and retains ownership of those materials
13
+ * and textures. An initial key can select the part's original material by
14
+ * supplying that same reference.
15
+ *
16
+ * This updates only tracked parts. When reusing a mounted scene across shots,
17
+ * restore its staged materials or author opening tracks for parts whose prior
18
+ * shot changed their material.
19
+ *
20
+ * @throws {RangeError} The tracked shot sample is outside its local interval.
21
+ * @throws {Error} A target has no distinct single-material mesh, or its selected variant is unavailable.
22
+ *
23
+ * @evidence contracts/development/common.md#meaningful-documentation States the frame clock, caller's mounting and resolution roles, failure conditions, original material path and reused-scene reset requirement.
24
+ * @evidence contracts/development/implementation.md#principled-implementation Samples each track independently, resolves the exact built node-part mesh and material, then swaps pointers only after complete frame preflight.
25
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Engine owns the discrete key rule. Render resolves and validates target and variant references before applying the resulting assignments.
26
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No lookup by display name, mesh traversal, material mutation, shared model rewrite or previous-frame dependency. Missing and aliased targets fail before any assignments.
27
+ * @evidence contracts/development/implementation.md#efficient-algorithms One target lookup, logarithmic key selection and one variant resolution per track, with one temporary assignment per target. Untracked shots return immediately.
28
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work All frames use the caller's prepared references. Reapplying a selected material requires no conversion or copy.
29
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources No geometry, material or texture is allocated or disposed. Assignments borrow already-owned materials for live mesh slots and no auxiliary state persists.
30
+ */
31
+ export declare function applyPracticalSurfaceMaterials(shot: IAutoMovieShot, seconds: number, resolveNode: (node: string) => IAutoMovieModelObject | undefined, resolveMaterial: (node: string, part: string, material: string) => THREE.Material | undefined): void;
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.applyPracticalSurfaceMaterials = applyPracticalSurfaceMaterials;
37
+ const engine_1 = require("@automovie/engine");
38
+ const THREE = __importStar(require("three"));
39
+ /**
40
+ * Apply an admitted shot's practical surface cues to built prop instances.
41
+ *
42
+ * Before drawing a frame of the shot, call this with its shot-local seconds in
43
+ * [0, duration). Resolve scene node ids to the distinct model objects mounted
44
+ * for those placements, for example by keeping the results supplied to
45
+ * buildScene. Resolve each model-scoped material id to a prepared, geometry-
46
+ * compatible material for that node and part. The host can use buildMaterial
47
+ * with its existing texture resolver and retains ownership of those materials
48
+ * and textures. An initial key can select the part's original material by
49
+ * supplying that same reference.
50
+ *
51
+ * This updates only tracked parts. When reusing a mounted scene across shots,
52
+ * restore its staged materials or author opening tracks for parts whose prior
53
+ * shot changed their material.
54
+ *
55
+ * @throws {RangeError} The tracked shot sample is outside its local interval.
56
+ * @throws {Error} A target has no distinct single-material mesh, or its selected variant is unavailable.
57
+ *
58
+ * @evidence contracts/development/common.md#meaningful-documentation States the frame clock, caller's mounting and resolution roles, failure conditions, original material path and reused-scene reset requirement.
59
+ * @evidence contracts/development/implementation.md#principled-implementation Samples each track independently, resolves the exact built node-part mesh and material, then swaps pointers only after complete frame preflight.
60
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Engine owns the discrete key rule. Render resolves and validates target and variant references before applying the resulting assignments.
61
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No lookup by display name, mesh traversal, material mutation, shared model rewrite or previous-frame dependency. Missing and aliased targets fail before any assignments.
62
+ * @evidence contracts/development/implementation.md#efficient-algorithms One target lookup, logarithmic key selection and one variant resolution per track, with one temporary assignment per target. Untracked shots return immediately.
63
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work All frames use the caller's prepared references. Reapplying a selected material requires no conversion or copy.
64
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources No geometry, material or texture is allocated or disposed. Assignments borrow already-owned materials for live mesh slots and no auxiliary state persists.
65
+ */
66
+ function applyPracticalSurfaceMaterials(shot, seconds, resolveNode, resolveMaterial) {
67
+ if (!shot.practicalSurfaces?.length)
68
+ return;
69
+ if (!Number.isFinite(seconds) || seconds < 0 || seconds >= shot.duration)
70
+ throw new RangeError("Practical surface sample must be inside the shot");
71
+ const assignments = new Map();
72
+ for (const track of shot.practicalSurfaces) {
73
+ const target = resolveNode(track.node)?.parts.get(track.part);
74
+ if (!(target instanceof THREE.Mesh) ||
75
+ Array.isArray(target.material) ||
76
+ assignments.has(target))
77
+ throw new Error(`Practical surface "${track.node}" part "${track.part}" has no distinct single-material mesh`);
78
+ const selected = (0, engine_1.samplePracticalSurfaceTrackMaterial)(track, seconds);
79
+ const material = resolveMaterial(track.node, track.part, selected);
80
+ if (material === undefined)
81
+ throw new Error(`Practical surface "${track.node}" part "${track.part}" has no prepared material "${selected}"`);
82
+ assignments.set(target, material);
83
+ }
84
+ for (const [target, material] of assignments)
85
+ target.material = material;
86
+ }
87
+ //# sourceMappingURL=applyPracticalSurfaceMaterials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applyPracticalSurfaceMaterials.js","sourceRoot":"","sources":["../../src/scene/applyPracticalSurfaceMaterials.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAwE;AAExE,MAAY,KAAK,kCAAc;AAI/B;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wCACE,IAAoB,EACpB,OAAe,EACf,WAAgE,EAChE,eAI+B;IAE/B,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM;QAAE,OAAO;IAC5C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,GAAG,CAAC,IAAI,OAAO,IAAI,IAAI,CAAC,QAAQ;QACtE,MAAM,IAAI,UAAU,CAAC,kDAAkD,CAAC,CAAC;IAE3E,MAAM,WAAW,GAAoC,IAAI,GAAG,EAAE,CAAC;IAC/D,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC3C,MAAM,MAAM,GAA+B,WAAW,CACpD,KAAK,CAAC,IAAI,CACX,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACzB,IACE,CAAC,CAAC,MAAM,YAAY,KAAK,CAAC,IAAI,CAAC;YAC/B,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC;YAC9B,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC;YAEvB,MAAM,IAAI,KAAK,CACb,sBAAsB,KAAK,CAAC,IAAI,WAAW,KAAK,CAAC,IAAI,wCAAwC,CAC9F,CAAC;QAEJ,MAAM,QAAQ,GAAW,IAAA,4CAAmC,EAC1D,KAAK,EACL,OAAO,CACR,CAAC;QACF,MAAM,QAAQ,GAA+B,eAAe,CAC1D,KAAK,CAAC,IAAI,EACV,KAAK,CAAC,IAAI,EACV,QAAQ,CACT,CAAC;QACF,IAAI,QAAQ,KAAK,SAAS;YACxB,MAAM,IAAI,KAAK,CACb,sBAAsB,KAAK,CAAC,IAAI,WAAW,KAAK,CAAC,IAAI,+BAA+B,QAAQ,GAAG,CAChG,CAAC;QACJ,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACpC,CAAC;IAED,KAAK,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,WAAW;QAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC3E,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { samplePracticalSurfaceTrackMaterial } from "@automovie/engine";
2
+ import * as THREE from "three";
3
+ // src/scene/applyPracticalSurfaceMaterials.ts
4
+ /**
5
+ * Apply an admitted shot's practical surface cues to built prop instances.
6
+ *
7
+ * Before drawing a frame of the shot, call this with its shot-local seconds in
8
+ * [0, duration). Resolve scene node ids to the distinct model objects mounted
9
+ * for those placements, for example by keeping the results supplied to
10
+ * buildScene. Resolve each model-scoped material id to a prepared, geometry-
11
+ * compatible material for that node and part. The host can use buildMaterial
12
+ * with its existing texture resolver and retains ownership of those materials
13
+ * and textures. An initial key can select the part's original material by
14
+ * supplying that same reference.
15
+ *
16
+ * This updates only tracked parts. When reusing a mounted scene across shots,
17
+ * restore its staged materials or author opening tracks for parts whose prior
18
+ * shot changed their material.
19
+ *
20
+ * @throws {RangeError} The tracked shot sample is outside its local interval.
21
+ * @throws {Error} A target has no distinct single-material mesh, or its selected variant is unavailable.
22
+ *
23
+ * @evidence contracts/development/common.md#meaningful-documentation States the frame clock, caller's mounting and resolution roles, failure conditions, original material path and reused-scene reset requirement.
24
+ * @evidence contracts/development/implementation.md#principled-implementation Samples each track independently, resolves the exact built node-part mesh and material, then swaps pointers only after complete frame preflight.
25
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Engine owns the discrete key rule. Render resolves and validates target and variant references before applying the resulting assignments.
26
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No lookup by display name, mesh traversal, material mutation, shared model rewrite or previous-frame dependency. Missing and aliased targets fail before any assignments.
27
+ * @evidence contracts/development/implementation.md#efficient-algorithms One target lookup, logarithmic key selection and one variant resolution per track, with one temporary assignment per target. Untracked shots return immediately.
28
+ * @evidence contracts/development/implementation.md#reuse-equivalent-work All frames use the caller's prepared references. Reapplying a selected material requires no conversion or copy.
29
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources No geometry, material or texture is allocated or disposed. Assignments borrow already-owned materials for live mesh slots and no auxiliary state persists.
30
+ */
31
+ function applyPracticalSurfaceMaterials(shot, seconds, resolveNode, resolveMaterial) {
32
+ if (!shot.practicalSurfaces?.length) return;
33
+ if (!Number.isFinite(seconds) || seconds < 0 || seconds >= shot.duration) throw new RangeError("Practical surface sample must be inside the shot");
34
+ const assignments = /* @__PURE__ */ new Map();
35
+ for (const track of shot.practicalSurfaces) {
36
+ const target = resolveNode(track.node)?.parts.get(track.part);
37
+ if (!(target instanceof THREE.Mesh) || Array.isArray(target.material) || assignments.has(target)) throw new Error(`Practical surface "${track.node}" part "${track.part}" has no distinct single-material mesh`);
38
+ const selected = samplePracticalSurfaceTrackMaterial(track, seconds);
39
+ const material = resolveMaterial(track.node, track.part, selected);
40
+ if (material === void 0) throw new Error(`Practical surface "${track.node}" part "${track.part}" has no prepared material "${selected}"`);
41
+ assignments.set(target, material);
42
+ }
43
+ for (const [target, material] of assignments) target.material = material;
44
+ }
45
+ export { applyPracticalSurfaceMaterials };
46
+
47
+ //# sourceMappingURL=applyPracticalSurfaceMaterials.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applyPracticalSurfaceMaterials.mjs","names":[],"sources":["../../src/scene/applyPracticalSurfaceMaterials.ts"],"sourcesContent":["import { samplePracticalSurfaceTrackMaterial } from \"@automovie/engine\";\nimport type { IAutoMovieShot } from \"@automovie/interface\";\nimport * as THREE from \"three\";\n\nimport type { IAutoMovieModelObject } from \"./IAutoMovieModelObject.js\";\n\n/**\n * Apply an admitted shot's practical surface cues to built prop instances.\n *\n * Before drawing a frame of the shot, call this with its shot-local seconds in\n * [0, duration). Resolve scene node ids to the distinct model objects mounted\n * for those placements, for example by keeping the results supplied to\n * buildScene. Resolve each model-scoped material id to a prepared, geometry-\n * compatible material for that node and part. The host can use buildMaterial\n * with its existing texture resolver and retains ownership of those materials\n * and textures. An initial key can select the part's original material by\n * supplying that same reference.\n *\n * This updates only tracked parts. When reusing a mounted scene across shots,\n * restore its staged materials or author opening tracks for parts whose prior\n * shot changed their material.\n *\n * @throws {RangeError} The tracked shot sample is outside its local interval.\n * @throws {Error} A target has no distinct single-material mesh, or its selected variant is unavailable.\n *\n * @evidence contracts/development/common.md#meaningful-documentation States the frame clock, caller's mounting and resolution roles, failure conditions, original material path and reused-scene reset requirement.\n * @evidence contracts/development/implementation.md#principled-implementation Samples each track independently, resolves the exact built node-part mesh and material, then swaps pointers only after complete frame preflight.\n * @evidence contracts/development/implementation.md#clear-and-simple-structure Engine owns the discrete key rule. Render resolves and validates target and variant references before applying the resulting assignments.\n * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No lookup by display name, mesh traversal, material mutation, shared model rewrite or previous-frame dependency. Missing and aliased targets fail before any assignments.\n * @evidence contracts/development/implementation.md#efficient-algorithms One target lookup, logarithmic key selection and one variant resolution per track, with one temporary assignment per target. Untracked shots return immediately.\n * @evidence contracts/development/implementation.md#reuse-equivalent-work All frames use the caller's prepared references. Reapplying a selected material requires no conversion or copy.\n * @evidence contracts/development/implementation.md#bound-retention-and-release-resources No geometry, material or texture is allocated or disposed. Assignments borrow already-owned materials for live mesh slots and no auxiliary state persists.\n */\nexport function applyPracticalSurfaceMaterials(\n shot: IAutoMovieShot,\n seconds: number,\n resolveNode: (node: string) => IAutoMovieModelObject | undefined,\n resolveMaterial: (\n node: string,\n part: string,\n material: string,\n ) => THREE.Material | undefined,\n): void {\n if (!shot.practicalSurfaces?.length) return;\n if (!Number.isFinite(seconds) || seconds < 0 || seconds >= shot.duration)\n throw new RangeError(\"Practical surface sample must be inside the shot\");\n\n const assignments: Map<THREE.Mesh, THREE.Material> = new Map();\n for (const track of shot.practicalSurfaces) {\n const target: THREE.Object3D | undefined = resolveNode(\n track.node,\n )?.parts.get(track.part);\n if (\n !(target instanceof THREE.Mesh) ||\n Array.isArray(target.material) ||\n assignments.has(target)\n )\n throw new Error(\n `Practical surface \"${track.node}\" part \"${track.part}\" has no distinct single-material mesh`,\n );\n\n const selected: string = samplePracticalSurfaceTrackMaterial(\n track,\n seconds,\n );\n const material: THREE.Material | undefined = resolveMaterial(\n track.node,\n track.part,\n selected,\n );\n if (material === undefined)\n throw new Error(\n `Practical surface \"${track.node}\" part \"${track.part}\" has no prepared material \"${selected}\"`,\n );\n assignments.set(target, material);\n }\n\n for (const [target, material] of assignments) target.material = material;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,SAAgB,+BACd,MACA,SACA,aACA,iBAKM;CACN,IAAI,CAAC,KAAK,mBAAmB,QAAQ;CACrC,IAAI,CAAC,OAAO,SAAS,OAAO,KAAK,UAAU,KAAK,WAAW,KAAK,UAC9D,MAAM,IAAI,WAAW,kDAAkD;CAEzE,MAAM,8BAA+C,IAAI,IAAI;CAC7D,KAAK,MAAM,SAAS,KAAK,mBAAmB;EAC1C,MAAM,SAAqC,YACzC,MAAM,IACR,CAAC,EAAE,MAAM,IAAI,MAAM,IAAI;EACvB,IACE,EAAE,kBAAkB,MAAM,SAC1B,MAAM,QAAQ,OAAO,QAAQ,KAC7B,YAAY,IAAI,MAAM,GAEtB,MAAM,IAAI,MACR,sBAAsB,MAAM,KAAK,UAAU,MAAM,KAAK,uCACxD;EAEF,MAAM,WAAmB,oCACvB,OACA,OACF;EACA,MAAM,WAAuC,gBAC3C,MAAM,MACN,MAAM,MACN,QACF;EACA,IAAI,aAAa,KAAA,GACf,MAAM,IAAI,MACR,sBAAsB,MAAM,KAAK,UAAU,MAAM,KAAK,8BAA8B,SAAS,EAC/F;EACF,YAAY,IAAI,QAAQ,QAAQ;CAClC;CAEA,KAAK,MAAM,CAAC,QAAQ,aAAa,aAAa,OAAO,WAAW;AAClE"}