Skip to content

Commit c9b0177

Browse files
author
Roberto De Ioris
committed
4.20 improvements
1 parent 21e51d7 commit c9b0177

File tree

1 file changed

+18
-23
lines changed

1 file changed

+18
-23
lines changed

Source/UnrealEnginePython/Private/UObject/UEPySequencer.cpp

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -734,8 +734,7 @@ PyObject *py_ue_sequencer_set_playback_range(ue_PyUObject *self, PyObject * args
734734
return nullptr;
735735
}
736736

737-
FFrameNumber StartFrame;
738-
StartFrame.Value = start_frame;
737+
FFrameNumber StartFrame((int32)start_frame);
739738
scene->SetPlaybackRange(StartFrame, duration);
740739
#endif
741740

@@ -783,10 +782,9 @@ PyObject *py_ue_sequencer_section_add_key(ue_PyUObject *self, PyObject * args)
783782
section_float->AddKey(time, value, (EMovieSceneKeyInterpolation)interpolation);
784783
Py_RETURN_NONE;
785784
#else
786-
FFrameNumber FrameNum;
787-
FrameNum.Value = frame_number;
785+
FFrameNumber FrameNum((int32)frame_number);
788786
FMovieSceneFloatChannel &Channel = (FMovieSceneFloatChannel &)section_float->GetChannel();
789-
int32 RetValue = Channel.AddLinearKey(FrameNum, value);
787+
int32 RetValue = Channel.AddCubicKey(FrameNum, value);
790788
return PyLong_FromLong(RetValue);
791789
#endif
792790

@@ -803,8 +801,7 @@ PyObject *py_ue_sequencer_section_add_key(ue_PyUObject *self, PyObject * args)
803801
#if ENGINE_MINOR_VERSION < 20
804802
section_bool->AddKey(time, value, (EMovieSceneKeyInterpolation)interpolation);
805803
#else
806-
FFrameNumber FrameNum;
807-
FrameNum.Value = frame_number;
804+
FFrameNumber FrameNum((int32)frame_number);
808805
int32 RetValue = section_bool->GetChannel().GetData().AddKey(FrameNum, value);
809806
return PyLong_FromLong(RetValue);
810807
#endif
@@ -842,19 +839,18 @@ PyObject *py_ue_sequencer_section_add_key(ue_PyUObject *self, PyObject * args)
842839
section_transform->AddKey(time, sy, (EMovieSceneKeyInterpolation)interpolation);
843840
section_transform->AddKey(time, sz, (EMovieSceneKeyInterpolation)interpolation);
844841
#else
845-
FFrameNumber FrameNum;
846-
FrameNum.Value = frame_number;
847-
int32 RetValueTX = section_transform->GetChannelProxy().GetChannel<FMovieSceneFloatChannel>(0)->AddLinearKey(FrameNum, transform.GetLocation().X);
848-
int32 RetValueTY = section_transform->GetChannelProxy().GetChannel<FMovieSceneFloatChannel>(1)->AddLinearKey(FrameNum, transform.GetLocation().Y);
849-
int32 RetValueTZ = section_transform->GetChannelProxy().GetChannel<FMovieSceneFloatChannel>(2)->AddLinearKey(FrameNum, transform.GetLocation().Z);
842+
FFrameNumber FrameNum((int32)frame_number);
843+
int32 RetValueTX = section_transform->GetChannelProxy().GetChannel<FMovieSceneFloatChannel>(0)->AddCubicKey(FrameNum, transform.GetLocation().X);
844+
int32 RetValueTY = section_transform->GetChannelProxy().GetChannel<FMovieSceneFloatChannel>(1)->AddCubicKey(FrameNum, transform.GetLocation().Y);
845+
int32 RetValueTZ = section_transform->GetChannelProxy().GetChannel<FMovieSceneFloatChannel>(2)->AddCubicKey(FrameNum, transform.GetLocation().Z);
850846

