diff --git a/panda/src/gobj/geom.cxx b/panda/src/gobj/geom.cxx index 587742fde6..05be34b572 100644 --- a/panda/src/gobj/geom.cxx +++ b/panda/src/gobj/geom.cxx @@ -342,6 +342,7 @@ set_primitive(int i, const GeomPrimitive *primitive) { cdata->_got_usage_hint = false; cdata->_modified = Geom::get_next_modified(); clear_cache_stage(current_thread); + mark_internal_bounds_stale(cdata); } //////////////////////////////////////////////////////////////////// @@ -387,6 +388,7 @@ add_primitive(const GeomPrimitive *primitive) { cdata->_got_usage_hint = false; cdata->_modified = Geom::get_next_modified(); clear_cache_stage(current_thread); + mark_internal_bounds_stale(cdata); } //////////////////////////////////////////////////////////////////// @@ -412,6 +414,7 @@ remove_primitive(int i) { cdata->_got_usage_hint = false; cdata->_modified = Geom::get_next_modified(); clear_cache_stage(current_thread); + mark_internal_bounds_stale(cdata); } //////////////////////////////////////////////////////////////////// @@ -435,6 +438,7 @@ clear_primitives() { cdata->_shade_model = SM_uniform; reset_geom_rendering(cdata); clear_cache_stage(current_thread); + mark_internal_bounds_stale(cdata); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/pgraph/geomNode.cxx b/panda/src/pgraph/geomNode.cxx index a2364fe802..dc728d7dbc 100644 --- a/panda/src/pgraph/geomNode.cxx +++ b/panda/src/pgraph/geomNode.cxx @@ -484,6 +484,8 @@ check_valid() const { //////////////////////////////////////////////////////////////////// void GeomNode:: unify(int max_indices) { + bool any_changed = false; + Thread *current_thread = Thread::get_current_thread(); OPEN_ITERATE_CURRENT_AND_UPSTREAM(_cycler, current_thread) { CDStageWriter cdata(_cycler, pipeline_stage, current_thread); @@ -507,6 +509,7 @@ unify(int max_indices) { if (new_entry._geom->copy_primitives_from(entry._geom)) { // Successfully combined! unified = true; + any_changed = true; } } } @@ -528,6 +531,10 @@ unify(int max_indices) { } } CLOSE_ITERATE_CURRENT_AND_UPSTREAM(_cycler); + + if (any_changed) { + mark_internal_bounds_stale(); + } } ////////////////////////////////////////////////////////////////////