Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/cine black images #761

Merged
merged 21 commits into from
Sep 12, 2023
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
PR fixes
wayfarer3130 committed Sep 8, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 128911c0c3ee3d002a719a40e4490238d3651845
9 changes: 7 additions & 2 deletions packages/tools/src/types/CINETypes.ts
Original file line number Diff line number Diff line change
@@ -5,7 +5,10 @@ type PlayClipOptions = {
loop?: boolean;
dynamicCineEnabled?: boolean;
frameTimeVectorSpeedMultiplier?: number;
// How many items to wait for. Set to 0 to play immediately
// How many CINE frames to wait for a rendered event to occur before
// trying to display the image after the next one
// A CINE frame is attempted every 1 / fps seconds
// The default is 30 tries, or 1.25 seconds at 24 fps
waitForRendered?: number;
};

@@ -26,7 +29,9 @@ type CinePlayContext = {
get numScrollSteps(): number;
get currentStepIndex(): number;
get frameTimeVectorEnabled(): boolean;
tries?: number;
// How many times has the wait for rendered been tried without showing
// the next image.
waitForRenderedCount?: number;
scroll(delta: number): void;
};

8 changes: 4 additions & 4 deletions packages/tools/src/utilities/cine/playClip.ts
Original file line number Diff line number Diff line change
@@ -333,16 +333,16 @@ function _createStackViewportCinePlayContext(
// It is always in acquired orientation
return true;
},
tries: 0,
waitForRenderedCount: 0,
scroll(delta: number): void {
if (
this.tries <= waitForRendered &&
this.waitForRenderedCount <= waitForRendered &&
viewport.viewportStatus !== ViewportStatus.RENDERED
) {
this.tries++;
this.waitForRenderedCount++;
return;
}
this.tries = 0;
this.waitForRenderedCount = 0;
scroll(viewport, { delta, debounceLoading: debounced });
},
};