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