-
Notifications
You must be signed in to change notification settings - Fork 19
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
Any way's to clip a .r3d clip inside Unity? #11
Comments
Hi Mathieu, please make these two changes:
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.VFX;
[Serializable]
public class R3DVideoBehaviour : PlayableBehaviour
{
public Record3DPlayback endLocation;
public override void OnGraphStart(Playable playable)
{
base.OnGraphStart(playable);
}
public override void ProcessFrame(Playable playable, FrameData info, object playerData)
{
var trackBinding = playerData as Record3DPlayback;
if (trackBinding == null)
return;
int inputCount = playable.GetInputCount();
for (int i = 0; i < inputCount; i++)
{
var playableInput = (ScriptPlayable<R3DVideoBehaviour>)playable.GetInput(i);
R3DVideoBehaviour input = playableInput.GetBehaviour();
bool isClipActive = playable.GetInputWeight(i) > 0.0;
if (input == null || input.endLocation == null || !isClipActive)
continue;
var currClipTime = playableInput.GetTime();
var clipFPS = input.endLocation.fps;
int frameIdx = (int)Math.Round(currClipTime * clipFPS);
input.endLocation.LoadFrame(frameIdx);
break;
}
}
} With the changes above, it should be possible to split and trim a single continuous However, note that you should always use just and only one See the attached screenshot for a better understanding. Let me know if this helped to solve the issue. Thanks, |
Awesome! This brings so much more editing control. Thanks a lot Marek - coming in clutch as alway's! |
Hi Marek,
I have a 4.0gb .r3d file that I'd like to cut in a bunch of smaller segments of 1 to 5 seconds - Do you know if there's any way to do so directly inside Unity or through the clip script ? When I try to edit via timeline and cut a clip it always makes the new segments starts back at the beginning of the original clip.
Any input would be truly appreciated.
Thanks,
Mathieu
The text was updated successfully, but these errors were encountered: