Skip to content
Snippets Groups Projects
Commit 47ecbca2 authored by David Parks's avatar David Parks
Browse files

SL-17987 Fix for material editor not initializing to GLTF defaults when...

SL-17987 Fix for material editor not initializing to GLTF defaults when loading a null material asset.
parent 2158162b
No related branches found
No related tags found
No related merge requests found
......@@ -1605,6 +1605,7 @@ void LLMaterialEditor::loadAsset()
if (mAssetID.isNull())
{
mAssetStatus = PREVIEW_ASSET_LOADED;
loadDefaults();
setHasUnsavedChanges(false);
}
else
......@@ -1905,3 +1906,9 @@ S32 LLMaterialEditor::saveTextures()
return work_count;
}
void LLMaterialEditor::loadDefaults()
{
tinygltf::Model model_in;
model_in.materials.resize(1);
setFromGltfModel(model_in, true);
}
......@@ -161,6 +161,8 @@ class LLMaterialEditor : public LLPreview, public LLVOInventoryListener
void onCommitEmissiveTexture(LLUICtrl* ctrl, const LLSD& data);
void onCommitNormalTexture(LLUICtrl* ctrl, const LLSD& data);
// initialize the UI from a default GLTF material
void loadDefaults();
private:
friend class LLMaterialFilePicker;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment