本文整理汇总了C++中LLVisualParam::isTweakable方法的典型用法代码示例。如果您正苦于以下问题:C++ LLVisualParam::isTweakable方法的具体用法?C++ LLVisualParam::isTweakable怎么用?C++ LLVisualParam::isTweakable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLVisualParam
的用法示例。
在下文中一共展示了LLVisualParam::isTweakable方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeFromAvatar
// Updates the user's avatar's appearance, replacing this wearables' parameters and textures with default values.
// static
// <FS:Ansariel> [Legacy Bake]
//void LLViewerWearable::removeFromAvatar( LLWearableType::EType type)
void LLViewerWearable::removeFromAvatar( LLWearableType::EType type, BOOL upload_bake)
{
if (!isAgentAvatarValid()) return;
// You can't just remove body parts.
if( (type == LLWearableType::WT_SHAPE) ||
(type == LLWearableType::WT_SKIN) ||
(type == LLWearableType::WT_HAIR) ||
(type == LLWearableType::WT_EYES) )
{
return;
}
// Pull params
for( LLVisualParam* param = gAgentAvatarp->getFirstVisualParam(); param; param = gAgentAvatarp->getNextVisualParam() )
{
if( (((LLViewerVisualParam*)param)->getWearableType() == type) && (param->isTweakable() ) )
{
S32 param_id = param->getID();
// <FS:Ansariel> [Legacy Bake]
//gAgentAvatarp->setVisualParamWeight( param_id, param->getDefaultWeight());
gAgentAvatarp->setVisualParamWeight( param_id, param->getDefaultWeight(), upload_bake);
}
}
if(gAgentCamera.cameraCustomizeAvatar())
{
LLFloaterSidePanelContainer::showPanel("appearance", LLSD().with("type", "edit_outfit"));
}
gAgentAvatarp->updateVisualParams();
// <FS:Ansariel> [Legacy Bake]
//gAgentAvatarp->wearableUpdated(type);
gAgentAvatarp->wearableUpdated(type, FALSE);
}
示例2: readFromAvatar
// Updates asset from the user's avatar
void LLWearable::readFromAvatar()
{
LLVOAvatar* avatar = gAgent.getAvatarObject();
llassert( avatar );
if( !avatar )
{
return;
}
mDefinitionVersion = LLWearable::sCurrentDefinitionVersion;
mVisualParamMap.clear();
for( LLVisualParam* param = avatar->getFirstVisualParam(); param; param = avatar->getNextVisualParam() )
{
if (((LLViewerVisualParam*)param)->getWearableType() == mType && param->isTweakable())
{
//pretty sure is right
if(param->getID() == 507)
avatar->setActualBoobGrav(param->getWeight());
if(param->getID() == 151)
avatar->setActualButtGrav(param->getWeight());
if(param->getID() == 157)
avatar->setActualFatGrav(param->getWeight());
//if(param->getID() == 507)
//{
// llwarns << "current = " << avatar->getActualBoobGrav() << llendl;
// llwarns << "param weight = " << param->getWeight() << llendl;
//}
mVisualParamMap[param->getID()] = param->getWeight();
}
}
mTEMap.clear();
for( S32 te = 0; te < TEX_NUM_INDICES; te++ )
{
if( LLVOAvatar::getTEWearableType((ETextureIndex) te ) == mType )
{
LLViewerImage* image = avatar->getTEImage( te );
if( image )
{
mTEMap[te] = image->getID();
}
}
}
//if( gFloaterCustomize )
//{
// mDescription = gFloaterCustomize->getWearableDescription( mType );
//}
}
示例3: clearVisualParamWeights
//-----------------------------------------------------------------------------
// clearVisualParamWeights()
//-----------------------------------------------------------------------------
void LLCharacter::clearVisualParamWeights()
{
for (LLVisualParam *param = getFirstVisualParam();
param;
param = getNextVisualParam())
{
if (param->isTweakable())
{
param->setWeight( param->getDefaultWeight(), FALSE );
}
}
}
示例4: setParamsToDefaults
void LLWearable::setParamsToDefaults()
{
if (!isAgentAvatarValid()) return;
for( LLVisualParam* param = gAgentAvatarp->getFirstVisualParam(); param; param = gAgentAvatarp->getNextVisualParam() )
{
if( (((LLViewerVisualParam*)param)->getWearableType() == mType ) && (param->isTweakable() ) )
{
setVisualParamWeight(param->getID(),param->getDefaultWeight(), FALSE);
}
}
}
示例5: removeFromAvatar
// Updates the user's avatar's appearance, replacing this wearables' parameters and textures with default values.
// static
void LLWearable::removeFromAvatar( EWearableType type, BOOL set_by_user )
{
LLVOAvatar* avatar = gAgent.getAvatarObject();
llassert( avatar );
if( !avatar )
{
return;
}
// You can't just remove body parts.
if( (type == WT_SHAPE) ||
(type == WT_SKIN) ||
(type == WT_HAIR) ||
(type == WT_EYES) )
{
return;
}
// Pull params
for( LLVisualParam* param = avatar->getFirstVisualParam(); param; param = avatar->getNextVisualParam() )
{
if (((LLViewerVisualParam*)param)->getWearableType() == type && param->isTweakable())
{
S32 param_id = param->getID();
avatar->setVisualParamWeight( param_id, param->getDefaultWeight(), set_by_user );
}
}
// Pull textures
LLViewerImage* image = gImageList.getImage( IMG_DEFAULT_AVATAR );
for( S32 te = 0; te < TEX_NUM_INDICES; te++ )
{
if( LLVOAvatar::getTEWearableType((ETextureIndex) te ) == type )
{
avatar->setLocTexTE( te, image, set_by_user );
}
}
if( gFloaterCustomize )
{
gFloaterCustomize->setWearable(type, NULL, PERM_ALL, TRUE);
}
avatar->updateVisualParams();
avatar->updateMeshTextures();
// if( set_by_user )
// {
// gAgent.sendAgentSetAppearance();
// }
}
示例6: visualParamWeightsAreDefault
//-----------------------------------------------------------------------------
// BOOL visualParamWeightsAreDefault()
//-----------------------------------------------------------------------------
BOOL LLCharacter::visualParamWeightsAreDefault()
{
for (LLVisualParam *param = getFirstVisualParam();
param;
param = getNextVisualParam())
{
if (param->isTweakable())
{
if (param->getWeight() != param->getDefaultWeight())
return false;
}
}
return true;
}
示例7: setParamsToDefaults
void LLWearable::setParamsToDefaults()
{
LLVOAvatar* avatar = gAgent.getAvatarObject();
llassert( avatar );
if( !avatar )
{
return;
}
mVisualParamMap.clear();
for( LLVisualParam* param = avatar->getFirstVisualParam(); param; param = avatar->getNextVisualParam() )
{
if (((LLViewerVisualParam*)param)->getWearableType() == mType && param->isTweakable())
{
mVisualParamMap[param->getID()] = param->getDefaultWeight();
}
}
}
示例8: readFromAvatar
// Updates asset from the user's avatar
void LLWearable::readFromAvatar()
{
LLVOAvatar* avatar = gAgent.getAvatarObject();
llassert( avatar );
if( !avatar )
{
return;
}
mDefinitionVersion = LLWearable::sCurrentDefinitionVersion;
mVisualParamMap.clear();
for( LLVisualParam* param = avatar->getFirstVisualParam(); param; param = avatar->getNextVisualParam() )
{
if (((LLViewerVisualParam*)param)->getWearableType() == mType && param->isTweakable())
{
mVisualParamMap[param->getID()] = param->getWeight();
}
}
mTEMap.clear();
for( S32 te = 0; te < TEX_NUM_INDICES; te++ )
{
if( LLVOAvatar::getTEWearableType((ETextureIndex) te ) == mType )
{
LLViewerImage* image = avatar->getTEImage( te );
if( image )
{
mTEMap[te] = image->getID();
}
}
}
//if( gFloaterCustomize )
//{
// mDescription = gFloaterCustomize->getWearableDescription( mType );
//}
}
示例9: removeFromAvatar
// Updates the user's avatar's appearance, replacing this wearables' parameters and textures with default values.
// static
void LLViewerWearable::removeFromAvatar( LLWearableType::EType type, bool upload_bake )
{
if (!isAgentAvatarValid()) return;
// You can't just remove body parts.
if( (type == LLWearableType::WT_SHAPE) ||
(type == LLWearableType::WT_SKIN) ||
(type == LLWearableType::WT_HAIR) ||
(type == LLWearableType::WT_EYES) )
{
return;
}
// Pull params
for( LLVisualParam* param = gAgentAvatarp->getFirstVisualParam(); param; param = gAgentAvatarp->getNextVisualParam() )
{
if( (((LLViewerVisualParam*)param)->getWearableType() == type) && (param->isTweakable()) )
{
S32 param_id = param->getID();
gAgentAvatarp->setVisualParamWeight( param_id, param->getDefaultWeight(), upload_bake );
}
}
if(isAgentAvatarValid() && gAgentAvatarp->isEditingAppearance() && LLFloaterCustomize::instanceExists())
{
LLFloaterCustomize::getInstance()->wearablesChanged(type);
}
gAgentAvatarp->updateVisualParams();
gAgentAvatarp->wearableUpdated(type, FALSE);
// if( upload_bake )
// {
// gAgent.sendAgentSetAppearance();
// }
}
示例10: writeToAvatar
// Updates the user's avatar's appearance
void LLWearable::writeToAvatar( BOOL set_by_user )
{
LLVOAvatar* avatar = gAgent.getAvatarObject();
llassert( avatar );
if( !avatar )
{
return;
}
ESex old_sex = avatar->getSex();
// Pull params
for( LLVisualParam* param = avatar->getFirstVisualParam(); param; param = avatar->getNextVisualParam() )
{
if (((LLViewerVisualParam*)param)->getWearableType() == mType && param->isTweakable())
{
S32 param_id = param->getID();
F32 weight = get_if_there(mVisualParamMap, param_id, param->getDefaultWeight());
// only animate with user-originated changes
if (set_by_user)
{
param->setAnimationTarget(weight, set_by_user);
}
else
{
avatar->setVisualParamWeight( param_id, weight, set_by_user );
}
}
}
// only interpolate with user-originated changes
if (set_by_user)
{
avatar->startAppearanceAnimation(TRUE, TRUE);
}
// Pull texture entries
for( S32 te = 0; te < TEX_NUM_INDICES; te++ )
{
if( LLVOAvatar::getTEWearableType((ETextureIndex) te ) == mType )
{
const LLUUID& image_id = get_if_there(mTEMap, te, LLVOAvatar::getDefaultTEImageID((ETextureIndex) te ) );
LLViewerImage* image = gImageList.getImage( image_id );
avatar->setLocTexTE( te, image, set_by_user );
}
}
avatar->updateVisualParams();
if( gFloaterCustomize )
{
LLViewerInventoryItem* item;
item = (LLViewerInventoryItem*)gInventory.getItem(gAgent.getWearableItem(mType));
U32 perm_mask = PERM_NONE;
BOOL is_complete = FALSE;
if(item)
{
perm_mask = item->getPermissions().getMaskOwner();
is_complete = item->isComplete();
if(!is_complete)
{
item->fetchFromServer();
}
}
gFloaterCustomize->setWearable(mType, this, perm_mask, is_complete);
LLFloaterCustomize::setCurrentWearableType( mType );
}
ESex new_sex = avatar->getSex();
if( old_sex != new_sex )
{
avatar->updateSexDependentLayerSets( set_by_user );
}
avatar->updateMeshTextures();
// if( set_by_user )
// {
// gAgent.sendAgentSetAppearance();
// }
}