About
The Python module allows to execute Python source code. This can be standard Python as well as the classes included in the "c4d" and "maxon" module.
The module's API is defined in the python.framework as well as lib_py.h.
Classes and Functions
Example Code
#include "lib_py.h"
{
const maxon::VirtualMachineScopeRef scope = vm.CreateScope()
iferr_return;
{
const String errorMessage =
"Error on Init()"_s;
}
if (doc != nullptr)
{
auto python = maxon::Cast<maxon::py::CPythonLibraryRef>(vm.GetLibraryRef());
PythonLibrary pyLib;
auto* pyObjectDoc = pyLib.ReturnGeListNode(doc, false);
if (pyObjectDoc == nullptr)
python.CPy_Decref(pyDoc);
auto* pyObjectOp = op ? pyLib.ReturnGeListNode(op, false) : pyLib.ReturnPyNone();
if (pyObjectOp == nullptr)
python.CPy_Decref(pyOp);
}
{
const String errorMessage =
"Error on Execute()"_s;
}
}