예제 #1
0
void LLVisualParamHint::preRender(BOOL clear_depth)
{
	LLVOAvatarSelf* avatarp = gAgent.getAvatarObject();

	mLastParamWeight = mVisualParam->getWeight();
	mVisualParam->setWeight(mVisualParamWeight, FALSE);
	avatarp->setVisualParamWeight(mVisualParam->getID(), mVisualParamWeight, FALSE);
	avatarp->setVisualParamWeight("Blink_Left", 0.f);
	avatarp->setVisualParamWeight("Blink_Right", 0.f);
	avatarp->updateComposites();
	avatarp->updateVisualParams();
	avatarp->updateGeometry(avatarp->mDrawable);
	avatarp->updateLOD();

	LLViewerDynamicTexture::preRender(clear_depth);
}
예제 #2
0
// Updates the user's avatar's appearance
void LLWearable::writeToAvatar()
{
	LLVOAvatarSelf* avatar = gAgent.getAvatarObject();
	llassert( avatar );
	if( !avatar )
	{
		llerrs << "could not get avatar object to write to for wearable " << this->getName() << llendl;
		return;
	}

	ESex old_sex = avatar->getSex();

	// Pull params
	for( LLVisualParam* param = avatar->getFirstVisualParam(); param; param = avatar->getNextVisualParam() )
	{
		// cross-wearable parameters are not authoritative, as they are driven by a different wearable. So don't copy the values to the
		// avatar object if cross wearable. Cross wearable params get their values from the avatar, they shouldn't write the other way.
		if( (((LLViewerVisualParam*)param)->getWearableType() == mType) && (!((LLViewerVisualParam*)param)->getCrossWearable()) )
		{
			S32 param_id = param->getID();
			F32 weight = getVisualParamWeight(param_id);

			avatar->setVisualParamWeight( param_id, weight, FALSE );
		}
	}

	// Pull texture entries
	for( S32 te = 0; te < TEX_NUM_INDICES; te++ )
	{
		if (LLVOAvatarDictionary::getTEWearableType((ETextureIndex) te) == mType)
		{
			te_map_t::const_iterator iter = mTEMap.find(te);
			LLUUID image_id;
			if(iter != mTEMap.end())
			{
				image_id = iter->second->getID();
			}
			else
			{	
				image_id = LLVOAvatarDictionary::getDefaultTextureImageID((ETextureIndex) te);
			}
			LLViewerTexture* image = LLViewerTextureManager::getFetchedTexture( image_id, TRUE, LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE );
			// MULTI-WEARABLE: replace hard-coded 0
			avatar->setLocalTextureTE(te, image, 0);
		}
	}

	ESex new_sex = avatar->getSex();
	if( old_sex != new_sex )
	{
		avatar->updateSexDependentLayerSets( FALSE );
	}	
	
//	if( upload_bake )
//	{
//		gAgent.sendAgentSetAppearance();
//	}
}
예제 #3
0
void LLWearable::setVisualParams()
{
	LLVOAvatarSelf* avatar = gAgent.getAvatarObject();

	for (visual_param_index_map_t::const_iterator iter = mVisualParamIndexMap.begin(); iter != mVisualParamIndexMap.end(); iter++)
	{
		S32 id = iter->first;
		LLVisualParam *wearable_param = iter->second;
		F32 value = wearable_param->getWeight();
		avatar->setVisualParamWeight(id, value, FALSE);
	}
}
예제 #4
0
// Updates the user's avatar's appearance, replacing this wearables' parameters and textures with default values.
// static 
void LLWearable::removeFromAvatar( EWearableType type, BOOL upload_bake )
{
	LLVOAvatarSelf* 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->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE ) )
		{
			S32 param_id = param->getID();
			avatar->setVisualParamWeight( param_id, param->getDefaultWeight(), upload_bake );
		}
	}

	if( gFloaterCustomize )
	{
		gFloaterCustomize->setWearable(type, NULL, PERM_ALL, TRUE);
	}

	avatar->updateVisualParams();
	avatar->wearableUpdated(type, TRUE);

//	if( upload_bake )
//	{
//		gAgent.sendAgentSetAppearance();
//	}
}