const LLUUID& JCLSLBridge::findInventoryByName(const std::string& object_name) { LLViewerInventoryCategory::cat_array_t cats; LLViewerInventoryItem::item_array_t items; ObjectBNameMatches objectnamematches(object_name); gInventory.collectDescendentsIf(gAgent.getInventoryRootID(),cats,items,FALSE,objectnamematches); if (items.count()) { return items[0]->getUUID(); } return LLUUID::null; }
const LLUUID& LLFloaterAO::getAssetIDByName(const std::string& name) { if (name.empty()) return LLUUID::null; LLViewerInventoryCategory::cat_array_t cats; LLViewerInventoryItem::item_array_t items; ObjectNameMatches objectnamematches(name); gInventory.collectDescendentsIf(LLUUID::null,cats,items,FALSE,objectnamematches); if (items.count()) { return items[0]->getAssetUUID(); } return LLUUID::null; };