From 50eb99ed62310c171dc93e43abce9ef367ad840b Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 24 Jan 2003 00:51:49 +0000 Subject: [PATCH] more verbose binding --- panda/src/chan/auto_bind.cxx | 24 ++++++++++++++++++++---- panda/src/chan/partBundle.cxx | 22 ++++++++++++++++++++++ panda/src/chan/partBundle.h | 1 + 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/panda/src/chan/auto_bind.cxx b/panda/src/chan/auto_bind.cxx index 4c41dbd5a4..440b5501bb 100644 --- a/panda/src/chan/auto_bind.cxx +++ b/panda/src/chan/auto_bind.cxx @@ -132,22 +132,38 @@ auto_bind(PandaNode *root_node, AnimControlCollection &controls, r_find_bundles(root_node, anims, parts); if (chan_cat.is_debug()) { - chan_cat.debug() - << "Found " << anims.size() << " anims:\n"; + int anim_count = 0; Anims::const_iterator ai; + for (ai = anims.begin(); ai != anims.end(); ++ai) { + anim_count += (int)(*ai).second.size(); + } + chan_cat.debug() + << "Found " << anim_count << " anims:\n"; for (ai = anims.begin(); ai != anims.end(); ++ai) { chan_cat.debug(false) << " " << (*ai).first; + if ((*ai).second.size() != 1) { + chan_cat.debug(false) + << "*" << ((*ai).second.size()); + } } chan_cat.debug(false) << "\n"; - chan_cat.debug() - << "Found " << parts.size() << " parts:\n"; + int part_count = 0; Parts::const_iterator pi; + for (pi = parts.begin(); pi != parts.end(); ++pi) { + part_count += (int)(*pi).second.size(); + } + chan_cat.debug() + << "Found " << part_count << " parts:\n"; for (pi = parts.begin(); pi != parts.end(); ++pi) { chan_cat.debug(false) << " " << (*pi).first; + if ((*pi).second.size() != 1) { + chan_cat.debug(false) + << "*" << ((*pi).second.size()); + } } chan_cat.debug(false) << "\n"; diff --git a/panda/src/chan/partBundle.cxx b/panda/src/chan/partBundle.cxx index 9a1241c347..b221114bf4 100644 --- a/panda/src/chan/partBundle.cxx +++ b/panda/src/chan/partBundle.cxx @@ -366,6 +366,28 @@ update() { return any_changed; } +//////////////////////////////////////////////////////////////////// +// Function: PartBundle::force_update +// Access: Public +// Description: Updates all the parts in the bundle to reflect the +// data for the current frame, whether we believe it +// needs it or not. +//////////////////////////////////////////////////////////////////// +bool PartBundle:: +force_update() { + bool any_changed = do_update(this, NULL, true, true); + + // Now update all the controls for next time. + ChannelBlend::const_iterator cbi; + for (cbi = _blend.begin(); cbi != _blend.end(); ++cbi) { + AnimControl *control = (*cbi).first; + control->mark_channels(); + } + _anim_changed = false; + + return any_changed; +} + //////////////////////////////////////////////////////////////////// // Function: PartBundle::control_activated diff --git a/panda/src/chan/partBundle.h b/panda/src/chan/partBundle.h index 72a0a93d7d..2d7bcb8b2a 100644 --- a/panda/src/chan/partBundle.h +++ b/panda/src/chan/partBundle.h @@ -125,6 +125,7 @@ public: void advance_time(double time); bool update(); + bool force_update(); virtual void control_activated(AnimControl *control); protected: