protected override void AnimateModel(Frame frame) { particleModel.Animate(frame); if (particleModel.IsCameraFollowing()) { DoCameraFollowing(particleModel, particleModel.transform.position, vecFromCameraToModel, studio); } }
public void OnBeginFrame() { try { int shownCurrFrameIndex = frameIndex + 1; float progress = (float)(viewIndex * frames.Length + shownCurrFrameIndex) / (studio.view.checkedSubViews.Count * frames.Length); if (studio.view.checkedSubViews.Count == 0) { IsCancelled = EditorUtility.DisplayCancelableProgressBar("Progress...", "Frame: " + shownCurrFrameIndex + " (" + ((int)(progress * 100f)) + "%)", progress); } else { IsCancelled = EditorUtility.DisplayCancelableProgressBar("Progress...", "View: " + viewName + " | Frame: " + shownCurrFrameIndex + " (" + ((int)(progress * 100f)) + "%)", progress); } if (IsCancelled) { throw new Exception("Cancelled"); } Frame frame = frames[frameIndex]; particleModel.Animate(frame); if (particleModel.IsCameraFollowing()) { ParticleSampler.DoCameraFollowing(particleModel, particleModel.transform.position, vecFromCameraToModel, studio); } stateMachine.ChangeState(BakingState.CaptureFrame); } catch (Exception e) { Debug.LogException(e); Finish(); } }