Commit 6c8c55a7 authored by NiranV's avatar NiranV
Browse files

Fixed: Projector light settings in Edit - Features being available when the light is no projector.

parent fddfff2b
......@@ -301,18 +301,10 @@ void LLPanelVolume::getState( )
selection->getRootObjectCount() == 1;
// Select Single Message
if (single_volume)
{
mEditObject->setVisible(true);
mEditObject->setEnabled(true);
mSelectSingle->setVisible(false);
}
else
{
mEditObject->setVisible(false);
mSelectSingle->setVisible(true);
mSelectSingle->setEnabled(true);
}
mEditObject->setVisible(single_volume);
mEditObject->setEnabled(single_volume);
mSelectSingle->setVisible(!single_volume);
mSelectSingle->setEnabled(!single_volume);
// Light properties
BOOL is_light = volobjp && volobjp->getIsLight();
......@@ -320,44 +312,37 @@ void LLPanelVolume::getState( )
mCheckLight->setEnabled(editable && single_volume && volobjp);
//BD
BOOL has_shadow = volobjp && volobjp->getHasShadow();
BOOL light_enabled = is_light && editable && single_volume;
BOOL projector_enabled = is_light && volobjp->getLightTextureID().notNull();
BOOL has_shadow = projector_enabled && volobjp->getHasShadow();
mCheckShadow->setValue(has_shadow);
mCheckShadow->setEnabled(/*editable && single_volume &&*/ volobjp && volobjp->getLightTextureID().notNull());
if (is_light && editable && single_volume)
{
LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
if(LightColorSwatch)
{
LightColorSwatch->setEnabled( TRUE );
LightColorSwatch->setValid( TRUE );
LightColorSwatch->set(volobjp->getLightSRGBBaseColor());
}
mCheckShadow->setEnabled(projector_enabled);
mLightTextureCtrl->setEnabled(TRUE);
mLightTextureCtrl->setValid(TRUE);
mLightTextureCtrl->setImageAssetID(volobjp->getLightTextureID());
mLightColorSwatch->setEnabled(light_enabled);
mLightColorSwatch->setValid(light_enabled);
mLightColorSwatch->set(volobjp->getLightSRGBBaseColor());
//BD
mLabelLights->setReadOnly(false);
mLightTextureCtrl->setEnabled(light_enabled);
mLightTextureCtrl->setValid(light_enabled);
mLightTextureCtrl->setImageAssetID(volobjp->getLightTextureID());
//BD
mLabelLights->setReadOnly(!light_enabled);
mLightIntensity->setEnabled(true);
mLightRadius->setEnabled(true);
mLightFalloff->setEnabled(true);
mLightIntensity->setEnabled(light_enabled);
mLightRadius->setEnabled(light_enabled);
mLightFalloff->setEnabled(light_enabled);
mLightFoV->setEnabled(true);
mLightFocus->setEnabled(true);
mLightAmbiance->setEnabled(true);
mLightFoV->setEnabled(projector_enabled);
mLightFocus->setEnabled(projector_enabled);
mLightAmbiance->setEnabled(projector_enabled);
if (light_enabled)
{
mLightIntensity->setValue(volobjp->getLightIntensity());
mLightRadius->setValue(volobjp->getLightRadius());
mLightFalloff->setValue(volobjp->getLightFalloff());
LLVector3 params = volobjp->getSpotLightParams();
mLightFoV->setValue(params.mV[0]);
mLightFocus->setValue(params.mV[1]);
mLightAmbiance->setValue(params.mV[2]);
mLightSavedColor = volobjp->getLightSRGBBaseColor();
}
else
......@@ -365,22 +350,14 @@ void LLPanelVolume::getState( )
mLightIntensity->clear();
mLightRadius->clear();
mLightFalloff->clear();
}
mLightColorSwatch->setEnabled( FALSE );
mLightColorSwatch->setValid(FALSE);
mLightTextureCtrl->setEnabled(FALSE);
mLightTextureCtrl->setValid(FALSE);
//BD
mLabelLights->setReadOnly(true);
mLightIntensity->setEnabled(false);
mLightRadius->setEnabled(false);
mLightFalloff->setEnabled(false);
mLightFoV->setEnabled(false);
mLightFocus->setEnabled(false);
mLightAmbiance->setEnabled(false);
if (projector_enabled)
{
LLVector3 params = volobjp->getSpotLightParams();
mLightFoV->setValue(params.mV[0]);
mLightFocus->setValue(params.mV[1]);
mLightAmbiance->setValue(params.mV[2]);
}
// Animated Mesh
......@@ -445,26 +422,19 @@ void LLPanelVolume::getState( )
{
mCheckFlexible->setEnabled(false);
}
if (is_flexible && editable && single_volume)
{
mSpinFlexSections->setVisible(true);
mSpinFlexGravity->setVisible(true);
mSpinFlexTension->setVisible(true);
mSpinFlexFriction->setVisible(true);
mSpinFlexWind->setVisible(true);
mSpinFlexForceX->setVisible(true);
mSpinFlexForceY->setVisible(true);
mSpinFlexForceZ->setVisible(true);
mSpinFlexSections->setEnabled(true);
mSpinFlexGravity->setEnabled(true);
mSpinFlexTension->setEnabled(true);
mSpinFlexFriction->setEnabled(true);
mSpinFlexWind->setEnabled(true);
mSpinFlexForceX->setEnabled(true);
mSpinFlexForceY->setEnabled(true);
mSpinFlexForceZ->setEnabled(true);
bool spin_enabled = is_flexible && editable && single_volume;
mSpinFlexSections->setEnabled(spin_enabled);
mSpinFlexGravity->setEnabled(spin_enabled);
mSpinFlexTension->setEnabled(spin_enabled);
mSpinFlexFriction->setEnabled(spin_enabled);
mSpinFlexWind->setEnabled(spin_enabled);
mSpinFlexForceX->setEnabled(spin_enabled);
mSpinFlexForceY->setEnabled(spin_enabled);
mSpinFlexForceZ->setEnabled(spin_enabled);
if (spin_enabled)
{
LLFlexibleObjectData *attributes = (LLFlexibleObjectData *)objectp->getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE);
mSpinFlexSections->setValue((F32)attributes->getSimulateLOD());
......@@ -486,15 +456,6 @@ void LLPanelVolume::getState( )
mSpinFlexForceX->clear();
mSpinFlexForceY->clear();
mSpinFlexForceZ->clear();
mSpinFlexSections->setEnabled(false);
mSpinFlexGravity->setEnabled(false);
mSpinFlexTension->setEnabled(false);
mSpinFlexFriction->setEnabled(false);
mSpinFlexWind->setEnabled(false);
mSpinFlexForceX->setEnabled(false);
mSpinFlexForceY->setEnabled(false);
mSpinFlexForceZ->setEnabled(false);
}
// Material properties
......
......@@ -2880,6 +2880,7 @@
<spinner bottom_delta="0"
decimal_digits="3"
follows="left|top"
enabled="false"
height="20"
increment="0.1"
initial_value="0.5"
......@@ -2905,6 +2906,7 @@
<spinner top_delta="0"
decimal_digits="3"
follows="left|top"
enabled="false"
height="20"
increment="0.5"
initial_value="0.5"
......@@ -2931,7 +2933,8 @@
<spinner top_delta="0"
decimal_digits="3"
follows="left|top"
layout="topleft"
layout="topleft"
enabled="false"
height="20"
increment="0.05"
initial_value="1"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment