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