From 9f9e1d82936f9aed09506e0453ec3adab359fffd Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 30 Sep 2019 14:02:27 +0200 Subject: [PATCH] chan: print out actual anim info when showing AnimBundleNode in ls() This allows one to more easily discover the animations present in a scene graph, such as when using bam-info -ls to inspect a .bam file. --- panda/src/chan/animBundleNode.cxx | 13 +++++++++++++ panda/src/chan/animBundleNode.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/panda/src/chan/animBundleNode.cxx b/panda/src/chan/animBundleNode.cxx index f6fab7a110..7b5286ff82 100644 --- a/panda/src/chan/animBundleNode.cxx +++ b/panda/src/chan/animBundleNode.cxx @@ -68,6 +68,19 @@ find_anim_bundle(PandaNode *root) { return nullptr; } +/** + * + */ +void AnimBundleNode:: +output(std::ostream &out) const { + PandaNode::output(out); + if (_bundle != nullptr) { + out << " ("; + _bundle->output(out); + out << ")"; + } +} + /** * Tells the BamReader how to create objects of type AnimBundleNode. */ diff --git a/panda/src/chan/animBundleNode.h b/panda/src/chan/animBundleNode.h index 6152d37707..2a334036ab 100644 --- a/panda/src/chan/animBundleNode.h +++ b/panda/src/chan/animBundleNode.h @@ -49,6 +49,8 @@ private: PT(AnimBundle) _bundle; public: + virtual void output(std::ostream &out) const; + static void register_with_read_factory(); virtual void write_datagram(BamWriter* manager, Datagram &me); virtual int complete_pointers(TypedWritable **p_list,