work around static init failure on windows

This commit is contained in:
David Rose 2003-10-17 22:18:51 +00:00
parent cd45731ce7
commit 61008f86b7
3 changed files with 14 additions and 4 deletions

View File

@ -35,12 +35,12 @@ ConfigureFn(config_mayaegg) {
// Should we respect the Maya double-sided flag (true) or ignore it
// and assume everything is single-sided (false)?
const bool maya_default_double_sided = config_mayaegg.GetBool("maya-default-double-sided", false);
bool maya_default_double_sided;
// Should we apply vertex color even when a texture is applied (true)
// or only when no texture is applied or the vertex-color egg flag is
// set (false)?
const bool maya_default_vertex_color = config_mayaegg.GetBool("maya-default-vertex-color", true);
bool maya_default_vertex_color;
////////////////////////////////////////////////////////////////////
// Function: init_libmayaegg
@ -60,5 +60,12 @@ init_libmayaegg() {
MayaEggGroupUserData::init_type();
MayaNodeDesc::init_type();
// For some reason, static init is not reliably running when this is
// loaded as a plug-in of a plug-in. Initialize these explicitly
// here.
maya_default_double_sided = config_mayaegg.GetBool("maya-default-double-sided", false);
maya_default_vertex_color = config_mayaegg.GetBool("maya-default-vertex-color", true);
}

View File

@ -24,8 +24,8 @@
NotifyCategoryDeclNoExport(mayaegg);
extern const bool maya_default_double_sided;
extern const bool maya_default_vertex_color;
extern bool maya_default_double_sided;
extern bool maya_default_vertex_color;
extern void init_libmayaegg();

View File

@ -84,6 +84,9 @@ MayaToEggConverter::
MayaToEggConverter(const string &program_name) :
_program_name(program_name)
{
// Make sure the library is properly initialized.
init_libmayaegg();
_from_selection = false;
_polygon_output = false;
_polygon_tolerance = 0.01;