| 30 | PythonResolver::~PythonResolver() = default; |
| 31 | |
| 32 | std::string |
| 33 | PythonResolver::_CreateIdentifier( |
| 34 | const std::string& assetPath, |
| 35 | const ArResolvedPath& anchorAssetPath) const |
| 36 | { |
| 37 | const PythonResolverContext* contexts[2] = {this->_GetCurrentContextPtr(), &_fallbackContext}; |
| 38 | std::string serializedContext = ""; |
| 39 | std::string serializedFallbackContext = _fallbackContext.GetData(); |
| 40 | if (contexts[0] != nullptr){serializedContext=this->_GetCurrentContextPtr()->GetData();} |
| 41 | TF_DEBUG(PYTHONRESOLVER_RESOLVER).Msg("Resolver::_CreateIdentifier('%s', '%s', '%s', '%s')\n", |
| 42 | assetPath.c_str(), anchorAssetPath.GetPathString().c_str(), |
| 43 | serializedContext.c_str(), serializedFallbackContext.c_str()); |
| 44 | std::string pythonResult; |
| 45 | int state = TfPyInvokeAndExtract(DEFINE_STRING(AR_PYTHONRESOLVER_USD_PYTHON_EXPOSE_MODULE_NAME), |
| 46 | "Resolver._CreateIdentifier", |
| 47 | &pythonResult, assetPath, anchorAssetPath, serializedContext, serializedFallbackContext); |
| 48 | if (!state) { |
| 49 | std::cerr << "Failed to call Resolver._CreateIdentifier in " << DEFINE_STRING(AR_PYTHONRESOLVER_USD_PYTHON_EXPOSE_MODULE_NAME) << ".py. "; |
| 50 | std::cerr << "Please verify that the python code is valid!" << std::endl; |
| 51 | } |
| 52 | return pythonResult; |
| 53 | } |
| 54 | |
| 55 | std::string |
| 56 | PythonResolver::_CreateIdentifierForNewAsset( |
nothing calls this directly
no test coverage detected