Skip to content

Commit 08ea4bf

Browse files
committed
Merge branch 'release/1.9.x'
2 parents 234e7ee + 2c651dc commit 08ea4bf

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

doc/ReleaseNotes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ This issue fixes several bugs that were still found in 1.9.2.
3434
* Support for InvSphere, Box and Tube solids in bam2egg
3535
* Add normalized() method to vectors
3636
* asyncFlattenStrong with inPlace=True caused node to disappear
37+
* Fix asyncFlattenStrong called on nodes without parent
38+
* Fix is_playing() check when playing an animation backwards
3739

3840
------------------------ RELEASE 1.9.2 ------------------------
3941

panda/src/pgraph/modelFlattenRequest.cxx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,16 @@ do_task() {
2424
// We make another instance of the original node, so we can safely flatten
2525
// that without affecting the original copy.
2626
NodePath np("flatten_root");
27-
np.attach_new_node(_orig);
27+
28+
// Except if we try to attach a node without parents, this will cause the
29+
// original NodePath to be affected, so we have to make a (shallow) copy.
30+
if (_orig->get_num_parents() == 0) {
31+
PT(PandaNode) copy = _orig->make_copy();
32+
copy->copy_children(_orig);
33+
np.attach_new_node(copy);
34+
} else {
35+
np.attach_new_node(_orig);
36+
}
2837
np.flatten_strong();
2938
_model = np.get_child(0).node();
3039
_is_ready = true;

panda/src/putil/animInterface.cxx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,12 @@ is_playing() const {
356356
return false;
357357

358358
case PM_play:
359-
return get_f() < _play_frames;
359+
if (_effective_frame_rate < 0.0) {
360+
// If we're playing backwards, check if we're at the beginning.
361+
return get_f() > 0;
362+
} else {
363+
return get_f() < _play_frames;
364+
}
360365

361366
case PM_loop:
362367
case PM_pingpong:

0 commit comments

Comments
 (0)