diff options
| author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2016-08-17 16:31:28 -0400 |
|---|---|---|
| committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2016-08-17 16:31:28 -0400 |
| commit | 72d5ff36f56c4afee85f5863f64f237980341014 (patch) | |
| tree | 3afd0fa622ad507e087d7b5b2d6724a71119cbec /indra/llprimitive/llmodelloader.cpp | |
| parent | 9044a8b8156e5812f99c39d35be096a35df8f6d0 (diff) | |
MAINT-6647 - ignore previously created slm files on model upload. SL-442 - change coloring for show bones, to highlight joint positions and rigging
Diffstat (limited to 'indra/llprimitive/llmodelloader.cpp')
| -rw-r--r-- | indra/llprimitive/llmodelloader.cpp | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/indra/llprimitive/llmodelloader.cpp b/indra/llprimitive/llmodelloader.cpp index 816ebc558a..4e468ff45f 100644 --- a/indra/llprimitive/llmodelloader.cpp +++ b/indra/llprimitive/llmodelloader.cpp @@ -150,6 +150,23 @@ void LLModelLoader::run() doOnIdleOneTime(boost::bind(&LLModelLoader::loadModelCallback,this)); } +// static +bool LLModelLoader::getSLMFilename(const std::string& model_filename, std::string& slm_filename) +{ + slm_filename = model_filename; + + std::string::size_type i = model_filename.rfind("."); + if (i != std::string::npos) + { + slm_filename.replace(i, model_filename.size()-1, ".slm"); + return true; + } + else + { + return false; + } +} + bool LLModelLoader::doLoadModel() { //first, look for a .slm file of the same name that was modified later @@ -157,20 +174,17 @@ bool LLModelLoader::doLoadModel() if (mTrySLM) { - std::string filename = mFilename; - - std::string::size_type i = filename.rfind("."); - if (i != std::string::npos) - { - filename.replace(i, filename.size()-1, ".slm"); + std::string slm_filename; + if (getSLMFilename(mFilename, slm_filename)) + { llstat slm_status; - if (LLFile::stat(filename, &slm_status) == 0) + if (LLFile::stat(slm_filename, &slm_status) == 0) { //slm file exists llstat dae_status; if (LLFile::stat(mFilename, &dae_status) != 0 || dae_status.st_mtime < slm_status.st_mtime) { - if (loadFromSLM(filename)) + if (loadFromSLM(slm_filename)) { //slm successfully loaded, if this fails, fall through and //try loading from dae |
