24 #ifndef PXR_BASE_TF_PY_INVOKE_H
25 #define PXR_BASE_TF_PY_INVOKE_H
39 #include <hboost/python/dict.hpp>
40 #include <hboost/python/extract.hpp>
41 #include <hboost/python/list.hpp>
42 #include <hboost/python/object.hpp>
47 #include <type_traits>
110 hboost::python::dict *kwArgsOut);
114 template <
typename Arg,
typename... RestArgs>
116 hboost::python::dict *kwArgsOut,
124 "Non-keyword args not allowed after keyword args");
128 template <
typename... RestArgs>
130 hboost::python::dict *kwArgsOut,
135 (*kwArgsOut)[kwArg.
name] = kwArg.
value.Get();
143 hboost::python::list *posArgsOut,
144 hboost::python::dict *kwArgsOut);
147 template <
typename Arg,
typename... RestArgs>
149 hboost::python::list *posArgsOut,
150 hboost::python::dict *kwArgsOut,
163 template <
typename... RestArgs>
165 hboost::python::list *posArgsOut,
166 hboost::python::dict *kwArgsOut,
187 const hboost::python::list &posArgs,
188 const hboost::python::dict &kwArgs,
192 template <
typename... Args>
250 template <
typename Result,
typename... Args>
268 moduleName, callableExpr, &resultObj,
args...)) {
273 hboost::python::extract<Result> extractor(resultObj);
274 if (!extractor.check()) {
278 *resultOut = extractor();
287 template <
typename... Args>
305 hboost::python::list posArgs;
306 hboost::python::dict kwArgs;
311 moduleName, callableExpr, posArgs, kwArgs, resultOut)) {
315 catch (hboost::python::error_already_set
const &) {
328 template <
typename... Args>
340 moduleName, callableExpr, &ignoredResult,
args...);
345 #endif // PXR_BASE_TF_PY_INVOKE_H
GLsizei const GLchar *const * string
GLsizei const GLfloat * value
bool TfPyInvokeAndReturn(const std::string &moduleName, const std::string &callableExpr, hboost::python::object *resultOut, Args...args)
PXR_NAMESPACE_OPEN_SCOPE TF_API void TfPyInitialize()
auto arg(const Char *name, const T &arg) -> detail::named_arg< Char, T >
bool TfPyInvoke(const std::string &moduleName, const std::string &callableExpr, Args...args)
TF_API void TfPyConvertPythonExceptionToTfErrors()
TF_API void Tf_BuildPyInvokeArgs(hboost::python::list *posArgsOut, hboost::python::dict *kwArgsOut)
GLuint const GLchar * name
TF_API bool Tf_PyInvokeImpl(const std::string &moduleName, const std::string &callableExpr, const hboost::python::list &posArgs, const hboost::python::dict &kwArgs, hboost::python::object *resultObjOut)
TF_API void Tf_BuildPyInvokeKwArgs(hboost::python::dict *kwArgsOut)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
TfPyKwArg(const std::string &nameIn, const T &valueIn)
#define PXR_NAMESPACE_CLOSE_SCOPE
**If you just want to fire and args
GA_API const UT_StringHolder rest
PXR_NAMESPACE_OPEN_SCOPE hboost::python::object Tf_ArgToPy(const T &value)
bool TfPyInvokeAndExtract(const std::string &moduleName, const std::string &callableExpr, Result *resultOut, Args...args)