Panda3D
 All Classes Functions Variables Enumerations
config_chan.cxx
1 // Filename: config_chan.cxx
2 // Created by: drose (28Feb00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 #include "config_chan.h"
17 #include "animBundle.h"
18 #include "animBundleNode.h"
19 #include "animChannelBase.h"
20 #include "animChannelMatrixXfmTable.h"
21 #include "animChannelMatrixDynamic.h"
22 #include "animChannelMatrixFixed.h"
23 #include "animChannelScalarTable.h"
24 #include "animChannelScalarDynamic.h"
25 #include "animControl.h"
26 #include "animGroup.h"
27 #include "animPreloadTable.h"
28 #include "bindAnimRequest.h"
29 #include "movingPartBase.h"
30 #include "movingPartMatrix.h"
31 #include "movingPartScalar.h"
32 #include "partBundle.h"
33 #include "partBundleNode.h"
34 #include "partGroup.h"
35 
36 #include "luse.h"
37 #include "dconfig.h"
38 
39 Configure(config_chan);
40 NotifyCategoryDef(chan, "");
41 
42 ConfigVariableBool compress_channels
43 ("compress-channels", false,
44  PRC_DESC("Set this true to enable lossy compression of animation channels "
45  "when writing to the bam file. This serves to reduce the size of "
46  "the bam file only; it does not reduce the memory footprint of the "
47  "channels when the bam file is loaded."));
48 
49 // There are some special values above 100 which are generally only
50 // useful for debugging (specifically, to research at what point a
51 // particular animation artifact is being introduced):
52 //
53 // 101 Output numerically lossless data. The output is not run
54 // through the FFTCompressor. This can be used to check
55 // whether a particular artifact is due to the FFT conversion
56 // or not. However, joint angles (HPR) are still converted to
57 // quaternions and normalized, discarding the fourth
58 // (redundant) component.
59 //
60 // 102 As above, but the fourth quaternion component is preserved.
61 //
62 // 103 Quaternions are not used; instead, the HPR values are written
63 // directly. All output is now completely lossless; if some
64 // artifacts are being introduced at this point, check your
65 // sanity.
66 //
67 ConfigVariableInt compress_chan_quality
68 ("compress-chan-quality", 95,
69  PRC_DESC("The quality level is an integer number that generally ranges "
70  "between 0 and 100, where smaller numbers indicate greater "
71  "compression at the cost of quality, and larger numbers indicate "
72  "higher quality but less compression. Generally, 95 is the highest "
73  "useful value; values between 95 and 100 produce substantially "
74  "larger, but not substantially better, output files. This is akin "
75  "to the JPEG compression level."));
76 
77 ConfigVariableBool read_compressed_channels
78 ("read-compressed-channels", true,
79 PRC_DESC("Set this false to disable reading of compressed animation channels, "
80  "even if the decompression code is available. The only reason you "
81  "might want to do this would be to speed load time when you don't "
82  "care about what the animation looks like."));
83 
84 ConfigVariableBool interpolate_frames
85 ("interpolate-frames", false,
86 PRC_DESC("Set this true to interpolate character animations between frames, "
87  "or false to hold each frame until the next one is ready. This can "
88  "also be changed on a per-character basis with "
89  "PartBundle::set_frame_blend_flag()."));
90 
91 ConfigVariableBool restore_initial_pose
92 ("restore-initial-pose", true,
93 PRC_DESC("When this is true, setting all control effects on an Actor to 0 "
94  "causes it to return to its default, unanimated pose. When "
95  "false, it retains whatever its last-computed pose was "
96  "(which may or may not be the default pose)."));
97 
98 ConfigVariableInt async_bind_priority
99 ("async-bind-priority", 100,
100 PRC_DESC("This specifies the priority assign to an asynchronous bind "
101  "task when it is requested via PartBundle::load_bind_anim(). "
102  "This controls the relative order in which asynchronous loads "
103  "happen (in particular, relative to asynchronous texture or "
104  "model loads). A higher number here makes the animations "
105  "load sooner."));
106 
107 ConfigureFn(config_chan) {
108  AnimBundle::init_type();
109  AnimBundleNode::init_type();
110  AnimChannelBase::init_type();
111  AnimChannelMatrixXfmTable::init_type();
112  AnimChannelMatrixDynamic::init_type();
113  AnimChannelMatrixFixed::init_type();
114  AnimChannelScalarTable::init_type();
115  AnimChannelScalarDynamic::init_type();
116  AnimControl::init_type();
117  AnimGroup::init_type();
118  AnimPreloadTable::init_type();
119  BindAnimRequest::init_type();
120  MovingPartBase::init_type();
121  MovingPartMatrix::init_type();
122  MovingPartScalar::init_type();
123  PartBundle::init_type();
124  PartBundleNode::init_type();
125  PartGroup::init_type();
126 
127  // This isn't defined in this package, but it *is* essential that it
128  // be initialized. We have to do it explicitly here since template
129  // statics don't necessarily resolve very well across dynamic
130  // libraries.
131  LMatrix4::init_type();
132 
133  //Registration of writeable object's creation
134  //functions with BamReader's factory
139 
149 }
150 
151 
152 
153 
static void register_with_read_factory()
Factory method to generate a MovingPartMatrix object.
static void register_with_read_factory()
Factory method to generate an AnimChannelMatrixDynamic object.
static void register_with_read_factory()
Factory method to generate a AnimGroup object.
Definition: animGroup.cxx:362
This is a convenience class to specialize ConfigVariable as a boolean type.
static void register_with_read_factory()
Factory method to generate a MovingPartScalar object.
static void register_with_read_factory()
Factory method to generate a PartBundle object.
Definition: partBundle.cxx:910
static void register_with_read_factory()
Factory method to generate a AnimChannelScalarTable object.
static void register_with_read_factory()
Tells the BamReader how to create objects of type AnimChannelMatrixFixed.
static void register_with_read_factory()
Factory method to generate a AnimBundle object.
Definition: animBundle.cxx:133
static void register_with_read_factory()
Factory method to generate a AnimChannelScalarDynamic object.
static void register_with_read_factory()
Factory method to generate a PartGroup object.
Definition: partGroup.cxx:790
static void register_with_read_factory()
Factory method to generate an AnimChannelMatrixXfmTable object.
static void register_with_read_factory()
Tells the BamReader how to create objects of type AnimBundleNode.
This is a convenience class to specialize ConfigVariable as an integer type.
static void register_with_read_factory()
Factory method to generate an AnimPreloadTable object.