viewer-private#247 Retry loading missing textures for model upload
in case user provided a texture later, after seeing a 'missing texture' error.master
parent
5c9d985b92
commit
2515f422cf
|
|
@ -533,7 +533,7 @@ public:
|
|||
// Inherited from LLCore::HttpHandler
|
||||
virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response);
|
||||
|
||||
LLViewerFetchedTexture* FindViewerTexture(const LLImportMaterial& material);
|
||||
static LLViewerFetchedTexture* FindViewerTexture(const LLImportMaterial& material);
|
||||
|
||||
private:
|
||||
LLHandle<LLWholeModelFeeObserver> mFeeObserverHandle;
|
||||
|
|
|
|||
|
|
@ -543,6 +543,32 @@ void LLModelPreview::rebuildUploadData()
|
|||
}
|
||||
instance.mTransform = mat;
|
||||
mUploadData.push_back(instance);
|
||||
|
||||
// if uploading textures, make sure textures are present
|
||||
if (mFMP->childGetValue("upload_textures").asBoolean()) // too early to cheack if still loading
|
||||
{
|
||||
for (auto& mat_pair : instance.mMaterial)
|
||||
{
|
||||
LLImportMaterial& material = mat_pair.second;
|
||||
|
||||
if (material.mDiffuseMapFilename.size())
|
||||
{
|
||||
LLViewerFetchedTexture* texture = LLMeshUploadThread::FindViewerTexture(material);
|
||||
if (texture && texture->isMissingAsset())
|
||||
{
|
||||
// in case user provided a missing file later
|
||||
texture->setIsMissingAsset(false);
|
||||
texture->setLoadedCallback(LLModelPreview::textureLoadedCallback, 0, true, false, this, NULL, false);
|
||||
texture->forceToSaveRawImage(0, F32_MAX);
|
||||
texture->updateFetch();
|
||||
if (mModelLoader)
|
||||
{
|
||||
mModelLoader->mNumOfFetchingTextures++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue