SL-18396 PBR and blinn phong should not be allowed to be edited together
parent
119b02937e
commit
5e344813dc
|
|
@ -1000,7 +1000,8 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
|
|||
BOOL editable = objectp->permModify() && !objectp->isPermanentEnforced();
|
||||
|
||||
bool has_pbr_material;
|
||||
updateUIGLTF(objectp, has_pbr_material, force_set_values);
|
||||
bool has_faces_without_pbr;
|
||||
updateUIGLTF(objectp, has_pbr_material, has_faces_without_pbr, force_set_values);
|
||||
|
||||
const bool has_material = !has_pbr_material;
|
||||
|
||||
|
|
@ -1536,7 +1537,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
|
|||
getChild<LLUICtrl>("checkbox fullbright")->setValue((S32)(fullbright_flag != 0));
|
||||
getChildView("checkbox fullbright")->setEnabled(editable && !has_pbr_material);
|
||||
getChild<LLUICtrl>("checkbox fullbright")->setTentative(!identical_fullbright);
|
||||
getChild<LLComboBox>("combobox matmedia")->setEnabledByValue("Materials", !has_pbr_material);
|
||||
mComboMatMedia->setEnabledByValue("Materials", !has_pbr_material);
|
||||
}
|
||||
|
||||
// Repeats per meter
|
||||
|
|
@ -1800,7 +1801,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
|
|||
}
|
||||
}
|
||||
|
||||
void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material, bool force_set_values)
|
||||
void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material, bool& has_faces_without_pbr, bool force_set_values)
|
||||
{
|
||||
has_pbr_material = false;
|
||||
|
||||
|
|
@ -1813,9 +1814,7 @@ void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material,
|
|||
{
|
||||
LLUUID pbr_id;
|
||||
bool identical_pbr;
|
||||
LLSelectedTE::getPbrMaterialId(pbr_id, identical_pbr);
|
||||
|
||||
has_pbr_material = pbr_id.notNull();
|
||||
LLSelectedTE::getPbrMaterialId(pbr_id, identical_pbr, has_pbr_material, has_faces_without_pbr);
|
||||
|
||||
pbr_ctrl->setTentative(identical_pbr ? FALSE : TRUE);
|
||||
pbr_ctrl->setEnabled(editable && has_pbr_capabilities);
|
||||
|
|
@ -1823,13 +1822,13 @@ void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material,
|
|||
}
|
||||
|
||||
getChildView("pbr_from_inventory")->setEnabled(editable && has_pbr_capabilities);
|
||||
getChildView("edit_selected_pbr")->setEnabled(editable && has_pbr_material && has_pbr_capabilities);
|
||||
getChildView("save_selected_pbr")->setEnabled(objectp->permCopy() && has_pbr_material && has_pbr_capabilities);
|
||||
getChildView("edit_selected_pbr")->setEnabled(editable && has_pbr_material && !has_faces_without_pbr && has_pbr_capabilities);
|
||||
getChildView("save_selected_pbr")->setEnabled(objectp->permCopy() && has_pbr_material && !has_faces_without_pbr && has_pbr_capabilities);
|
||||
|
||||
const bool show_pbr = mComboMatMedia->getCurrentIndex() == MATMEDIA_PBR && mComboMatMedia->getEnabled();
|
||||
if (show_pbr)
|
||||
{
|
||||
const bool new_state = has_pbr_capabilities && has_pbr_material;
|
||||
const bool new_state = has_pbr_capabilities && has_pbr_material && !has_faces_without_pbr;
|
||||
|
||||
LLUICtrl* gltfCtrlTextureScaleU = getChild<LLUICtrl>("gltfTextureScaleU");
|
||||
LLUICtrl* gltfCtrlTextureScaleV = getChild<LLUICtrl>("gltfTextureScaleV");
|
||||
|
|
@ -5057,16 +5056,34 @@ void LLPanelFace::LLSelectedTE::getTexId(LLUUID& id, bool& identical)
|
|||
identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, id );
|
||||
}
|
||||
|
||||
void LLPanelFace::LLSelectedTE::getPbrMaterialId(LLUUID& id, bool& identical)
|
||||
void LLPanelFace::LLSelectedTE::getPbrMaterialId(LLUUID& id, bool& identical, bool& has_faces_with_pbr, bool& has_faces_without_pbr)
|
||||
{
|
||||
struct LLSelectedTEGetmatId : public LLSelectedTEGetFunctor<LLUUID>
|
||||
{
|
||||
LLSelectedTEGetmatId()
|
||||
: mHasFacesWithoutPBR(false)
|
||||
, mHasFacesWithPBR(false)
|
||||
{
|
||||
}
|
||||
LLUUID get(LLViewerObject* object, S32 te_index)
|
||||
{
|
||||
return object->getRenderMaterialID(te_index);
|
||||
LLUUID pbr_id = object->getRenderMaterialID(te_index);
|
||||
if (pbr_id.isNull())
|
||||
{
|
||||
mHasFacesWithoutPBR = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
mHasFacesWithPBR = true;
|
||||
}
|
||||
return pbr_id;
|
||||
}
|
||||
bool mHasFacesWithoutPBR;
|
||||
bool mHasFacesWithPBR;
|
||||
} func;
|
||||
identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue(&func, id);
|
||||
has_faces_with_pbr = func.mHasFacesWithPBR;
|
||||
has_faces_without_pbr = func.mHasFacesWithoutPBR;
|
||||
}
|
||||
|
||||
void LLPanelFace::LLSelectedTEMaterial::getCurrent(LLMaterialPtr& material_ptr, bool& identical_material)
|
||||
|
|
|
|||
|
|
@ -452,7 +452,7 @@ private:
|
|||
void onTextureSelectionChanged(LLInventoryItem* itemp);
|
||||
void onPbrSelectionChanged(LLInventoryItem* itemp);
|
||||
|
||||
void updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material, bool force_set_values);
|
||||
void updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material, bool& has_faces_without_pbr, bool force_set_values);
|
||||
void updateVisibilityGLTF();
|
||||
|
||||
void updateSelectedGLTFMaterials(std::function<void(LLGLTFMaterial*)> func);
|
||||
|
|
@ -595,7 +595,7 @@ public:
|
|||
static void getFace(class LLFace*& face_to_return, bool& identical_face);
|
||||
static void getImageFormat(LLGLenum& image_format_to_return, bool& identical_face);
|
||||
static void getTexId(LLUUID& id, bool& identical);
|
||||
static void getPbrMaterialId(LLUUID& id, bool& identical);
|
||||
static void getPbrMaterialId(LLUUID& id, bool& identical, bool& has_pbr, bool& has_faces_without_pbr);
|
||||
static void getObjectScaleS(F32& scale_s, bool& identical);
|
||||
static void getObjectScaleT(F32& scale_t, bool& identical);
|
||||
static void getMaxDiffuseRepeats(F32& repeats, bool& identical);
|
||||
|
|
|
|||
|
|
@ -2800,7 +2800,12 @@ bool enable_object_inspect()
|
|||
|
||||
struct LLSelectedTEGetmatIdAndPermissions : public LLSelectedTEFunctor
|
||||
{
|
||||
LLSelectedTEGetmatIdAndPermissions() : mCanCopy(true), mCanModify(true), mCanTransfer(true) {}
|
||||
LLSelectedTEGetmatIdAndPermissions()
|
||||
: mCanCopy(true)
|
||||
, mCanModify(true)
|
||||
, mCanTransfer(true)
|
||||
, mHasNonPbrFaces(false)
|
||||
{}
|
||||
bool apply(LLViewerObject* objectp, S32 te_index)
|
||||
{
|
||||
mCanCopy &= (bool)objectp->permCopy();
|
||||
|
|
@ -2811,11 +2816,16 @@ struct LLSelectedTEGetmatIdAndPermissions : public LLSelectedTEFunctor
|
|||
{
|
||||
mMaterialId = mat_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
mHasNonPbrFaces = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
bool mCanCopy;
|
||||
bool mCanModify;
|
||||
bool mCanTransfer;
|
||||
bool mHasNonPbrFaces;
|
||||
LLUUID mMaterialId;
|
||||
};
|
||||
|
||||
|
|
@ -2828,7 +2838,7 @@ bool enable_object_edit_gltf_material()
|
|||
|
||||
LLSelectedTEGetmatIdAndPermissions func;
|
||||
LLSelectMgr::getInstance()->getSelection()->applyToTEs(&func);
|
||||
return func.mCanModify && func.mMaterialId.notNull();
|
||||
return func.mCanModify && !func.mHasNonPbrFaces;
|
||||
}
|
||||
|
||||
bool enable_object_open()
|
||||
|
|
|
|||
Loading…
Reference in New Issue