mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
maya 4.5
This commit is contained in:
parent
2c0c98394f
commit
d2425ca4f7
@ -27,6 +27,10 @@
|
|||||||
#include <maya/MStatus.h>
|
#include <maya/MStatus.h>
|
||||||
#include "post_maya_include.h"
|
#include "post_maya_include.h"
|
||||||
|
|
||||||
|
#ifdef WIN32_VC
|
||||||
|
#include <direct.h> // for chdir()
|
||||||
|
#endif
|
||||||
|
|
||||||
MayaApi *MayaApi::_global_api = (MayaApi *)NULL;
|
MayaApi *MayaApi::_global_api = (MayaApi *)NULL;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -37,7 +41,19 @@ MayaApi *MayaApi::_global_api = (MayaApi *)NULL;
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
MayaApi::
|
MayaApi::
|
||||||
MayaApi(const string &program_name) {
|
MayaApi(const string &program_name) {
|
||||||
|
// Beginning with Maya4.5, the call to initialize seems to change
|
||||||
|
// the current directory! Yikes!
|
||||||
|
Filename cwd = ExecutionEnvironment::get_cwd();
|
||||||
MStatus stat = MLibrary::initialize((char *)program_name.c_str());
|
MStatus stat = MLibrary::initialize((char *)program_name.c_str());
|
||||||
|
|
||||||
|
// Restore the current directory.
|
||||||
|
string dirname = cwd.to_os_specific();
|
||||||
|
if (chdir(dirname.c_str()) < 0) {
|
||||||
|
maya_cat.warning()
|
||||||
|
<< "Unable to restore current directory to " << cwd
|
||||||
|
<< " after initializing Maya.\n";
|
||||||
|
}
|
||||||
|
|
||||||
if (!stat) {
|
if (!stat) {
|
||||||
stat.perror("MLibrary::initialize");
|
stat.perror("MLibrary::initialize");
|
||||||
_is_valid = false;
|
_is_valid = false;
|
||||||
@ -151,6 +167,7 @@ read(const Filename &filename) {
|
|||||||
MFileIO::newFile(true);
|
MFileIO::newFile(true);
|
||||||
|
|
||||||
maya_cat.info() << "Reading " << filename << "\n";
|
maya_cat.info() << "Reading " << filename << "\n";
|
||||||
|
|
||||||
// Load the file into Maya
|
// Load the file into Maya
|
||||||
string os_filename = filename.to_os_specific();
|
string os_filename = filename.to_os_specific();
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ get_bool_attribute(MObject &node, const string &attribute_name,
|
|||||||
if (!get_maya_attribute(node, attribute_name, value)) {
|
if (!get_maya_attribute(node, attribute_name, value)) {
|
||||||
maya_cat.error()
|
maya_cat.error()
|
||||||
<< "Attribute " << attribute_name
|
<< "Attribute " << attribute_name
|
||||||
<< " does not have an bool value.\n";
|
<< " does not have a bool value.\n";
|
||||||
describe_maya_attribute(node, attribute_name);
|
describe_maya_attribute(node, attribute_name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -267,7 +267,7 @@ set_string_attribute(MObject &node, const string &attribute_name,
|
|||||||
if (!get_maya_attribute(node, attribute_name, string_object)) {
|
if (!get_maya_attribute(node, attribute_name, string_object)) {
|
||||||
maya_cat.error()
|
maya_cat.error()
|
||||||
<< "Attribute " << attribute_name
|
<< "Attribute " << attribute_name
|
||||||
<< " does not have an string object value.\n";
|
<< " does not have a string object value.\n";
|
||||||
describe_maya_attribute(node, attribute_name);
|
describe_maya_attribute(node, attribute_name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -291,7 +291,7 @@ set_string_attribute(MObject &node, const string &attribute_name,
|
|||||||
if (!set_maya_attribute(node, attribute_name, string_object)) {
|
if (!set_maya_attribute(node, attribute_name, string_object)) {
|
||||||
maya_cat.error()
|
maya_cat.error()
|
||||||
<< "Attribute " << attribute_name
|
<< "Attribute " << attribute_name
|
||||||
<< " suddenly does not have an string object value.\n";
|
<< " suddenly does not have a string object value.\n";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user