Object edit subpanel now recognizes meshes and disables stitching and block-type dropdowns.

This commit is contained in:
Shyotl
2011-07-31 19:03:25 -05:00
parent e21c9637ae
commit 40d644e432

View File

@@ -735,7 +735,7 @@ void LLPanelObject::getState( )
BOOL enabled = FALSE; BOOL enabled = FALSE;
BOOL hole_enabled = FALSE; BOOL hole_enabled = FALSE;
F32 scale_x=1.f, scale_y=1.f; F32 scale_x=1.f, scale_y=1.f;
BOOL isMesh = FALSE;
if( !objectp || !objectp->getVolume() || !editable || !single_volume) if( !objectp || !objectp->getVolume() || !editable || !single_volume)
{ {
// Clear out all geometry fields. // Clear out all geometry fields.
@@ -1399,15 +1399,9 @@ void LLPanelObject::getState( )
mCtrlSculptTexture->setVisible(sculpt_texture_visible); mCtrlSculptTexture->setVisible(sculpt_texture_visible);
mLabelSculptType->setVisible(sculpt_texture_visible); mLabelSculptType->setVisible(sculpt_texture_visible);
mCtrlSculptType->setVisible(sculpt_texture_visible); mCtrlSculptType->setVisible(sculpt_texture_visible);
mCtrlSculptMirror->setVisible(sculpt_texture_visible);
mCtrlSculptInvert->setVisible(sculpt_texture_visible);
// sculpt texture // sculpt texture
if (selected_item == MI_SCULPT) if (selected_item == MI_SCULPT)
{ {
LLUUID id; LLUUID id;
@@ -1421,36 +1415,37 @@ void LLPanelObject::getState( )
mSculptTextureRevert = sculpt_params->getSculptTexture(); mSculptTextureRevert = sculpt_params->getSculptTexture();
mSculptTypeRevert = sculpt_params->getSculptType(); mSculptTypeRevert = sculpt_params->getSculptType();
} }
U8 sculpt_type = sculpt_params->getSculptType();
U8 sculpt_stitching = sculpt_type & LL_SCULPT_TYPE_MASK;
BOOL sculpt_invert = sculpt_type & LL_SCULPT_FLAG_INVERT;
BOOL sculpt_mirror = sculpt_type & LL_SCULPT_FLAG_MIRROR;
#if MESH_ENABLED
isMesh = (sculpt_stitching == LL_SCULPT_TYPE_MESH);
#endif //MESH_ENABLED
LLTextureCtrl* mTextureCtrl = getChild<LLTextureCtrl>("sculpt texture control"); LLTextureCtrl* mTextureCtrl = getChild<LLTextureCtrl>("sculpt texture control");
if(mTextureCtrl) if(mTextureCtrl)
{ {
mTextureCtrl->setTentative(FALSE); mTextureCtrl->setTentative(FALSE);
mTextureCtrl->setEnabled(editable); mTextureCtrl->setEnabled(editable && !isMesh);
if (editable) if (editable)
mTextureCtrl->setImageAssetID(sculpt_params->getSculptTexture()); mTextureCtrl->setImageAssetID(sculpt_params->getSculptTexture());
else else
mTextureCtrl->setImageAssetID(LLUUID::null); mTextureCtrl->setImageAssetID(LLUUID::null);
} }
mComboBaseType->setEnabled(!isMesh);
U8 sculpt_type = sculpt_params->getSculptType();
U8 sculpt_stitching = sculpt_type & LL_SCULPT_TYPE_MASK;
BOOL sculpt_invert = sculpt_type & LL_SCULPT_FLAG_INVERT;
BOOL sculpt_mirror = sculpt_type & LL_SCULPT_FLAG_MIRROR;
if (mCtrlSculptType) if (mCtrlSculptType)
{ {
mCtrlSculptType->setCurrentByIndex(sculpt_stitching); mCtrlSculptType->setCurrentByIndex(sculpt_stitching);
mCtrlSculptType->setEnabled(editable); mCtrlSculptType->setEnabled(editable && !isMesh);
} }
if (mCtrlSculptMirror) if (mCtrlSculptMirror)
{ {
mCtrlSculptMirror->set(sculpt_mirror); mCtrlSculptMirror->set(sculpt_mirror);
mCtrlSculptMirror->setEnabled(editable); mCtrlSculptMirror->setEnabled(editable && !isMesh);
} }
if (mCtrlSculptInvert) if (mCtrlSculptInvert)
@@ -1463,18 +1458,16 @@ void LLPanelObject::getState( )
{ {
mLabelSculptType->setEnabled(TRUE); mLabelSculptType->setEnabled(TRUE);
} }
} }
} }
else else
{ {
mSculptTextureRevert = LLUUID::null; mSculptTextureRevert = LLUUID::null;
} }
mCtrlSculptMirror->setVisible(sculpt_texture_visible && !isMesh);
mCtrlSculptInvert->setVisible(sculpt_texture_visible && !isMesh);
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@@ -2261,6 +2254,20 @@ void LLPanelObject::sendSculpt()
if (mCtrlSculptType) if (mCtrlSculptType)
sculpt_type |= mCtrlSculptType->getCurrentIndex(); sculpt_type |= mCtrlSculptType->getCurrentIndex();
bool enabled = true;
#if MESH_ENABLED
enabled = sculpt_type != LL_SCULPT_TYPE_MESH;
#endif //MESH_ENABLED
if (mCtrlSculptMirror)
{
mCtrlSculptMirror->setEnabled(enabled ? TRUE : FALSE);
}
if (mCtrlSculptInvert)
{
mCtrlSculptInvert->setEnabled(enabled ? TRUE : FALSE);
}
if ((mCtrlSculptMirror) && (mCtrlSculptMirror->get())) if ((mCtrlSculptMirror) && (mCtrlSculptMirror->get()))
sculpt_type |= LL_SCULPT_FLAG_MIRROR; sculpt_type |= LL_SCULPT_FLAG_MIRROR;