MAINT-1209 Fixed Light does not revert to a simple light when texture is set to none

meow-7.2.2
andreykproductengine 2017-09-21 17:01:45 +03:00
parent 486297b876
commit f4e303c067
2 changed files with 8 additions and 12 deletions

View File

@ -710,22 +710,20 @@ void LLPanelVolume::onLightCancelColor(const LLSD& data)
void LLPanelVolume::onLightCancelTexture(const LLSD& data)
{
LLTextureCtrl* LightTextureCtrl = getChild<LLTextureCtrl>("light texture control");
if (LightTextureCtrl)
{
LightTextureCtrl->setImageAssetID(mLightSavedTexture);
}
LLVOVolume *volobjp = (LLVOVolume *) mObject.get();
if(volobjp)
if (volobjp && LightTextureCtrl)
{
// Cancel the light texture as requested
// NORSPEC-292
//
//
// Texture picker triggers cancel both in case of actual cancel and in case of
// selection of "None" texture.
LLUUID tex_id = LightTextureCtrl->getImageAssetID();
bool is_spotlight = volobjp->isLightSpotlight();
volobjp->setLightTextureID(mLightSavedTexture); //updates spotlight
volobjp->setLightTextureID(tex_id); //updates spotlight
if (!is_spotlight && mLightSavedTexture.notNull())
if (!is_spotlight && tex_id.notNull())
{
LLVector3 spot_params = volobjp->getSpotLightParams();
getChild<LLUICtrl>("Light FOV")->setValue(spot_params.mV[0]);
@ -769,7 +767,6 @@ void LLPanelVolume::onLightSelectTexture(const LLSD& data)
{
LLUUID id = LightTextureCtrl->getImageAssetID();
volobjp->setLightTextureID(id);
mLightSavedTexture = id;
}
}

View File

@ -111,7 +111,6 @@ protected:
LLColor4 mLightSavedColor;
LLUUID mLightSavedTexture;
LLPointer<LLViewerObject> mObject;
LLPointer<LLViewerObject> mRootObject;