Loading...
Searching...
No Matches
include
export
bbm_python.h
Go to the documentation of this file.
1
/***********************************************************************/
2
/*! \file bbm_python.h
3
\brief Python support for BBM
4
5
\param bsdfmodel = the class name of the BSDF model to export.
6
7
Assumes that:
8
1. the bsdfmodelclass has a single (non-defaulted) template parameter to specify
9
the Configuration.
10
2. the BSDFMDOEL has a static constexpr string_literal name.
11
3. the BSDFMODEL should have a constructor with a named arg list and constructor_args_t is defined.
12
13
The macro will then create a default trampoline function that constructs a
14
bsdf_ptr based on the parameters passed via python (args and kwargs). The
15
python args/kwargs are compared to the attributes and corresponding
16
attributes are set.
17
18
To compile the bsdf models in a python module, a py::module& named 'm'
19
needs to be defined. This is the module the bsdf model is exported to.
20
21
If met, simply re-include this file and the bsdfmodels you want
22
to include. See bbm_python.cpp for an example.
23
24
************************************************************************/
25
26
#undef BBM_EXPORT_BSDFMODEL
27
#define BBM_EXPORT_BSDFMODEL(bsdfmodel) bbm::python::def_bsdf<bsdfmodel<bbm::BBM_CONFIG>>(m);
28