MCPcopy Create free account
hub / github.com/LucaScheller/VFX-UsdAssetResolver / _Resolve

Method _Resolve

src/PythonResolver/resolver.cpp:74–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74ArResolvedPath
75PythonResolver::_Resolve(
76 const std::string& assetPath) const
77{
78 const PythonResolverContext* contexts[2] = {this->_GetCurrentContextPtr(), &_fallbackContext};
79 std::string serializedContext = "";
80 std::string serializedFallbackContext = _fallbackContext.GetData();
81 if (contexts[0] != nullptr){serializedContext=this->_GetCurrentContextPtr()->GetData();}
82 TF_DEBUG(PYTHONRESOLVER_RESOLVER).Msg("Resolver::_Resolve('%s', '%s', '%s')\n", assetPath.c_str(),
83 serializedContext.c_str(), serializedFallbackContext.c_str());
84 ArResolvedPath pythonResult;
85 int state = TfPyInvokeAndExtract(DEFINE_STRING(AR_PYTHONRESOLVER_USD_PYTHON_EXPOSE_MODULE_NAME),
86 "Resolver._Resolve",
87 &pythonResult, assetPath, serializedContext, serializedFallbackContext);
88 if (!state) {
89 std::cerr << "Failed to call Resolver._Resolve in " << DEFINE_STRING(AR_PYTHONRESOLVER_USD_PYTHON_EXPOSE_MODULE_NAME) << ".py. ";
90 std::cerr << "Please verify that the python code is valid!" << std::endl;
91 }
92 return pythonResult;
93}
94
95ArResolvedPath
96PythonResolver::_ResolveForNewAsset(

Callers 1

Calls 1

_GetCurrentContextPtrMethod · 0.95

Tested by

no test coverage detected