diff --git a/panda/src/chan/animChannelMatrixXfmTable.cxx b/panda/src/chan/animChannelMatrixXfmTable.cxx index d34f8e3fec..b0531dc006 100644 --- a/panda/src/chan/animChannelMatrixXfmTable.cxx +++ b/panda/src/chan/animChannelMatrixXfmTable.cxx @@ -308,6 +308,14 @@ fillin(DatagramIterator& scan, BamReader* manager) if (manager->get_file_minor_ver() < 1) { chan_cat.error() << "Cannot read old-style quantized channels.\n"; + clear_all_tables(); + return; + } + + if (!read_compressed) { + chan_cat.info() + << "Not reading compressed animation channels.\n"; + clear_all_tables(); return; } diff --git a/panda/src/chan/config_chan.cxx b/panda/src/chan/config_chan.cxx index 71adcccf3b..15dd4d8faf 100644 --- a/panda/src/chan/config_chan.cxx +++ b/panda/src/chan/config_chan.cxx @@ -56,6 +56,12 @@ bool compress_channels = config_chan.GetBool("compress-channels", false); // int compress_chan_quality = config_chan.GetInt("compress-chan-quality", 95); +// Set this false to disable reading of compressed animation channels, +// even if the decompression code is available. The only reason you +// might want to do this would be to speed load time when you don't +// care about what the animation looks like. +bool read_compressed = config_chan.GetBool("read-compressed", true); + ConfigureFn(config_chan) { AnimBundle::init_type(); AnimBundleNode::init_type(); diff --git a/panda/src/chan/config_chan.h b/panda/src/chan/config_chan.h index 0cbb1b6913..e36f417010 100644 --- a/panda/src/chan/config_chan.h +++ b/panda/src/chan/config_chan.h @@ -14,5 +14,6 @@ NotifyCategoryDecl(chan, EXPCL_PANDA, EXPTP_PANDA); EXPCL_PANDA extern bool compress_channels; EXPCL_PANDA extern int compress_chan_quality; +EXPCL_PANDA extern bool read_compressed; #endif