static TfToken _MakeNamespaced(const TfToken& name) { return _IsNamespaced(name) ? name : TfToken(_tokens->xformOpPrefix.GetString() + name.GetString()); }
/* static */ bool UsdGeomPrimvar::IsPrimvar(const UsdAttribute &attr) { if (!attr) return false; TfToken const &name = attr.GetName(); return _IsNamespaced(name) && !_ContainsExtraNamespaces(name); }
UsdGeomXformOp::UsdGeomXformOp(const UsdAttribute &attr, bool isInverseOp) : _attr(attr), _isInverseOp(isInverseOp) { if (!attr) { TF_CODING_ERROR("UsdGeomXformOp created with invalid UsdAttribute."); return; } // _Initialize _opType. const TfToken &name = GetName(); const std::vector<std::string> &opNameComponents = SplitName(); if (_IsNamespaced(name)) { _opType = GetOpTypeEnum(TfToken(opNameComponents[1])); } else { TF_CODING_ERROR("Invalid xform op: <%s>.", attr.GetPath().GetText()); } }
/* static */ TfToken UsdSkelInbetweenShape::_MakeNamespaced(const TfToken& name, bool quiet) { TfToken result; if(_IsNamespaced(name)){ result = name; } else { result = TfToken(_tokens->inbetweensPrefix.GetString() + name.GetString()); } // XXX: All properly namespaced attributes are legal inbetweens. // However, if we extend the schema to include any special attributes // -- such as a namespaced pointIndices attr on each shape -- then // we must validate that the name does not conflict with those. if(!_IsValidInbetweenName(result, quiet)) { result = TfToken(); } return result; }
/* static */ TfToken UsdGeomPrimvar::_MakeNamespaced(const TfToken& name, bool quiet) { TfToken result; if (_IsNamespaced(name)){ result = name; } else { result = TfToken(_tokens->primvarsPrefix.GetString() + name.GetString()); } if (_ContainsExtraNamespaces(result)){ result = TfToken(); if (!quiet){ TF_CODING_ERROR("%s is not a valid name for a Primvar, because" " it contains namespaces.", name.GetText()); } } return result; }
/* static */ bool UsdGeomXformOp::IsXformOp(const TfToken &attrName) { return _IsNamespaced(attrName); }