Panda3D

config_mayaegg.cxx

00001 // Filename: config_mayaegg.cxx
00002 // Created by:  drose (15Apr02)
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 #include "config_mayaegg.h"
00016 #include "mayaEggGroupUserData.h"
00017 #include "mayaNodeDesc.h"
00018 #include "mayaBlendDesc.h"
00019 #include "configVariableBool.h"
00020 
00021 #include "dconfig.h"
00022 
00023 Configure(config_mayaegg);
00024 NotifyCategoryDef(mayaegg, ":maya");
00025 
00026 ConfigureFn(config_mayaegg) {
00027   init_libmayaegg();
00028 }
00029 
00030 // These control the default behavior of the mayaegg converter, but
00031 // not necessarily the default behavior of the maya2egg command-line
00032 // tool (which has its own defaults).
00033 
00034 // Should we respect the Maya double-sided flag (true) or ignore it
00035 // and assume everything is single-sided (false)?
00036 bool maya_default_double_sided;
00037 
00038 // Should we apply vertex color even when a texture is applied (true)
00039 // or only when no texture is applied or the vertex-color egg flag is
00040 // set (false)?
00041 bool maya_default_vertex_color;
00042 
00043 ////////////////////////////////////////////////////////////////////
00044 //     Function: init_libmayaegg
00045 //  Description: Initializes the library.  This must be called at
00046 //               least once before any of the functions or classes in
00047 //               this library can be used.  Normally it will be
00048 //               called by the static initializers and need not be
00049 //               called explicitly, but special cases exist.
00050 ////////////////////////////////////////////////////////////////////
00051 void
00052 init_libmayaegg() {
00053   static bool initialized = false;
00054   if (initialized) {
00055     return;
00056   }
00057   initialized = true;
00058 
00059   MayaEggGroupUserData::init_type();
00060   MayaNodeDesc::init_type();
00061   MayaBlendDesc::init_type();
00062 
00063   // For some reason, static init is not reliably running when this is
00064   // loaded as a plug-in of a plug-in.  Initialize these explicitly
00065   // here.
00066   maya_default_double_sided = ConfigVariableBool("maya-default-double-sided", false).get_value();
00067   maya_default_vertex_color = ConfigVariableBool("maya-default-vertex-color", true).get_value();
00068 
00069 }
00070 
 All Classes Functions Variables Enumerations