mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
minor refinements to maya loader
This commit is contained in:
parent
133f94b253
commit
c23f502cd3
@ -141,7 +141,6 @@ read(const Filename &filename) {
|
||||
stat.perror(filename.c_str());
|
||||
return false;
|
||||
}
|
||||
mayaegg_cat.info() << "done.\n";
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -230,7 +230,11 @@ read_surface_shader(MObject shader) {
|
||||
void MayaShader::
|
||||
read_surface_color(MObject color) {
|
||||
if (color.hasFn(MFn::kFileTexture)) {
|
||||
_has_texture = get_string_attribute(color, "fileTextureName", _texture);
|
||||
string filename;
|
||||
_has_texture = get_string_attribute(color, "fileTextureName", filename);
|
||||
if (_has_texture) {
|
||||
_texture = Filename::from_os_specific(filename);
|
||||
}
|
||||
|
||||
get_vec2f_attribute(color, "coverage", _coverage);
|
||||
get_vec2f_attribute(color, "translateFrame", _translate_frame);
|
||||
|
@ -50,7 +50,7 @@ public:
|
||||
double _transparency;
|
||||
|
||||
bool _has_texture;
|
||||
string _texture;
|
||||
Filename _texture;
|
||||
|
||||
LVector2f _coverage;
|
||||
LVector2f _translate_frame;
|
||||
|
@ -164,6 +164,10 @@ convert_file(const Filename &filename) {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
bool MayaToEggConverter::
|
||||
convert_maya() {
|
||||
if (_egg_data->get_coordinate_system() == CS_default) {
|
||||
_egg_data->set_coordinate_system(_maya->get_coordinate_system());
|
||||
}
|
||||
|
||||
MStatus status;
|
||||
|
||||
MItDag dag_iterator(MItDag::kDepthFirst, MFn::kTransform, &status);
|
||||
@ -172,10 +176,8 @@ convert_maya() {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mayaegg_cat.is_debug()) {
|
||||
mayaegg_cat.debug()
|
||||
<< "Traversing scene graph.\n";
|
||||
}
|
||||
mayaegg_cat.info()
|
||||
<< "Converting from Maya.\n";
|
||||
|
||||
// This while loop walks through the entire Maya hierarchy, one node
|
||||
// at a time. Maya's MItDag object automatically performs a
|
||||
@ -197,10 +199,10 @@ convert_maya() {
|
||||
|
||||
if (all_ok) {
|
||||
mayaegg_cat.info()
|
||||
<< "\nDone, no errors.\n";
|
||||
<< "Converted, no errors.\n";
|
||||
} else {
|
||||
mayaegg_cat.info()
|
||||
<< "\nDone, errors encountered.\n";
|
||||
<< "Errors encountered in conversion.\n";
|
||||
}
|
||||
|
||||
return all_ok;
|
||||
|
@ -29,7 +29,6 @@
|
||||
class MayaToEgg : public SomethingToEgg {
|
||||
public:
|
||||
MayaToEgg();
|
||||
~MayaToEgg();
|
||||
|
||||
void run();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user