本文整理汇总了C++中LLVisualParam::getCurrentWeight方法的典型用法代码示例。如果您正苦于以下问题:C++ LLVisualParam::getCurrentWeight方法的具体用法?C++ LLVisualParam::getCurrentWeight怎么用?C++ LLVisualParam::getCurrentWeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLVisualParam
的用法示例。
在下文中一共展示了LLVisualParam::getCurrentWeight方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LuaDumpVisualParams
void LuaDumpVisualParams()
{
LLViewerInventoryItem* item;
item = (LLViewerInventoryItem*)gAgent.getWearableInventoryItem(WT_SHAPE);
if(!HasPermissions(item))
{
LuaError("LuaDumpVisualParams(): You do not have permission to edit this shape.");
return;
}
LLVOAvatar *av=gAgent.getAvatarObject();
std::string param_msg("Params for avatar ");
param_msg.append(av->getFullname().c_str());
param_msg.append(": ");
LuaSendChat(param_msg.c_str());
param_msg.clear();
for (LLVisualParam *param = av->getFirstVisualParam();
param;
param = av->getNextVisualParam())
{
param_msg.assign(param->getName().c_str());
param_msg.append(" (");
param_msg.append(toLuaString(param->getDefaultWeight()));
param_msg.append("): ");
param_msg.append(toLuaString(param->getCurrentWeight()));
LuaSendChat(param_msg.c_str());
}
std::map<LLUUID,LLWearable *>::const_iterator i;
for(i = gWearableList.mList.begin();i!=gWearableList.mList.end();++i)
{
LLWearable *wear=(LLWearable *)i->second;
LLFILE *file = LLFile::fopen(gDirUtilp->getExpandedFilename(FL_PATH_MACROS,"data"+gDirUtilp->getDirDelimiter()+"wearables",wear->getID().asString()).c_str(),"wb");
if(file && wear->exportFile(file))
delete file;
std::stringstream s;
s << "Wearable ID: ";
s << wear->getID().asString();
LuaSendChat(s.str().c_str());
}
}
示例2: LuaDumpVisualParams
std::map<std::string,double> LuaDumpVisualParams()
{
std::map<std::string,double> VisParams;
VisParams.clear();
LLViewerInventoryItem* item;
item = (LLViewerInventoryItem*)gAgent.getWearableInventoryItem(WT_SHAPE);
if(!HasPermissions(item))
{
LuaError("LuaDumpVisualParams(): You do not have permission to edit this shape.");
return VisParams;
}
LLVOAvatar *av=gAgent.getAvatarObject();
for (LLVisualParam *param = av->getFirstVisualParam();
param;
param = av->getNextVisualParam())
{
VisParams.insert(std::pair<std::string,double>(param->getName(),(double)param->getCurrentWeight()));
}
return VisParams;
}
示例3: LuaDumpVisualParamsToLuaCode
std::string LuaDumpVisualParamsToLuaCode()
{
LLVOAvatar *av=gAgent.getAvatarObject();
//LuaError("DumpVisualParamsToLuaCode() DEBUG: Dumping vis params. (Checking perms)");
LLViewerInventoryItem* item;
item = (LLViewerInventoryItem*)gAgent.getWearableInventoryItem(WT_SHAPE);
if(!item)
{
LuaError(llformat("DumpVisualParamsToLuaCode() (%s:%d): item is null! Cannot check perms; Aborting!\nPlease file a bug report at http://bugs.nexisonline.net/",__FILE__,__LINE__).c_str());
return "";
}
if(!HasPermissions(item))
{
LuaError("LuaDumpVisualParamsToLuaCode(): You do not have permission to edit this shape.");
return std::string();
}
std::string param_msg("");
param_msg.assign("--[[ Autogenerated by FlexLife Viewer (Rev. $Rev$)]]--\n\n");
param_msg.append("-- setParamOnSelf(\"name\",weight) -- default, min, max\n");
for (LLVisualParam *param = av->getFirstVisualParam();
param;
param = av->getNextVisualParam())
{
param_msg.append(
llformat(
"setParamOnSelf(\"%s\",%f)\t-- %f\t%f\t%f\n",
param->getName().c_str(),
param->getCurrentWeight(),
param->getDefaultWeight(),
param->getMinWeight(),
param->getMaxWeight()
)
);
}
param_msg.append("\n\n--[[Wearables]]--\nRemoveAllWearables()\n");
std::map<LLUUID,LLWearable *>::const_iterator i;
for(i = gWearableList.mList.begin();i!=gWearableList.mList.end();++i)
{
LLWearable *wear=(LLWearable *)i->second;
if(!LuaSaveWearable(wear)) break;
std::stringstream s;
s << "wear(\"" << wear->getID().asString() << "\")\n";
param_msg.append(s.str());
}
/*
for( S32 i = 0; i < BAKED_NUM_INDICES; i++ )
{
S32 tex_index=LLmBakedTextureData[i].mTextureIndex
//S32 tex_index = LLVOAvatar::sBakedTextureIndices[i];
std::stringstream s;
s << "setTEImage(" << tex_index <<",\""<< av->getTEImage(tex_index)->getID() << "\")\n";
param_msg.append(s.str());
}
*/
param_msg.append("UpdateAppearance()\n");
//LuaError("DumpVisualParamsToLuaCode() DEBUG: Done.");
return param_msg;
}