mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 00:32:57 -04:00
Fix async flatten of node without parents
This commit is contained in:
parent
18085a7cb1
commit
9904980ce4
@ -34,6 +34,7 @@ This issue fixes several bugs that were still found in 1.9.2.
|
|||||||
* Support for InvSphere, Box and Tube solids in bam2egg
|
* Support for InvSphere, Box and Tube solids in bam2egg
|
||||||
* Add normalized() method to vectors
|
* Add normalized() method to vectors
|
||||||
* asyncFlattenStrong with inPlace=True caused node to disappear
|
* asyncFlattenStrong with inPlace=True caused node to disappear
|
||||||
|
* Fix asyncFlattenStrong called on nodes without parent
|
||||||
|
|
||||||
------------------------ RELEASE 1.9.2 ------------------------
|
------------------------ RELEASE 1.9.2 ------------------------
|
||||||
|
|
||||||
|
@ -25,10 +25,19 @@ TypeHandle ModelFlattenRequest::_type_handle;
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
AsyncTask::DoneStatus ModelFlattenRequest::
|
AsyncTask::DoneStatus ModelFlattenRequest::
|
||||||
do_task() {
|
do_task() {
|
||||||
// We make another instance of the original node, so we can safely
|
// We make another instance of the original node, so we can safely flatten
|
||||||
// flatten that without affecting the original copy.
|
// that without affecting the original copy.
|
||||||
NodePath np("flatten_root");
|
NodePath np("flatten_root");
|
||||||
|
|
||||||
|
// Except if we try to attach a node without parents, this will cause the
|
||||||
|
// original NodePath to be affected, so we have to make a (shallow) copy.
|
||||||
|
if (_orig->get_num_parents() == 0) {
|
||||||
|
PT(PandaNode) copy = _orig->make_copy();
|
||||||
|
copy->copy_children(_orig);
|
||||||
|
np.attach_new_node(copy);
|
||||||
|
} else {
|
||||||
np.attach_new_node(_orig);
|
np.attach_new_node(_orig);
|
||||||
|
}
|
||||||
np.flatten_strong();
|
np.flatten_strong();
|
||||||
_model = np.get_child(0).node();
|
_model = np.get_child(0).node();
|
||||||
_is_ready = true;
|
_is_ready = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user