851-
int32 RetValueRX = section_transform->GetChannelProxy().GetChannel<FMovieSceneFloatChannel>(3)->AddLinearKey(FrameNum, transform.GetRotation().Euler().X);
852-
int32 RetValueRY = section_transform->GetChannelProxy().GetChannel<FMovieSceneFloatChannel>(4)->AddLinearKey(FrameNum, transform.GetRotation().Euler().Y);
853-
int32 RetValueRZ = section_transform->GetChannelProxy().GetChannel<FMovieSceneFloatChannel>(5)->AddLinearKey(FrameNum, transform.GetRotation().Euler().Z);
847+
int32 RetValueRX = section_transform->GetChannelProxy().GetChannel<FMovieSceneFloatChannel>(3)->AddCubicKey(FrameNum, transform.GetRotation().Euler().X);
848+
int32 RetValueRY = section_transform->GetChannelProxy().GetChannel<FMovieSceneFloatChannel>(4)->AddCubicKey(FrameNum, transform.GetRotation().Euler().Y);
849+
int32 RetValueRZ = section_transform->GetChannelProxy().GetChannel<FMovieSceneFloatChannel>(5)->AddCubicKey(FrameNum, transform.GetRotation().Euler().Z);
854850

855-
int32 RetValueSX = section_transform->GetChannelProxy().GetChannel<FMovieSceneFloatChannel>(6)->AddLinearKey(FrameNum, transform.GetScale3D().X);
856-
int32 RetValueSY = section_transform->GetChannelProxy().GetChannel<FMovieSceneFloatChannel>(7)->AddLinearKey(FrameNum, transform.GetScale3D().Y);
857-
int32 RetValueSZ = section_transform->GetChannelProxy().GetChannel<FMovieSceneFloatChannel>(8)->AddLinearKey(FrameNum, transform.GetScale3D().Z);
851+
int32 RetValueSX = section_transform->GetChannelProxy().GetChannel<FMovieSceneFloatChannel>(6)->AddCubicKey(FrameNum, transform.GetScale3D().X);
852+
int32 RetValueSY = section_transform->GetChannelProxy().GetChannel<FMovieSceneFloatChannel>(7)->AddCubicKey(FrameNum, transform.GetScale3D().Y);
853+
int32 RetValueSZ = section_transform->GetChannelProxy().GetChannel<FMovieSceneFloatChannel>(8)->AddCubicKey(FrameNum, transform.GetScale3D().Z);
858854

859855
return Py_BuildValue("((III)(III)(III))", RetValueTX, RetValueTY, RetValueTZ, RetValueRX, RetValueRY, RetValueRZ, RetValueSX, RetValueSY, RetValueSZ);
860856
#endif
@@ -877,14 +873,13 @@ PyObject *py_ue_sequencer_section_add_key(ue_PyUObject *self, PyObject * args)
877873
section_vector->AddKey(time, vy, (EMovieSceneKeyInterpolation)interpolation);
878874
section_vector->AddKey(time, vz, (EMovieSceneKeyInterpolation)interpolation);
879875
#else
880-
FFrameNumber FrameNum;
881-
FrameNum.Value = frame_number;
876+
FFrameNumber FrameNum((int32)frame_number);
882877
FMovieSceneFloatChannel &Channel = (FMovieSceneFloatChannel &)section_vector->GetChannel(0);
883-
int32 RetValueX = Channel.AddLinearKey(FrameNum, vec.X);
878+
int32 RetValueX = Channel.AddCubicKey(FrameNum, vec.X);
884879
Channel = (FMovieSceneFloatChannel &)section_vector->GetChannel(1);
885-
int32 RetValueY = Channel.AddLinearKey(FrameNum, vec.Y);
880+
int32 RetValueY = Channel.AddCubicKey(FrameNum, vec.Y);
886881
Channel = (FMovieSceneFloatChannel &)section_vector->GetChannel(2);
887-
int32 RetValueZ = Channel.AddLinearKey(FrameNum, vec.Z);
882+
int32 RetValueZ = Channel.AddCubicKey(FrameNum, vec.Z);
888883
return Py_BuildValue("(fff)", RetValueX, RetValueY, RetValueZ);
889884
#endif
890885

0 commit comments

Comments
 (0)