Panda3D

config_mayaegg.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_mayaegg.cxx
10 * @author drose
11 * @date 2002-04-15
12 */
13
14 #include "config_mayaegg.h"
15 #include "mayaEggGroupUserData.h"
16 #include "mayaNodeDesc.h"
17 #include "mayaBlendDesc.h"
18 #include "configVariableBool.h"
19
20 #include "dconfig.h"
21
22 Configure(config_mayaegg);
23 NotifyCategoryDef(mayaegg, ":maya");
24
25 ConfigureFn(config_mayaegg) {
26 init_libmayaegg();
27 }
28
29 // These control the default behavior of the mayaegg converter, but not
30 // necessarily the default behavior of the maya2egg command-line tool (which
31 // has its own defaults).
32
33 // Should we respect the Maya double-sided flag (true) or ignore it and assume
34 // everything is single-sided (false)?
35 bool maya_default_double_sided;
36
37 // Should we apply vertex color even when a texture is applied (true) or only
38 // when no texture is applied or the vertex-color egg flag is set (false)?
39 bool maya_default_vertex_color;
40
41 /**
42 * Initializes the library. This must be called at least once before any of
43 * the functions or classes in this library can be used. Normally it will be
44 * called by the static initializers and need not be called explicitly, but
45 * special cases exist.
46 */
47 void
48 init_libmayaegg() {
49 static bool initialized = false;
50 if (initialized) {
51 return;
52 }
53 initialized = true;
54
55 MayaEggGroupUserData::init_type();
56 MayaNodeDesc::init_type();
57 MayaBlendDesc::init_type();
58
59 // For some reason, static init is not reliably running when this is loaded
60 // as a plug-in of a plug-in. Initialize these explicitly here.
61 maya_default_double_sided = ConfigVariableBool("maya-default-double-sided", false).get_value();
62 maya_default_vertex_color = ConfigVariableBool("maya-default-vertex-color", true).get_value();
63
64 }
ConfigVariableBool
This is a convenience class to specialize ConfigVariable as a boolean type.
Definition: configVariableBool.h:23
ConfigVariableBool::get_value
get_value
Returns the variable's value.
Definition: configVariableBool.h:40
configVariableBool.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
init_libmayaegg
void init_libmayaegg()
Initializes the library.
Definition: config_mayaegg.cxx:48
config_mayaegg.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
dconfig.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
mayaBlendDesc.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
mayaEggGroupUserData.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
mayaNodeDesc.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.