summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-11-16 16:07:58 -0600
committerDave Parks <davep@lindenlab.com>2022-11-16 16:07:58 -0600
commitd5395502525ad3ebcfa2b75be23544d022b18dbc (patch)
tree532311803cc838bcc234f0eaa0212d6281d4df0f
parentbc4694e82a5fa7aaafe77e9e3cb84f5b781e741a (diff)
parent6387fbb378ff3ec5a8cf1e217eb4f2d71134c180 (diff)
Merge branch 'DRTVWR-559' of ssh://bitbucket.org/lindenlab/viewer into DRTVWR-559
-rw-r--r--indra/newview/llmaterialeditor.cpp14
-rw-r--r--indra/newview/llpanelface.cpp255
-rw-r--r--indra/newview/llpanelface.h10
-rw-r--r--indra/newview/lltexturectrl.cpp56
-rw-r--r--indra/newview/skins/default/xui/en/floater_texture_ctrl.xml10
-rw-r--r--indra/newview/skins/default/xui/en/panel_tools_texture.xml24
6 files changed, 304 insertions, 65 deletions
diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp
index a9728e26da..d5948b297c 100644
--- a/indra/newview/llmaterialeditor.cpp
+++ b/indra/newview/llmaterialeditor.cpp
@@ -378,6 +378,20 @@ BOOL LLMaterialEditor::postBuild()
mBaseColorCtrl = getChild<LLColorSwatchCtrl>("base color");
mEmissiveColorCtrl = getChild<LLColorSwatchCtrl>("emissive color");
+ if (!gAgent.isGodlike())
+ {
+ // Only allow fully permissive textures
+ mBaseColorTextureCtrl->setImmediateFilterPermMask(PERM_ITEM_UNRESTRICTED);
+ mBaseColorTextureCtrl->setNonImmediateFilterPermMask(PERM_ITEM_UNRESTRICTED);
+ mMetallicTextureCtrl->setImmediateFilterPermMask(PERM_ITEM_UNRESTRICTED);
+ mMetallicTextureCtrl->setNonImmediateFilterPermMask(PERM_ITEM_UNRESTRICTED);
+ mEmissiveTextureCtrl->setImmediateFilterPermMask(PERM_ITEM_UNRESTRICTED);
+ mEmissiveTextureCtrl->setNonImmediateFilterPermMask(PERM_ITEM_UNRESTRICTED);
+ mNormalTextureCtrl->setImmediateFilterPermMask(PERM_ITEM_UNRESTRICTED);
+ mNormalTextureCtrl->setNonImmediateFilterPermMask(PERM_ITEM_UNRESTRICTED);
+ }
+
+ // Texture callback
mBaseColorTextureCtrl->setCommitCallback(boost::bind(&LLMaterialEditor::onCommitTexture, this, _1, _2, MATERIAL_BASE_COLOR_TEX_DIRTY));
mMetallicTextureCtrl->setCommitCallback(boost::bind(&LLMaterialEditor::onCommitTexture, this, _1, _2, MATERIAL_METALLIC_ROUGHTNESS_TEX_DIRTY));
mEmissiveTextureCtrl->setCommitCallback(boost::bind(&LLMaterialEditor::onCommitTexture, this, _1, _2, MATERIAL_EMISIVE_TEX_DIRTY));
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index 9d720b1523..d620704019 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -114,6 +114,73 @@ const S32 PBRTYPE_NORMAL = 2; // PBR Normal
const S32 PBRTYPE_METALLIC_ROUGHNESS = 3; // PBR Metallic
const S32 PBRTYPE_EMISSIVE = 4; // PBR Emissive
+LLGLTFMaterial::TextureInfo texture_info_from_pbrtype(S32 pbr_type)
+{
+ switch (pbr_type)
+ {
+ case PBRTYPE_BASE_COLOR:
+ return LLGLTFMaterial::GLTF_TEXTURE_INFO_BASE_COLOR;
+ break;
+ case PBRTYPE_NORMAL:
+ return LLGLTFMaterial::GLTF_TEXTURE_INFO_NORMAL;
+ break;
+ case PBRTYPE_METALLIC_ROUGHNESS:
+ return LLGLTFMaterial::GLTF_TEXTURE_INFO_METALLIC_ROUGHNESS;
+ break;
+ case PBRTYPE_EMISSIVE:
+ return LLGLTFMaterial::GLTF_TEXTURE_INFO_EMISSIVE;
+ break;
+ default:
+ return LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT;
+ break;
+ }
+}
+
+void updateSelectedGLTFMaterials(std::function<void(LLGLTFMaterial*)> func)
+{
+ struct LLSelectedTEGLTFMaterialFunctor : public LLSelectedTEFunctor
+ {
+ LLSelectedTEGLTFMaterialFunctor(std::function<void(LLGLTFMaterial*)> func) : mFunc(func) {}
+ virtual ~LLSelectedTEGLTFMaterialFunctor() {};
+ bool apply(LLViewerObject* object, S32 face) override
+ {
+ LLGLTFMaterial new_override;
+ const LLTextureEntry* tep = object->getTE(face);
+ if (tep->getGLTFMaterialOverride())
+ {
+ new_override = *tep->getGLTFMaterialOverride();
+ }
+ mFunc(&new_override);
+ LLGLTFMaterialList::queueModify(object->getID(), face, &new_override);
+
+ return true;
+ }
+
+ std::function<void(LLGLTFMaterial*)> mFunc;
+ } select_func(func);
+ LLSelectMgr::getInstance()->getSelection()->applyToTEs(&select_func);
+}
+
+template<typename T>
+void readSelectedGLTFMaterial(std::function<T(const LLGLTFMaterial*)> func, T& value, bool& identical, bool has_tolerance, T tolerance)
+{
+ struct LLSelectedTEGetGLTFMaterialFunctor : public LLSelectedTEGetFunctor<T>
+ {
+ LLSelectedTEGetGLTFMaterialFunctor(std::function<T(const LLGLTFMaterial*)> func) : mFunc(func) {}
+ virtual ~LLSelectedTEGetGLTFMaterialFunctor() {};
+ T get(LLViewerObject* object, S32 face) override
+ {
+ const LLTextureEntry* tep = object->getTE(face);
+ const LLGLTFMaterial* render_material = tep->getGLTFRenderMaterial();
+
+ return mFunc(render_material);
+ }
+
+ std::function<T(const LLGLTFMaterial*)> mFunc;
+ } select_func(func);
+ identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue(&select_func, value, has_tolerance, tolerance);
+}
+
BOOST_STATIC_ASSERT(MATTYPE_DIFFUSE == LLRender::DIFFUSE_MAP && MATTYPE_NORMAL == LLRender::NORMAL_MAP && MATTYPE_SPECULAR == LLRender::SPECULAR_MAP);
//
@@ -201,11 +268,11 @@ BOOL LLPanelFace::postBuild()
childSetCommitCallback("add_media", &LLPanelFace::onClickBtnAddMedia, this);
childSetCommitCallback("delete_media", &LLPanelFace::onClickBtnDeleteMedia, this);
- childSetCommitCallback("gltfTextureScaleU", &LLPanelFace::onCommitGLTFTextureScaleU, this);
- childSetCommitCallback("gltfTextureScaleV", &LLPanelFace::onCommitGLTFTextureScaleV, this);
- childSetCommitCallback("gltfRotation", &LLPanelFace::onCommitGLTFRotation, this);
- childSetCommitCallback("gltfTextureTranslationU", &LLPanelFace::onCommitGLTFTextureTranslationU, this);
- childSetCommitCallback("gltfTextureTranslationV", &LLPanelFace::onCommitGLTFTextureTranslationV, this);
+ childSetCommitCallback("gltfTextureScaleU", boost::bind(&LLPanelFace::onCommitGLTFTextureScaleU, this, _1), nullptr);
+ childSetCommitCallback("gltfTextureScaleV", boost::bind(&LLPanelFace::onCommitGLTFTextureScaleV, this, _1), nullptr);
+ childSetCommitCallback("gltfTextureRotation", boost::bind(&LLPanelFace::onCommitGLTFRotation, this, _1), nullptr);
+ childSetCommitCallback("gltfTextureOffsetU", boost::bind(&LLPanelFace::onCommitGLTFTextureOffsetU, this, _1), nullptr);
+ childSetCommitCallback("gltfTextureOffsetV", boost::bind(&LLPanelFace::onCommitGLTFTextureOffsetV, this, _1), nullptr);
childSetAction("button align",&LLPanelFace::onClickAutoFix,this);
childSetAction("button align textures", &LLPanelFace::onAlignTexture, this);
@@ -936,6 +1003,8 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
radio_pbr_type->selectNthItem(PBRTYPE_RENDER_MATERIAL_ID);
}
radio_pbr_type->setEnabled(editable);
+ const bool pbr_selected = mComboMatMedia->getCurrentIndex() == MATMEDIA_PBR;
+ const bool texture_info_selected = pbr_selected && radio_pbr_type->getSelectedIndex() != PBRTYPE_RENDER_MATERIAL_ID;
getChildView("checkbox_sync_settings")->setEnabled(editable);
childSetValue("checkbox_sync_settings", gSavedSettings.getBOOL("SyncMaterialSettings"));
@@ -1184,9 +1253,9 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
LLCheckBoxCtrl* cb_planar_align = getChild<LLCheckBoxCtrl>("checkbox planar align");
align_planar = (cb_planar_align && cb_planar_align->get());
- bool enabled = (editable && isIdenticalPlanarTexgen());
+ bool enabled = (editable && isIdenticalPlanarTexgen() && (!pbr_selected || texture_info_selected));
childSetValue("checkbox planar align", align_planar && enabled);
- childSetVisible("checkbox planar align", enabled);
+ childSetVisible("checkbox planar align", enabled);
childSetEnabled("checkbox planar align", enabled);
childSetEnabled("button align textures", enabled && LLSelectMgr::getInstance()->getSelection()->getObjectCount() > 1);
@@ -1722,6 +1791,70 @@ void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material,
getChildView("pbr_from_inventory")->setEnabled(editable);
getChildView("edit_selected_pbr")->setEnabled(editable && has_pbr_material);
getChildView("save_selected_pbr")->setEnabled(objectp->permCopy() && has_pbr_material);
+
+ const bool show_pbr = mComboMatMedia->getCurrentIndex() == MATMEDIA_PBR && mComboMatMedia->getEnabled();
+ if (show_pbr)
+ {
+
+ const U32 pbr_type = findChild<LLRadioGroup>("radio_pbr_type")->getSelectedIndex();
+ const LLGLTFMaterial::TextureInfo texture_info = texture_info_from_pbrtype(pbr_type);
+ const bool show_texture_info = texture_info != LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT;
+
+ LLUICtrl* gltfCtrlTextureScaleU = getChild<LLUICtrl>("gltfTextureScaleU");
+ LLUICtrl* gltfCtrlTextureScaleV = getChild<LLUICtrl>("gltfTextureScaleV");
+ LLUICtrl* gltfCtrlTextureRotation = getChild<LLUICtrl>("gltfTextureRotation");
+ LLUICtrl* gltfCtrlTextureOffsetU = getChild<LLUICtrl>("gltfTextureOffsetU");
+ LLUICtrl* gltfCtrlTextureOffsetV = getChild<LLUICtrl>("gltfTextureOffsetV");
+
+ gltfCtrlTextureScaleU->setEnabled(show_texture_info);
+ gltfCtrlTextureScaleV->setEnabled(show_texture_info);
+ gltfCtrlTextureRotation->setEnabled(show_texture_info);
+ gltfCtrlTextureOffsetU->setEnabled(show_texture_info);
+ gltfCtrlTextureOffsetV->setEnabled(show_texture_info);
+
+ if (show_texture_info)
+ {
+ LLGLTFMaterial::TextureTransform transform;
+ bool scale_u_same = true;
+ bool scale_v_same = true;
+ bool rotation_same = true;
+ bool offset_u_same = true;
+ bool offset_v_same = true;
+
+ readSelectedGLTFMaterial<float>([&](const LLGLTFMaterial* mat)
+ {
+ return mat->mTextureTransform[texture_info].mScale[VX];
+ }, transform.mScale[VX], scale_u_same, true, 1e-3f);
+ readSelectedGLTFMaterial<float>([&](const LLGLTFMaterial* mat)
+ {
+ return mat->mTextureTransform[texture_info].mScale[VY];
+ }, transform.mScale[VY], scale_v_same, true, 1e-3f);
+ readSelectedGLTFMaterial<float>([&](const LLGLTFMaterial* mat)
+ {
+ return mat->mTextureTransform[texture_info].mRotation;
+ }, transform.mRotation, rotation_same, true, 1e-3f);
+ readSelectedGLTFMaterial<float>([&](const LLGLTFMaterial* mat)
+ {
+ return mat->mTextureTransform[texture_info].mOffset[VX];
+ }, transform.mOffset[VX], offset_u_same, true, 1e-3f);
+ readSelectedGLTFMaterial<float>([&](const LLGLTFMaterial* mat)
+ {
+ return mat->mTextureTransform[texture_info].mOffset[VY];
+ }, transform.mOffset[VY], offset_v_same, true, 1e-3f);
+
+ gltfCtrlTextureScaleU->setValue(transform.mScale[VX]);
+ gltfCtrlTextureScaleV->setValue(transform.mScale[VY]);
+ gltfCtrlTextureRotation->setValue(transform.mRotation * RAD_TO_DEG);
+ gltfCtrlTextureOffsetU->setValue(transform.mOffset[VX]);
+ gltfCtrlTextureOffsetV->setValue(transform.mOffset[VY]);
+
+ gltfCtrlTextureScaleU->setTentative(!scale_u_same);
+ gltfCtrlTextureScaleV->setTentative(!scale_v_same);
+ gltfCtrlTextureRotation->setTentative(!rotation_same);
+ gltfCtrlTextureOffsetU->setTentative(!offset_u_same);
+ gltfCtrlTextureOffsetV->setTentative(!offset_v_same);
+ }
+ }
}
void LLPanelFace::updateVisibilityGLTF()
@@ -1748,8 +1881,8 @@ void LLPanelFace::updateVisibilityGLTF()
getChildView("gltfTextureScaleU")->setVisible(show_pbr_transform);
getChildView("gltfTextureScaleV")->setVisible(show_pbr_transform);
getChildView("gltfTextureRotation")->setVisible(show_pbr_transform);
- getChildView("gltfTextureTranslationU")->setVisible(show_pbr_transform);
- getChildView("gltfTextureTranslationV")->setVisible(show_pbr_transform);
+ getChildView("gltfTextureOffsetU")->setVisible(show_pbr_transform);
+ getChildView("gltfTextureOffsetV")->setVisible(show_pbr_transform);
}
void LLPanelFace::updateCopyTexButton()
@@ -2597,13 +2730,17 @@ void LLPanelFace::updateVisibility()
bool show_texture = (show_media || (show_material && (material_type == MATTYPE_DIFFUSE) && mComboMatMedia->getEnabled()));
bool show_bumpiness = show_material && (material_type == MATTYPE_NORMAL) && mComboMatMedia->getEnabled();
bool show_shininess = show_material && (material_type == MATTYPE_SPECULAR) && mComboMatMedia->getEnabled();
+ const bool show_pbr = mComboMatMedia->getCurrentIndex() == MATMEDIA_PBR && mComboMatMedia->getEnabled();
+ const U32 pbr_type = findChild<LLRadioGroup>("radio_pbr_type")->getSelectedIndex();
+ const LLGLTFMaterial::TextureInfo texture_info = texture_info_from_pbrtype(pbr_type);
+ const bool show_texture_info = show_pbr && texture_info != LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT;
radio_mat_type->setVisible(show_material);
// Shared material controls
- getChildView("checkbox_sync_settings")->setVisible(show_material || show_media);
- getChildView("tex gen")->setVisible(show_material || show_media);
- getChildView("combobox texgen")->setVisible(show_material || show_media);
+ getChildView("checkbox_sync_settings")->setVisible(show_material || show_media || show_texture_info);
+ getChildView("tex gen")->setVisible(show_material || show_media || show_texture_info);
+ getChildView("combobox texgen")->setVisible(show_material || show_media || show_texture_info);
getChildView("button align textures")->setVisible(show_material || show_media);
// Media controls
@@ -4538,54 +4675,78 @@ void LLPanelFace::onCommitPlanarAlign(LLUICtrl* ctrl, void* userdata)
self->sendTextureInfo();
}
-// static
-void LLPanelFace::onCommitGLTFTextureScaleU(LLUICtrl* ctrl, void* userdata)
+void updateGLTFTextureTransform(float value, U32 pbr_type, std::function<void(LLGLTFMaterial::TextureTransform*)> edit)
{
-#if 0
- LLPanelFace* self = (LLPanelFace*)userdata;
- LL_WARNS() << ctrl->getValue().asReal() << LL_ENDL; // TODO: Remove
- // TODO
-#endif
+ U32 texture_info_start;
+ U32 texture_info_end;
+ if (gSavedSettings.getBOOL("SyncMaterialSettings"))
+ {
+ texture_info_start = 0;
+ texture_info_end = LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT;
+ }
+ else
+ {
+ texture_info_start = texture_info_from_pbrtype(pbr_type);
+ texture_info_end = texture_info_start + 1;
+ }
+ updateSelectedGLTFMaterials([&](LLGLTFMaterial* new_override)
+ {
+ for (U32 ti = texture_info_start; ti < texture_info_end; ++ti)
+ {
+ LLGLTFMaterial::TextureTransform& new_transform = new_override->mTextureTransform[(LLGLTFMaterial::TextureInfo)ti];
+ edit(&new_transform);
+ }
+ });
}
-// static
-void LLPanelFace::onCommitGLTFTextureScaleV(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitGLTFTextureScaleU(LLUICtrl* ctrl)
{
-#if 0
- LLPanelFace* self = (LLPanelFace*)userdata;
- LL_WARNS() << ctrl->getValue().asReal() << LL_ENDL; // TODO: Remove
- // TODO
-#endif
+ const float value = ctrl->getValue().asReal();
+ const U32 pbr_type = findChild<LLRadioGroup>("radio_pbr_type")->getSelectedIndex();
+ updateGLTFTextureTransform(value, pbr_type, [&](LLGLTFMaterial::TextureTransform* new_transform)
+ {
+ new_transform->mScale.mV[VX] = value;
+ });
}
-// static
-void LLPanelFace::onCommitGLTFRotation(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitGLTFTextureScaleV(LLUICtrl* ctrl)
+{
+ const float value = ctrl->getValue().asReal();
+ const U32 pbr_type = findChild<LLRadioGroup>("radio_pbr_type")->getSelectedIndex();
+ updateGLTFTextureTransform(value, pbr_type, [&](LLGLTFMaterial::TextureTransform* new_transform)
+ {
+ new_transform->mScale.mV[VY] = value;
+ });
+}
+
+void LLPanelFace::onCommitGLTFRotation(LLUICtrl* ctrl)
{
-#if 0
- LLPanelFace* self = (LLPanelFace*)userdata;
- LL_WARNS() << ctrl->getValue().asReal() << LL_ENDL; // TODO: Remove
- // TODO
-#endif
+ const float value = ctrl->getValue().asReal() * DEG_TO_RAD;
+ const U32 pbr_type = findChild<LLRadioGroup>("radio_pbr_type")->getSelectedIndex();
+ updateGLTFTextureTransform(value, pbr_type, [&](LLGLTFMaterial::TextureTransform* new_transform)
+ {
+ new_transform->mRotation = value;
+ });
}
-// static
-void LLPanelFace::onCommitGLTFTextureTranslationU(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitGLTFTextureOffsetU(LLUICtrl* ctrl)
{
-#if 0
- LLPanelFace* self = (LLPanelFace*)userdata;
- LL_WARNS() << ctrl->getValue().asReal() << LL_ENDL; // TODO: Remove
- // TODO
-#endif
+ const float value = ctrl->getValue().asReal();
+ const U32 pbr_type = findChild<LLRadioGroup>("radio_pbr_type")->getSelectedIndex();
+ updateGLTFTextureTransform(value, pbr_type, [&](LLGLTFMaterial::TextureTransform* new_transform)
+ {
+ new_transform->mOffset.mV[VX] = value;
+ });
}
-// static
-void LLPanelFace::onCommitGLTFTextureTranslationV(LLUICtrl* ctrl, void* userdata)
+void LLPanelFace::onCommitGLTFTextureOffsetV(LLUICtrl* ctrl)
{
-#if 0
- LLPanelFace* self = (LLPanelFace*)userdata;
- LL_WARNS() << ctrl->getValue().asReal() << LL_ENDL; // TODO: Remove
- // TODO
-#endif
+ const float value = ctrl->getValue().asReal();
+ const U32 pbr_type = findChild<LLRadioGroup>("radio_pbr_type")->getSelectedIndex();
+ updateGLTFTextureTransform(value, pbr_type, [&](LLGLTFMaterial::TextureTransform* new_transform)
+ {
+ new_transform->mOffset.mV[VY] = value;
+ });
}
void LLPanelFace::onTextureSelectionChanged(LLInventoryItem* itemp)
diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h
index 0d8a86069d..69744689b5 100644
--- a/indra/newview/llpanelface.h
+++ b/indra/newview/llpanelface.h
@@ -229,11 +229,11 @@ protected:
static void onCommitGlow( LLUICtrl* ctrl, void *userdata);
static void onCommitPlanarAlign( LLUICtrl* ctrl, void* userdata);
static void onCommitRepeatsPerMeter( LLUICtrl* ctrl, void* userinfo);
- static void onCommitGLTFTextureScaleU(LLUICtrl* ctrl, void* userinfo);
- static void onCommitGLTFTextureScaleV(LLUICtrl* ctrl, void* userinfo);
- static void onCommitGLTFRotation(LLUICtrl* ctrl, void* userinfo);
- static void onCommitGLTFTextureTranslationU(LLUICtrl* ctrl, void* userinfo);
- static void onCommitGLTFTextureTranslationV(LLUICtrl* ctrl, void* userinfo);
+ void onCommitGLTFTextureScaleU(LLUICtrl* ctrl);
+ void onCommitGLTFTextureScaleV(LLUICtrl* ctrl);
+ void onCommitGLTFRotation(LLUICtrl* ctrl);
+ void onCommitGLTFTextureOffsetU(LLUICtrl* ctrl);
+ void onCommitGLTFTextureOffsetV(LLUICtrl* ctrl);
static void onClickAutoFix(void*);
static void onAlignTexture(void*);
static void onClickBtnLoadInvPBR(void* userdata);
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index 7aa3639df7..3374af1c76 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -301,8 +301,24 @@ BOOL LLFloaterTexturePicker::handleDragAndDrop(
BOOL handled = FALSE;
bool is_mesh = cargo_type == DAD_MESH;
+ bool is_texture = cargo_type == DAD_TEXTURE;
+ bool is_material = cargo_type == DAD_MATERIAL;
- if ((cargo_type == DAD_TEXTURE) || is_mesh)
+ bool allow_dnd = false;
+ if (mInventoryPickType == LLTextureCtrl::PICK_MATERIAL)
+ {
+ allow_dnd = is_material;
+ }
+ else if (mInventoryPickType == LLTextureCtrl::PICK_TEXTURE)
+ {
+ allow_dnd = is_texture || is_mesh;
+ }
+ else
+ {
+ allow_dnd = is_texture || is_mesh || is_material;
+ }
+
+ if (allow_dnd)
{
LLInventoryItem *item = (LLInventoryItem *)cargo_data;
@@ -1246,6 +1262,21 @@ void LLFloaterTexturePicker::setInventoryPickType(LLTextureCtrl::EPickInventoryT
S32 index = mModeSelector->getValue().asInteger();
getChild<LLButton>("Pipette")->setVisible(index == 0);
}
+
+ if (!mLabel.empty())
+ {
+ std::string pick = getString("pick title");
+
+ setTitle(pick + mLabel);
+ }
+ else if(mInventoryPickType == LLTextureCtrl::PICK_MATERIAL)
+ {
+ setTitle(getString("pick_material"));
+ }
+ else
+ {
+ setTitle(getString("pick_texture"));
+ }
}
void LLFloaterTexturePicker::onPickerCallback(const std::vector<std::string>& filenames, LLHandle<LLFloater> handle)
@@ -1770,11 +1801,26 @@ BOOL LLTextureCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask,
// returns true, then the cast was valid, and we can perform
// the third test without problems.
LLInventoryItem* item = (LLInventoryItem*)cargo_data;
- bool is_mesh = cargo_type == DAD_MESH;
- if (getEnabled() &&
- ((cargo_type == DAD_TEXTURE) || is_mesh) &&
- allowDrop(item))
+ bool is_mesh = cargo_type == DAD_MESH;
+ bool is_texture = cargo_type == DAD_TEXTURE;
+ bool is_material = cargo_type == DAD_MATERIAL;
+
+ bool allow_dnd = false;
+ if (mInventoryPickType == LLTextureCtrl::PICK_MATERIAL)
+ {
+ allow_dnd = is_material;
+ }
+ else if (mInventoryPickType == LLTextureCtrl::PICK_TEXTURE)
+ {
+ allow_dnd = is_texture || is_mesh;
+ }
+ else
+ {
+ allow_dnd = is_texture || is_mesh || is_material;
+ }
+
+ if (getEnabled() && allow_dnd && allowDrop(item))
{
if (drop)
{
diff --git a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml
index 18631c3ae7..47de3b7576 100644
--- a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml
+++ b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml
@@ -19,7 +19,15 @@
</floater.string>
<floater.string
name="pick title">
- Pick:
+Pick:
+ </floater.string>
+ <floater.string
+ name="pick_material">
+PICK: MATERIAL
+ </floater.string>
+ <floater.string
+ name="pick_texture">
+PICK: TEXTURE
</floater.string>
<view
diff --git a/indra/newview/skins/default/xui/en/panel_tools_texture.xml b/indra/newview/skins/default/xui/en/panel_tools_texture.xml
index 91cd28d80a..ba5a20dd22 100644
--- a/indra/newview/skins/default/xui/en/panel_tools_texture.xml
+++ b/indra/newview/skins/default/xui/en/panel_tools_texture.xml
@@ -896,10 +896,12 @@
follows="left|top"
height="19"
initial_value="1"
- label="ScaleU"
+ label="Scale u"
label_width="205"
layout="topleft"
left="10"
+ min_val="-100"
+ max_val="100"
name="gltfTextureScaleU"
top_delta="-115"
width="265" />
@@ -907,10 +909,12 @@
follows="left|top"
height="19"
initial_value="1"
- label="ScaleV"
+ label="Scale v"
label_width="205"
layout="topleft"
left="10"
+ min_val="-100"
+ max_val="100"
name="gltfTextureScaleV"
width="265" />
<spinner
@@ -921,27 +925,33 @@
label_width="205"
layout="topleft"
left="10"
+ min_val="-360"
+ max_val="360"
name="gltfTextureRotation"
width="265" />
<spinner
follows="left|top"
height="19"
initial_value="0"
- label="TranslationU"
+ label="Offset u"
label_width="205"
layout="topleft"
left="10"
- name="gltfTextureTranslationU"
+ min_val="-999"
+ max_val="999"
+ name="gltfTextureOffsetU"
width="265" />
<spinner
follows="left|top"
height="19"
initial_value="0"
- label="TranslationV"
+ label="Offset v"
label_width="205"
layout="topleft"
left="10"
- name="gltfTextureTranslationV"
+ min_val="-999"
+ max_val="999"
+ name="gltfTextureOffsetV"
width="265" />
<!-- END PBR Material texture transform parameters -->
<check_box
@@ -953,7 +963,7 @@
left="7"
name="checkbox planar align"
tool_tip="Align textures on all selected faces with the last selected face. Requires Planar texture mapping."
- top_delta="16"
+ top_delta="43"
width="260" />
<button
follows="left|top"