Browse Source

more verbose binding

David Rose 23 years ago
parent
commit
50eb99ed62
3 changed files with 43 additions and 4 deletions
  1. 20 4
      panda/src/chan/auto_bind.cxx
  2. 22 0
      panda/src/chan/partBundle.cxx
  3. 1 0
      panda/src/chan/partBundle.h

+ 20 - 4
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";

+ 22 - 0
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

+ 1 - 0
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: