@@ -258,22 +258,22 @@ TypedArray<StringName> AnimationMixer::_get_animation_library_list() const {
258258}
259259
260260#if !defined(_3D_DISABLED) && !defined(DISABLE_DEPRECATED)
261- bool AnimationMixer::_recalc_animation (Ref<Animation> &anim ) {
261+ bool AnimationMixer::_recalc_animation (Ref<Animation> &p_anim ) {
262262 HashMap<int , Vector<real_t >> new_track_values_map;
263263 Node *parent = get_node_or_null (root_node);
264264 if (!parent) {
265265 return false ;
266266 }
267267
268- for (int i = 0 ; i < anim ->get_track_count (); i++) {
269- int track_type = anim ->track_get_type (i);
270- if (!anim ->track_is_relative_to_rest (i)) {
268+ for (int i = 0 ; i < p_anim ->get_track_count (); i++) {
269+ int track_type = p_anim ->track_get_type (i);
270+ if (!p_anim ->track_is_relative_to_rest (i)) {
271271 continue ;
272272 }
273273 if (track_type == Animation::TYPE_POSITION_3D || track_type == Animation::TYPE_ROTATION_3D || track_type == Animation::TYPE_SCALE_3D) {
274- NodePath path = anim ->track_get_path (i);
274+ NodePath path = p_anim ->track_get_path (i);
275275 Node *node = parent->get_node (path);
276- ERR_FAIL_COND_V (! node, false );
276+ ERR_FAIL_NULL_V ( node, false );
277277 Skeleton3D *skel = Object::cast_to<Skeleton3D>(node);
278278 if (!skel) { // transforming non-skeleton node, not relative to rest
279279 continue ;
@@ -292,14 +292,14 @@ bool AnimationMixer::_recalc_animation(Ref<Animation> &anim) {
292292 if (track_type == Animation::TYPE_ROTATION_3D) {
293293 track_size = ROTATION_TRACK_SIZE;
294294 }
295- new_track_values_map[i].resize (track_size * anim ->track_get_key_count (i));
295+ new_track_values_map[i].resize (track_size * p_anim ->track_get_key_count (i));
296296 real_t *r = new_track_values_map[i].ptrw ();
297- for (int j = 0 ; j < anim ->track_get_key_count (i); j++) {
298- real_t time = anim ->track_get_key_time (i, j);
299- real_t transition = anim ->track_get_key_transition (i, j);
297+ for (int j = 0 ; j < p_anim ->track_get_key_count (i); j++) {
298+ real_t time = p_anim ->track_get_key_time (i, j);
299+ real_t transition = p_anim ->track_get_key_transition (i, j);
300300 if (track_type == Animation::TYPE_POSITION_3D) {
301- Vector3 a_pos = anim ->track_get_key_value (i, j);
302- Transform3D t = Transform3D () ;
301+ Vector3 a_pos = p_anim ->track_get_key_value (i, j);
302+ Transform3D t;
303303 t.set_origin (a_pos);
304304 Vector3 new_a_pos = (rest * t).origin ;
305305
@@ -310,8 +310,8 @@ bool AnimationMixer::_recalc_animation(Ref<Animation> &anim) {
310310 ofs[3 ] = new_a_pos.y ;
311311 ofs[4 ] = new_a_pos.z ;
312312 } else if (track_type == Animation::TYPE_ROTATION_3D) {
313- Quaternion q = anim ->track_get_key_value (i, j);
314- Transform3D t = Transform3D () ;
313+ Quaternion q = p_anim ->track_get_key_value (i, j);
314+ Transform3D t;
315315 t.basis .rotate (q);
316316 Quaternion new_q = (rest * t).basis .get_rotation_quaternion ();
317317 real_t *ofs = &r[j * ROTATION_TRACK_SIZE];
@@ -322,8 +322,8 @@ bool AnimationMixer::_recalc_animation(Ref<Animation> &anim) {
322322 ofs[4 ] = new_q.z ;
323323 ofs[5 ] = new_q.w ;
324324 } else if (track_type == Animation::TYPE_SCALE_3D) {
325- Vector3 v = anim ->track_get_key_value (i, j);
326- Transform3D t = Transform3D () ;
325+ Vector3 v = p_anim ->track_get_key_value (i, j);
326+ Transform3D t;
327327 t.scale (v);
328328 Vector3 new_v = (rest * t).basis .get_scale ();
329329
@@ -340,14 +340,14 @@ bool AnimationMixer::_recalc_animation(Ref<Animation> &anim) {
340340 if (new_track_values_map.is_empty ()) {
341341 return false ;
342342 }
343- for (int i = 0 ; i < anim ->get_track_count (); i++) {
343+ for (int i = 0 ; i < p_anim ->get_track_count (); i++) {
344344 if (!new_track_values_map.has (i)) {
345345 continue ;
346346 }
347- anim ->set (" tracks/" + itos (i) + " /keys" , new_track_values_map[i]);
348- anim ->set (" tracks/" + itos (i) + " /relative_to_rest" , false );
347+ p_anim ->set (" tracks/" + itos (i) + " /keys" , new_track_values_map[i]);
348+ p_anim ->set (" tracks/" + itos (i) + " /relative_to_rest" , false );
349349 }
350- anim ->emit_changed ();
350+ p_anim ->emit_changed ();
351351 return true ;
352352}
353353#endif // !defined(_3D_DISABLED) || !defined(DISABLE_DEPRECATED)
0 commit comments