mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 01:44:06 -04:00
convert .ma to .mb
This commit is contained in:
parent
9fd192e789
commit
cd72a7477f
@ -132,12 +132,19 @@ filter_filename(const string &source) {
|
|||||||
size_t dot = source.rfind('.');
|
size_t dot = source.rfind('.');
|
||||||
size_t underscore = source.rfind("_v", dot);
|
size_t underscore = source.rfind("_v", dot);
|
||||||
|
|
||||||
if (underscore == string::npos) {
|
string extension = source.substr(dot);
|
||||||
// No version number appears to be present.
|
if (extension == ".ma") {
|
||||||
return source;
|
// By convention, we always write out Maya binary files (even if
|
||||||
|
// we receive a Maya ascii file for input).
|
||||||
|
extension = ".mb";
|
||||||
}
|
}
|
||||||
|
|
||||||
return source.substr(0, underscore) + source.substr(dot);
|
if (underscore == string::npos) {
|
||||||
|
// No version number appears to be present.
|
||||||
|
return source.substr(0, dot) + extension;
|
||||||
|
} else {
|
||||||
|
return source.substr(0, underscore) + extension;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -163,8 +170,6 @@ copy_maya_file(const Filename &source, const Filename &dest,
|
|||||||
if (shader->_has_texture) {
|
if (shader->_has_texture) {
|
||||||
Filename texture_filename =
|
Filename texture_filename =
|
||||||
_path_replace->convert_path(shader->_texture);
|
_path_replace->convert_path(shader->_texture);
|
||||||
cerr << "texture " << shader->_name << " is " << shader->_texture << "\n"
|
|
||||||
<< "filename is " << texture_filename << "\n";
|
|
||||||
if (!texture_filename.exists()) {
|
if (!texture_filename.exists()) {
|
||||||
nout << "*** Warning: texture " << texture_filename
|
nout << "*** Warning: texture " << texture_filename
|
||||||
<< " does not exist.\n";
|
<< " does not exist.\n";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user