@@ -23,7 +23,7 @@ PyObject *py_ue_anim_get_bone_transform(ue_PyUObject * self, PyObject * args)
2323 ue_py_check (self);
2424
2525 int track_index;
26- float frame_time;
26+ float frame_time;
2727 PyObject *py_b_use_raw_data = nullptr ;
2828
2929 if (!PyArg_ParseTuple (args, " if|O:get_bone_transform" , &track_index, &frame_time, &py_b_use_raw_data))
@@ -45,6 +45,35 @@ PyObject *py_ue_anim_get_bone_transform(ue_PyUObject * self, PyObject * args)
4545 return py_ue_new_ftransform (OutAtom);
4646}
4747
48+ PyObject *py_ue_anim_extract_bone_transform (ue_PyUObject * self, PyObject * args)
49+ {
50+ ue_py_check (self);
51+
52+ PyObject *py_sources;
53+ float frame_time;
54+
55+ if (!PyArg_ParseTuple (args, " Of:extract_bone_transform" , &py_sources, &frame_time))
56+ {
57+ return nullptr ;
58+ }
59+
60+ UAnimSequence *anim = ue_py_check_type<UAnimSequence>(self);
61+ if (!anim)
62+ return PyErr_Format (PyExc_Exception, " UObject is not a UAnimSequence." );
63+
64+ ue_PyFRawAnimSequenceTrack *rast = py_ue_is_fraw_anim_sequence_track (py_sources);
65+ if (rast)
66+ {
67+ FTransform OutAtom;
68+ anim->ExtractBoneTransform (rast->raw_anim_sequence_track , OutAtom, frame_time);
69+
70+ return py_ue_new_ftransform (OutAtom);
71+ }
72+
73+ return PyErr_Format (PyExc_Exception, " argument is not an FRawAnimSequenceTrack" );
74+
75+ }
76+
4877PyObject *py_ue_anim_extract_root_motion (ue_PyUObject * self, PyObject * args)
4978{
5079 ue_py_check (self);
@@ -138,16 +167,16 @@ PyObject *py_ue_anim_sequence_apply_raw_anim_changes(ue_PyUObject * self, PyObje
138167
139168
140169 if (anim_seq->DoesNeedRebake ())
141- {
142- anim_seq->Modify (true );
143- anim_seq->BakeTrackCurvesToRawAnimation ();
144- }
170+ {
171+ anim_seq->Modify (true );
172+ anim_seq->BakeTrackCurvesToRawAnimation ();
173+ }
145174
146- if (anim_seq->DoesNeedRecompress ())
147- {
148- anim_seq->Modify (true );
149- anim_seq->RequestSyncAnimRecompression (false );
150- }
175+ if (anim_seq->DoesNeedRecompress ())
176+ {
177+ anim_seq->Modify (true );
178+ anim_seq->RequestSyncAnimRecompression (false );
179+ }
151180
152181 Py_RETURN_NONE;
153182}
@@ -214,7 +243,7 @@ PyObject *py_ue_anim_sequence_update_raw_track(ue_PyUObject * self, PyObject * a
214243 anim_seq->Modify ();
215244
216245 FRawAnimSequenceTrack& RawRef = anim_seq->GetRawAnimationTrack (track_index);
217-
246+
218247 RawRef.PosKeys = py_f_rast->raw_anim_sequence_track .PosKeys ;
219248 RawRef.RotKeys = py_f_rast->raw_anim_sequence_track .RotKeys ;
220249 RawRef.ScaleKeys = py_f_rast->raw_anim_sequence_track .ScaleKeys ;
0 commit comments