@@ -1976,21 +1976,21 @@ void LLMaterialEditor::loadMaterialFromFile(const std::string& filename, S32 ind
1976
1976
return ;
1977
1977
}
1978
1978
1979
- LLMaterialEditor* me = (LLMaterialEditor*)LLFloaterReg::getInstance (" material_editor" );
1980
-
1981
1979
if (index >= 0 )
1982
1980
{
1983
1981
// Prespecified material
1982
+ LLMaterialEditor* me = (LLMaterialEditor*)LLFloaterReg::getInstance (" material_editor" );
1984
1983
me->loadMaterial (model_in, filename, index);
1985
1984
}
1986
1985
else if (model_in.materials .size () == 1 )
1987
1986
{
1988
- // Only one, just load it
1987
+ // Only one material, just load it
1988
+ LLMaterialEditor* me = (LLMaterialEditor*)LLFloaterReg::getInstance (" material_editor" );
1989
1989
me->loadMaterial (model_in, filename, 0 );
1990
1990
}
1991
1991
else
1992
1992
{
1993
- // Promt user to select material
1993
+ // Multiple materials, Promt user to select material
1994
1994
std::list<std::string> material_list;
1995
1995
std::vector<tinygltf::Material>::const_iterator mat_iter = model_in.materials .begin ();
1996
1996
std::vector<tinygltf::Material>::const_iterator mat_end = model_in.materials .end ();
@@ -2008,15 +2008,19 @@ void LLMaterialEditor::loadMaterialFromFile(const std::string& filename, S32 ind
2008
2008
}
2009
2009
}
2010
2010
2011
- material_list.push_back (me-> getString (" material_batch_import_text" ));
2011
+ material_list.push_back (LLTrans:: getString (" material_batch_import_text" ));
2012
2012
2013
2013
LLFloaterComboOptions::showUI (
2014
- [me, model_in, filename](const std::string& option, S32 index)
2014
+ [model_in, filename](const std::string& option, S32 index)
2015
2015
{
2016
- me->loadMaterial (model_in, filename, index);
2016
+ if (index >= 0 ) // -1 on cancel
2017
+ {
2018
+ LLMaterialEditor* me = (LLMaterialEditor*)LLFloaterReg::getInstance (" material_editor" );
2019
+ me->loadMaterial (model_in, filename, index);
2020
+ }
2017
2021
},
2018
- me-> getString (" material_selection_title" ),
2019
- me-> getString (" material_selection_text" ),
2022
+ LLTrans:: getString (" material_selection_title" ),
2023
+ LLTrans:: getString (" material_selection_text" ),
2020
2024
material_list
2021
2025
);
2022
2026
}
0 commit comments