Panda3D
|
00001 // Filename: config_chan.cxx 00002 // Created by: drose (28Feb00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 00016 #include "config_chan.h" 00017 #include "animBundle.h" 00018 #include "animBundleNode.h" 00019 #include "animChannelBase.h" 00020 #include "animChannelMatrixXfmTable.h" 00021 #include "animChannelMatrixDynamic.h" 00022 #include "animChannelMatrixFixed.h" 00023 #include "animChannelScalarTable.h" 00024 #include "animChannelScalarDynamic.h" 00025 #include "animControl.h" 00026 #include "animGroup.h" 00027 #include "animPreloadTable.h" 00028 #include "bindAnimRequest.h" 00029 #include "movingPartBase.h" 00030 #include "movingPartMatrix.h" 00031 #include "movingPartScalar.h" 00032 #include "partBundle.h" 00033 #include "partBundleNode.h" 00034 #include "partGroup.h" 00035 00036 #include "luse.h" 00037 #include "dconfig.h" 00038 00039 Configure(config_chan); 00040 NotifyCategoryDef(chan, ""); 00041 00042 ConfigVariableBool compress_channels 00043 ("compress-channels", false, 00044 PRC_DESC("Set this true to enable lossy compression of animation channels " 00045 "when writing to the bam file. This serves to reduce the size of " 00046 "the bam file only; it does not reduce the memory footprint of the " 00047 "channels when the bam file is loaded.")); 00048 00049 // There are some special values above 100 which are generally only 00050 // useful for debugging (specifically, to research at what point a 00051 // particular animation artifact is being introduced): 00052 // 00053 // 101 Output numerically lossless data. The output is not run 00054 // through the FFTCompressor. This can be used to check 00055 // whether a particular artifact is due to the FFT conversion 00056 // or not. However, joint angles (HPR) are still converted to 00057 // quaternions and normalized, discarding the fourth 00058 // (redundant) component. 00059 // 00060 // 102 As above, but the fourth quaternion component is preserved. 00061 // 00062 // 103 Quaternions are not used; instead, the HPR values are written 00063 // directly. All output is now completely lossless; if some 00064 // artifacts are being introduced at this point, check your 00065 // sanity. 00066 // 00067 ConfigVariableInt compress_chan_quality 00068 ("compress-chan-quality", 95, 00069 PRC_DESC("The quality level is an integer number that generally ranges " 00070 "between 0 and 100, where smaller numbers indicate greater " 00071 "compression at the cost of quality, and larger numbers indicate " 00072 "higher quality but less compression. Generally, 95 is the highest " 00073 "useful value; values between 95 and 100 produce substantially " 00074 "larger, but not substantially better, output files. This is akin " 00075 "to the JPEG compression level.")); 00076 00077 ConfigVariableBool read_compressed_channels 00078 ("read-compressed-channels", true, 00079 PRC_DESC("Set this false to disable reading of compressed animation channels, " 00080 "even if the decompression code is available. The only reason you " 00081 "might want to do this would be to speed load time when you don't " 00082 "care about what the animation looks like.")); 00083 00084 ConfigVariableBool interpolate_frames 00085 ("interpolate-frames", false, 00086 PRC_DESC("Set this true to interpolate character animations between frames, " 00087 "or false to hold each frame until the next one is ready. This can " 00088 "also be changed on a per-character basis with " 00089 "PartBundle::set_frame_blend_flag().")); 00090 00091 ConfigVariableBool restore_initial_pose 00092 ("restore-initial-pose", true, 00093 PRC_DESC("When this is true, setting all control effects on an Actor to 0 " 00094 "causes it to return to its default, unanimated pose. When " 00095 "false, it retains whatever its last-computed pose was " 00096 "(which may or may not be the default pose).")); 00097 00098 ConfigVariableInt async_bind_priority 00099 ("async-bind-priority", 100, 00100 PRC_DESC("This specifies the priority assign to an asynchronous bind " 00101 "task when it is requested via PartBundle::load_bind_anim(). " 00102 "This controls the relative order in which asynchronous loads " 00103 "happen (in particular, relative to asynchronous texture or " 00104 "model loads). A higher number here makes the animations " 00105 "load sooner.")); 00106 00107 ConfigureFn(config_chan) { 00108 AnimBundle::init_type(); 00109 AnimBundleNode::init_type(); 00110 AnimChannelBase::init_type(); 00111 AnimChannelMatrixXfmTable::init_type(); 00112 AnimChannelMatrixDynamic::init_type(); 00113 AnimChannelMatrixFixed::init_type(); 00114 AnimChannelScalarTable::init_type(); 00115 AnimChannelScalarDynamic::init_type(); 00116 AnimControl::init_type(); 00117 AnimGroup::init_type(); 00118 AnimPreloadTable::init_type(); 00119 BindAnimRequest::init_type(); 00120 MovingPartBase::init_type(); 00121 MovingPartMatrix::init_type(); 00122 MovingPartScalar::init_type(); 00123 PartBundle::init_type(); 00124 PartBundleNode::init_type(); 00125 PartGroup::init_type(); 00126 00127 // This isn't defined in this package, but it *is* essential that it 00128 // be initialized. We have to do it explicitly here since template 00129 // statics don't necessarily resolve very well across dynamic 00130 // libraries. 00131 LMatrix4::init_type(); 00132 00133 //Registration of writeable object's creation 00134 //functions with BamReader's factory 00135 PartGroup::register_with_read_factory(); 00136 PartBundle::register_with_read_factory(); 00137 MovingPartMatrix::register_with_read_factory(); 00138 MovingPartScalar::register_with_read_factory(); 00139 00140 AnimGroup::register_with_read_factory(); 00141 AnimBundle::register_with_read_factory(); 00142 AnimBundleNode::register_with_read_factory(); 00143 AnimChannelMatrixXfmTable::register_with_read_factory(); 00144 AnimChannelMatrixDynamic::register_with_read_factory(); 00145 AnimChannelMatrixFixed::register_with_read_factory(); 00146 AnimChannelScalarTable::register_with_read_factory(); 00147 AnimChannelScalarDynamic::register_with_read_factory(); 00148 AnimPreloadTable::register_with_read_factory(); 00149 } 00150 00151 00152 00153