From 04f52ccf0aaf9245b38053a22973b3566a3e8d0d Mon Sep 17 00:00:00 2001 From: "Asad M. Zaman" Date: Thu, 29 Jun 2006 21:42:42 +0000 Subject: [PATCH] added the omittex option on mayacopy --- pandatool/src/mayaprogs/mayaCopy.cxx | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/pandatool/src/mayaprogs/mayaCopy.cxx b/pandatool/src/mayaprogs/mayaCopy.cxx index 552c2ee63b..248b2ac4a4 100644 --- a/pandatool/src/mayaprogs/mayaCopy.cxx +++ b/pandatool/src/mayaprogs/mayaCopy.cxx @@ -239,20 +239,22 @@ copy_maya_file(const Filename &source, const Filename &dest, status = MGlobal::executeCommand(MString(_exec_string.c_str())); } - // Get all the shaders so we can determine the set of textures. - _shaders.clear(); - collect_shaders(); - int num_shaders = _shaders.get_num_shaders(); - for (int i = 0; i < num_shaders; i++) { - MayaShader *shader = _shaders.get_shader(i); - for (size_t j = 0; j < shader->_color.size(); j++) { - if (!extract_texture(*shader->get_color_def(j), dir)) { + if (!_omit_tex) { + // Get all the shaders so we can determine the set of textures. + _shaders.clear(); + collect_shaders(); + int num_shaders = _shaders.get_num_shaders(); + for (int i = 0; i < num_shaders; i++) { + MayaShader *shader = _shaders.get_shader(i); + for (size_t j = 0; j < shader->_color.size(); j++) { + if (!extract_texture(*shader->get_color_def(j), dir)) { + return false; + } + } + if (!extract_texture(shader->_transparency, dir)) { return false; } } - if (!extract_texture(shader->_transparency, dir)) { - return false; - } } // Now write out the Maya file.