void GetUnloaded(const UnorderedPathSet& paths, SdfPathSet& unloaded) { for(const auto& path : paths) { if(!IsLoaded(path)) unloaded.insert(path); } }
void SdfNamespaceEdit_Namespace::_AddDeadspace(const SdfPath& path) { // Never add the absolute root path. if (!TF_VERIFY(path != SdfPath::AbsoluteRootPath())) { return; } _RemoveDeadspace(path); _deadspace.insert(path); }
PxrUsdMayaShadingModeExportContext::AssignmentVector PxrUsdMayaShadingModeExportContext::GetAssignments() const { AssignmentVector ret; MStatus status; MFnDependencyNode seDepNode(_shadingEngine, &status); if (!status) { return ret; } MPlug dsmPlug = seDepNode.findPlug("dagSetMembers", true, &status); if (!status) { return ret; } SdfPathSet seenBoundPrimPaths; for (unsigned int i = 0; i < dsmPlug.numConnectedElements(); i++) { MPlug dsmElemPlug(dsmPlug.connectionByPhysicalIndex(i)); MStatus status = MS::kFailure; MFnDagNode dagNode(PxrUsdMayaUtil::GetConnected(dsmElemPlug).node(), &status); if (!status) { continue; } MDagPath dagPath; if (!dagNode.getPath(dagPath)) continue; SdfPath usdPath = PxrUsdMayaUtil::MDagPathToUsdPath(dagPath, _mergeTransformAndShape); // If _overrideRootPath is not empty, replace the root namespace with it if (!_overrideRootPath.IsEmpty() ) { usdPath = usdPath.ReplacePrefix(usdPath.GetPrefixes()[0], _overrideRootPath); } // If this path has already been processed, skip it. if (!seenBoundPrimPaths.insert(usdPath).second) continue; // If the bound prim's path is not below a bindable root, skip it. if (SdfPathFindLongestPrefix(_bindableRoots.begin(), _bindableRoots.end(), usdPath) == _bindableRoots.end()) { continue; } MObjectArray sgObjs, compObjs; // Assuming that instancing is not involved. status = dagNode.getConnectedSetsAndMembers(0, sgObjs, compObjs, true); if (!status) continue; for (size_t j = 0; j < sgObjs.length(); j++) { // If the shading group isn't the one we're interested in, skip it. if (sgObjs[j] != _shadingEngine) continue; VtIntArray faceIndices; if (!compObjs[j].isNull()) { MItMeshPolygon faceIt(dagPath, compObjs[j]); faceIndices.reserve(faceIt.count()); for ( faceIt.reset() ; !faceIt.isDone() ; faceIt.next() ) { faceIndices.push_back(faceIt.index()); } } ret.push_back(std::make_pair(usdPath, faceIndices)); } } return ret; }