本文整理汇总了C++中LLViewerObject::dirtyInventory方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerObject::dirtyInventory方法的具体用法?C++ LLViewerObject::dirtyInventory怎么用?C++ LLViewerObject::dirtyInventory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerObject
的用法示例。
在下文中一共展示了LLViewerObject::dirtyInventory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: subserialize
void ScriptCounter::subserialize(LLViewerObject* linkset)
{
LLViewerObject* object = linkset;
LLDynamicArray<LLViewerObject*> count_objects;
count_objects.put(object);
LLViewerObject::child_list_t child_list = object->getChildren();
for (LLViewerObject::child_list_t::iterator i = child_list.begin(); i != child_list.end(); ++i)
{
LLViewerObject* child = *i;
if(!child->isAvatar())
count_objects.put(child);
}
S32 object_index = 0;
while ((object_index < count_objects.count()))
{
object = count_objects.get(object_index++);
LLUUID id = object->getID();
objIDS.insert(id.asString());
llinfos << "Counting scripts in prim " << object->getID().asString() << llendl;
object->registerInventoryListener(sInstance,NULL);
object->dirtyInventory();
object->requestInventory();
invqueries += 1;
}
}
示例2: subserialize
//.........这里部分代码省略.........
prim_llsd["position"] = LLVector3(0, 0, 0).getValue();
prim_llsd["rotation"] = ll_sd_from_quaternion(object->getRotation());
}
else
{
prim_llsd["position"] = object->getPosition().getValue();
prim_llsd["rotation"] = ll_sd_from_quaternion(object->getRotation());
}
//prim_llsd["name"] = "";//node->mName;
//prim_llsd["description"] = "";//node->mDescription;
// Transforms
prim_llsd["scale"] = object->getScale().getValue();
// Flags
prim_llsd["shadows"] = object->flagCastShadows();
prim_llsd["phantom"] = object->flagPhantom();
prim_llsd["physical"] = (BOOL)(object->mFlags & FLAGS_USE_PHYSICS);
LLVolumeParams params = object->getVolume()->getParams();
prim_llsd["volume"] = params.asLLSD();
if (object->isFlexible())
{
LLFlexibleObjectData* flex = (LLFlexibleObjectData*)object->getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE);
prim_llsd["flexible"] = flex->asLLSD();
}
if (object->getParameterEntryInUse(LLNetworkData::PARAMS_LIGHT))
{
LLLightParams* light = (LLLightParams*)object->getParameterEntry(LLNetworkData::PARAMS_LIGHT);
prim_llsd["light"] = light->asLLSD();
}
if (object->getParameterEntryInUse(LLNetworkData::PARAMS_SCULPT))
{
LLSculptParams* sculpt = (LLSculptParams*)object->getParameterEntry(LLNetworkData::PARAMS_SCULPT);
prim_llsd["sculpt"] = sculpt->asLLSD();
}
// Textures
LLSD te_llsd;
U8 te_count = object->getNumTEs();
for (U8 i = 0; i < te_count; i++)
{
te_llsd.append(object->getTE(i)->asLLSD());
}
if(export_textures)
{
std::string path = asset_dir + gDirUtilp->getDirDelimiter();
for (U8 i = 0; i < te_count; i++)
{
LLUUID asset_id = object->getTE(i)->getID();
JCAssetInfo* info = new JCAssetInfo;
info->path = path + asset_id.asString() + ".j2c";
info->name = "Prim Texture";
//gAssetStorage->getAssetData(asset_id, LLAssetType::AT_TEXTURE, JCAssetExportCallback, info,1);
if(requested_textures.count(asset_id) == 0)
{
requested_textures.insert(asset_id);
LLViewerImage* img = gImageList.getImage(asset_id, MIPMAP_TRUE, FALSE);
img->setBoostLevel(LLViewerImageBoostLevel::BOOST_MAX_LEVEL);
img->setLoadedCallback( JCExportTracker::onFileLoadedForSave,
0, TRUE, FALSE, info );
llinfos << "Requesting texture " << asset_id.asString() << llendl;
}
}
}
//JCExportTracker::mirror(asset, obj, asset_dir, asset->getUUID().asString());
prim_llsd["textures"] = te_llsd;
prim_llsd["id"] = object->getID().asString();
if(export_properties)
{
////cmdline_printchat(llformat("yes %d",export_properties));
propertyqueries += 1;
gMessageSystem->newMessageFast(_PREHASH_ObjectSelect);
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
gMessageSystem->nextBlockFast(_PREHASH_ObjectData);
gMessageSystem->addU32Fast(_PREHASH_ObjectLocalID, object->getLocalID());
gMessageSystem->sendReliable(gAgent.getRegionHost());
if(export_inventory)
{
object->registerInventoryListener(sInstance,NULL);
object->dirtyInventory();
object->requestInventory();
invqueries += 1;
}
}//else //cmdline_printchat(llformat("no %d",export_properties));
totalprims += 1;
// Changed to use link numbers zero-indexed.
llsd[object_index - 1] = prim_llsd;
}
return llsd;
}
示例3: onIdle
void FSFloaterObjectExport::onIdle()
{
switch(mExportState)
{
case IDLE:
break;
case INVENTORY_DOWNLOAD:
if (gDisconnected)
{
return;
}
if (mInventoryRequests.empty())
{
mLastRequest = mAssetRequests.size();
mWaitTimer.start();
mExportState = ASSET_DOWNLOAD;
}
else if (mLastRequest != mInventoryRequests.size())
{
mWaitTimer.start();
mLastRequest = mInventoryRequests.size();
updateTitleProgress(INVENTORY_DOWNLOAD);
}
else if (mWaitTimer.getElapsedTimeF32() > MAX_INVENTORY_WAIT_TIME)
{
mWaitTimer.start();
for (uuid_vec_t::const_iterator iter = mInventoryRequests.begin(); iter != mInventoryRequests.end(); ++iter)
{
LLViewerObject* object = gObjectList.findObject((*iter));
object->dirtyInventory();
object->requestInventory();
LL_DEBUGS("export") << "re-requested inventory of " << (*iter).asString() << LL_ENDL;
}
}
break;
case ASSET_DOWNLOAD:
if (gDisconnected)
{
return;
}
if (mAssetRequests.empty())
{
mLastRequest = mRequestedTexture.size();
mWaitTimer.start();
mExportState = TEXTURE_DOWNLOAD;
}
else if (mLastRequest != mAssetRequests.size())
{
mWaitTimer.start();
mLastRequest = mAssetRequests.size();
updateTitleProgress(ASSET_DOWNLOAD);
}
else if (mWaitTimer.getElapsedTimeF32() > MAX_ASSET_WAIT_TIME)
{
//abort for now
LL_DEBUGS("export") << "Asset timeout with " << (S32)mAssetRequests.size() << " requests left." << LL_ENDL;
for (uuid_vec_t::iterator iter = mAssetRequests.begin(); iter != mAssetRequests.end(); ++iter)
{
LL_DEBUGS("export") << "Asset: " << (*iter).asString() << LL_ENDL;
}
mAssetRequests.clear();
}
break;
case TEXTURE_DOWNLOAD:
if (gDisconnected)
{
return;
}
if(mRequestedTexture.empty())
{
mExportState = IDLE;
if (!gIdleCallbacks.deleteFunction(onIdle, this))
{
LL_WARNS("export") << "Failed to delete idle callback" << LL_ENDL;
}
mWaitTimer.stop();
llofstream file;
file.open(mFilename.c_str(), std::ios_base::out | std::ios_base::binary);
std::string zip_data = zip_llsd(mManifest);
file.write(zip_data.data(), zip_data.size());
file.close();
LL_DEBUGS("export") << "Export finished and written to " << mFilename << LL_ENDL;
LLSD args;
args["FILENAME"] = mFilename;
LLNotificationsUtil::add("ExportFinished", args);
closeFloater();
}
else if (mLastRequest != mRequestedTexture.size())
{
mWaitTimer.start();
mLastRequest = mRequestedTexture.size();
updateTitleProgress(TEXTURE_DOWNLOAD);
}
else if (mWaitTimer.getElapsedTimeF32() > MAX_TEXTURE_WAIT_TIME)
//.........这里部分代码省略.........