mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
has_texture is no longer filled in reliably
This commit is contained in:
parent
0245552aa1
commit
70572c0c11
@ -308,31 +308,29 @@ copy_maya_file(const Filename &source, const Filename &dest,
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
bool MayaCopy::
|
bool MayaCopy::
|
||||||
extract_texture(MayaShaderColorDef &color_def, CVSSourceDirectory *dir) {
|
extract_texture(MayaShaderColorDef &color_def, CVSSourceDirectory *dir) {
|
||||||
if (color_def._has_texture) {
|
Filename texture_filename =
|
||||||
Filename texture_filename =
|
_path_replace->convert_path(color_def._texture_filename);
|
||||||
_path_replace->convert_path(color_def._texture_filename);
|
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";
|
} else if (!texture_filename.is_regular_file()) {
|
||||||
} else if (!texture_filename.is_regular_file()) {
|
nout << "*** Warning: texture " << texture_filename
|
||||||
nout << "*** Warning: texture " << texture_filename
|
<< " is not a regular file.\n";
|
||||||
<< " is not a regular file.\n";
|
} else {
|
||||||
} else {
|
ExtraData ed;
|
||||||
ExtraData ed;
|
ed._type = FT_texture;
|
||||||
ed._type = FT_texture;
|
|
||||||
|
CVSSourceTree::FilePath texture_path =
|
||||||
CVSSourceTree::FilePath texture_path =
|
import(texture_filename, &ed, _map_dir);
|
||||||
import(texture_filename, &ed, _map_dir);
|
|
||||||
|
if (!texture_path.is_valid()) {
|
||||||
if (!texture_path.is_valid()) {
|
return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update the texture reference to point to the new texture
|
|
||||||
// filename, relative to the maya file.
|
|
||||||
Filename new_filename = texture_path.get_rel_from(dir);
|
|
||||||
color_def.reset_maya_texture(new_filename);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update the texture reference to point to the new texture
|
||||||
|
// filename, relative to the maya file.
|
||||||
|
Filename new_filename = texture_path.get_rel_from(dir);
|
||||||
|
color_def.reset_maya_texture(new_filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user