44 # include <OSL/oslconfig.h>
45 # include <OSL/oslquery.h>
61 if (
object == Py_None)
63 return PyLong_AsVoidPtr(
object);
69 return PyUnicode_DecodeUTF8(
str, strlen(
str),
"ignore");
98 switch (
get_enum(cscene,
"debug_opencl_device_type")) {
140 *python_thread_state = (
void *)PyEval_SaveThread();
145 PyEval_RestoreThread((PyThreadState *)*python_thread_state);
146 *python_thread_state =
NULL;
151 const char *
result = PyUnicode_AsUTF8(py_str);
160 if (PyBytes_Check(py_str)) {
161 return PyBytes_AS_STRING(py_str);
163 else if ((*coerce = PyUnicode_EncodeFSDefault(py_str))) {
164 return PyBytes_AS_STRING(*coerce);
178 PyObject *path, *user_path;
181 if (!PyArg_ParseTuple(args,
"OOi", &path, &user_path, &headless)) {
185 PyObject *path_coerce =
NULL, *user_path_coerce =
NULL;
188 Py_XDECREF(path_coerce);
189 Py_XDECREF(user_path_coerce);
210 PyObject *pyengine, *pypreferences, *pydata, *pyscreen, *pyregion, *pyv3d, *pyrv3d;
213 if (!PyArg_ParseTuple(args,
236 BL::Preferences preferences(preferencesptr);
240 BL::BlendData
data(dataptr);
244 BL::Region region(regionptr);
248 BL::SpaceView3D v3d(v3dptr);
259 int width = region.width();
260 int height = region.height();
269 return PyLong_FromVoidPtr(session);
272 static PyObject *
free_func(PyObject * , PyObject *value)
281 PyObject *pysession, *pydepsgraph;
283 if (!PyArg_ParseTuple(args,
"OO", &pysession, &pydepsgraph))
296 tbb::this_task_arena::isolate([&] { session->
render(b_depsgraph); });
306 PyObject *pysession, *pydepsgraph, *pyobject;
307 const char *pass_type;
310 if (!PyArg_ParseTuple(args,
333 tbb::this_task_arena::isolate(
334 [&] { session->
bake(b_depsgraph, b_object, pass_type, pass_filter,
width,
height); });
343 PyObject *pysession, *pygraph, *pyv3d, *pyrv3d;
345 if (!PyArg_ParseTuple(args,
"OOOO", &pysession, &pygraph, &pyv3d, &pyrv3d))
350 if (PyLong_AsVoidPtr(pyrv3d)) {
353 glGetIntegerv(GL_VIEWPORT, viewport);
355 session->
draw(viewport[2], viewport[3]);
363 PyObject *pysession, *pydata, *pydepsgraph;
365 if (!PyArg_ParseTuple(args,
"OOO", &pysession, &pydata, &pydepsgraph))
372 BL::BlendData b_data(dataptr);
380 tbb::this_task_arena::isolate([&] { session->
reset_session(b_data, b_depsgraph); });
389 PyObject *pysession, *pydepsgraph;
391 if (!PyArg_ParseTuple(args,
"OO", &pysession, &pydepsgraph))
402 tbb::this_task_arena::isolate([&] { session->
synchronize(b_depsgraph); });
411 const char *type_name;
412 if (!PyArg_ParseTuple(args,
"s", &type_name)) {
419 PyErr_Format(PyExc_ValueError,
"Device \"%s\" not known.", type_name);
429 for (
size_t i = 0; i <
devices.size(); i++) {
432 PyObject *device_tuple = PyTuple_New(4);
436 PyTuple_SET_ITEM(device_tuple, 3, PyBool_FromLong(device.
has_peer_memory));
437 PyTuple_SET_ITEM(
ret, i, device_tuple);
445 static PyObject *osl_update_node_func(PyObject * , PyObject *args)
447 PyObject *pydata, *pynodegroup, *pynode;
448 const char *filepath =
NULL;
450 if (!PyArg_ParseTuple(args,
"OOOs", &pydata, &pynodegroup, &pynode, &filepath))
456 BL::BlendData b_data(dataptr);
461 (
void *)PyLong_AsVoidPtr(pynode),
463 BL::ShaderNodeScript b_node(nodeptr);
466 string bytecode = b_node.bytecode();
468 if (!bytecode.empty()) {
470 md5.
append((
const uint8_t *)bytecode.c_str(), bytecode.size());
471 b_node.bytecode_hash(md5.
get_hex().c_str());
474 b_node.bytecode_hash(
"");
479 if (!OSLShaderManager::osl_query(
query, filepath))
483 set<void *> used_sockets;
485 for (
int i = 0; i <
query.nparams(); i++) {
486 const OSL::OSLQuery::Parameter *param =
query.getparam(i);
489 if (param->varlenarray || param->isstruct || param->type.arraylen > 1)
494 BL::NodeSocket::type_enum data_type = BL::NodeSocket::type_VALUE;
495 float4 default_float4 =
make_float4(0.0f, 0.0f, 0.0f, 1.0f);
496 float default_float = 0.0f;
498 string default_string =
"";
500 if (param->isclosure) {
501 socket_type =
"NodeSocketShader";
502 data_type = BL::NodeSocket::type_SHADER;
504 else if (param->type.vecsemantics == TypeDesc::COLOR) {
505 socket_type =
"NodeSocketColor";
506 data_type = BL::NodeSocket::type_RGBA;
508 if (param->validdefault) {
509 default_float4[0] = param->fdefault[0];
510 default_float4[1] = param->fdefault[1];
511 default_float4[2] = param->fdefault[2];
515 param->type.vecsemantics == TypeDesc::VECTOR ||
517 socket_type =
"NodeSocketVector";
518 data_type = BL::NodeSocket::type_VECTOR;
520 if (param->validdefault) {
521 default_float4[0] = param->fdefault[0];
522 default_float4[1] = param->fdefault[1];
523 default_float4[2] = param->fdefault[2];
526 else if (param->type.aggregate == TypeDesc::SCALAR) {
527 if (param->type.basetype == TypeDesc::INT) {
528 socket_type =
"NodeSocketInt";
529 data_type = BL::NodeSocket::type_INT;
530 if (param->validdefault)
531 default_int = param->idefault[0];
533 else if (param->type.basetype == TypeDesc::FLOAT) {
534 socket_type =
"NodeSocketFloat";
535 data_type = BL::NodeSocket::type_VALUE;
536 if (param->validdefault)
537 default_float = param->fdefault[0];
539 else if (param->type.basetype == TypeDesc::STRING) {
540 socket_type =
"NodeSocketString";
541 data_type = BL::NodeSocket::type_STRING;
542 if (param->validdefault)
543 default_string = param->sdefault[0].string();
553 if (param->isoutput) {
554 b_sock = b_node.outputs[param->name.string()];
556 if (b_sock && b_sock.bl_idname() != socket_type) {
557 b_node.outputs.remove(b_data, b_sock);
562 b_sock = b_node.inputs[param->name.string()];
564 if (b_sock && b_sock.bl_idname() != socket_type) {
565 b_node.inputs.remove(b_data, b_sock);
573 b_sock = b_node.outputs.create(
574 b_data, socket_type.c_str(), param->name.c_str(), param->name.c_str());
576 b_sock = b_node.inputs.create(
577 b_data, socket_type.c_str(), param->name.c_str(), param->name.c_str());
580 if (data_type == BL::NodeSocket::type_VALUE) {
581 set_float(b_sock.ptr,
"default_value", default_float);
583 else if (data_type == BL::NodeSocket::type_INT) {
584 set_int(b_sock.ptr,
"default_value", default_int);
586 else if (data_type == BL::NodeSocket::type_RGBA) {
587 set_float4(b_sock.ptr,
"default_value", default_float4);
589 else if (data_type == BL::NodeSocket::type_VECTOR) {
592 else if (data_type == BL::NodeSocket::type_STRING) {
593 set_string(b_sock.ptr,
"default_value", default_string);
597 used_sockets.insert(b_sock.ptr.data);
606 for (BL::NodeSocket &b_input : b_node.inputs) {
607 if (used_sockets.find(b_input.ptr.data) == used_sockets.end()) {
608 b_node.inputs.remove(b_data, b_input);
614 for (BL::NodeSocket &b_output : b_node.outputs) {
615 if (used_sockets.find(b_output.ptr.data) == used_sockets.end()) {
616 b_node.outputs.remove(b_data, b_output);
626 static PyObject *osl_compile_func(PyObject * , PyObject *args)
628 const char *inputfile =
NULL, *outputfile =
NULL;
630 if (!PyArg_ParseTuple(args,
"ss", &inputfile, &outputfile))
634 if (!OSLShaderManager::osl_compile(inputfile, outputfile))
648 static PyObject *opencl_disable_func(PyObject * , PyObject * )
650 VLOG(2) <<
"Disabling OpenCL platform.";
655 static PyObject *opencl_compile_func(PyObject * , PyObject *args)
657 PyObject *sequence = PySequence_Fast(args,
"Arguments must be a sequence");
658 if (sequence ==
NULL) {
663 for (Py_ssize_t i = 0; i < PySequence_Fast_GET_SIZE(sequence); i++) {
664 PyObject *item = PySequence_Fast_GET_ITEM(sequence, i);
665 PyObject *item_as_string = PyObject_Str(item);
666 const char *parameter_string = PyUnicode_AsUTF8(item_as_string);
668 Py_DECREF(item_as_string);
683 if (PyUnicode_Check(pyfilepaths)) {
684 const char *filepath = PyUnicode_AsUTF8(pyfilepaths);
685 filepaths.push_back(filepath);
689 PyObject *sequence = PySequence_Fast(pyfilepaths,
690 "File paths must be a string or sequence of strings");
691 if (sequence ==
NULL) {
695 for (Py_ssize_t i = 0; i < PySequence_Fast_GET_SIZE(sequence); i++) {
696 PyObject *item = PySequence_Fast_GET_ITEM(sequence, i);
697 const char *filepath = PyUnicode_AsUTF8(item);
698 if (filepath ==
NULL) {
699 PyErr_SetString(PyExc_ValueError,
"File paths must be a string or sequence of strings.");
703 filepaths.push_back(filepath);
710 static PyObject *
denoise_func(PyObject * , PyObject *args, PyObject *keywords)
713 "preferences",
"scene",
"view_layer",
"input",
"output",
"tile_size",
"samples",
NULL};
714 PyObject *pypreferences, *pyscene, *pyviewlayer;
715 PyObject *pyinput, *pyoutput =
NULL;
716 int tile_size = 0, samples = 0;
718 if (!PyArg_ParseTupleAndKeywords(args,
736 BL::Preferences b_preferences(preferencesptr);
748 PyLong_AsVoidPtr(pyviewlayer),
755 params.feature_strength =
get_float(cviewlayer,
"denoising_feature_strength");
757 params.neighbor_frames =
get_int(cviewlayer,
"denoising_neighbor_frames");
776 PyErr_SetString(PyExc_ValueError,
"No input file paths specified.");
779 if (input.size() !=
output.size()) {
780 PyErr_SetString(PyExc_ValueError,
"Number of input and output file paths does not match.");
787 denoiser.
input = input;
798 if (!denoiser.
run()) {
799 PyErr_SetString(PyExc_ValueError, denoiser.
error.c_str());
806 static PyObject *
merge_func(PyObject * , PyObject *args, PyObject *keywords)
809 PyObject *pyinput, *pyoutput =
NULL;
811 if (!PyArg_ParseTupleAndKeywords(
812 args, keywords,
"OO", (
char **)
keyword_list, &pyinput, &pyoutput)) {
823 if (!PyUnicode_Check(pyoutput)) {
824 PyErr_SetString(PyExc_ValueError,
"Output must be a string.");
827 string output = PyUnicode_AsUTF8(pyoutput);
831 merger.
input = input;
835 PyErr_SetString(PyExc_ValueError, merger.
error.c_str());
845 if (!PyArg_ParseTuple(args,
"O", &pyscene)) {
854 VLOG(2) <<
"Tagging device list for update.";
868 VLOG(2) <<
"Tagging device list for update.";
880 int num_resumable_chunks, current_resumable_chunk;
881 if (!PyArg_ParseTuple(args,
"ii", &num_resumable_chunks, ¤t_resumable_chunk)) {
885 if (num_resumable_chunks <= 0) {
886 fprintf(stderr,
"Cycles: Bad value for number of resumable chunks.\n");
890 if (current_resumable_chunk < 1 || current_resumable_chunk > num_resumable_chunks) {
891 fprintf(stderr,
"Cycles: Bad value for current resumable chunk number.\n");
896 VLOG(1) <<
"Initialized resumable render: "
897 <<
"num_resumable_chunks=" << num_resumable_chunks <<
", "
898 <<
"current_resumable_chunk=" << current_resumable_chunk;
902 printf(
"Cycles: Will render chunk %d of %d\n", current_resumable_chunk, num_resumable_chunks);
909 int num_chunks, start_chunk, end_chunk;
910 if (!PyArg_ParseTuple(args,
"iii", &num_chunks, &start_chunk, &end_chunk)) {
914 if (num_chunks <= 0) {
915 fprintf(stderr,
"Cycles: Bad value for number of resumable chunks.\n");
919 if (start_chunk < 1 || start_chunk > num_chunks) {
920 fprintf(stderr,
"Cycles: Bad value for start chunk number.\n");
924 if (end_chunk < 1 || end_chunk > num_chunks) {
925 fprintf(stderr,
"Cycles: Bad value for start chunk number.\n");
929 if (start_chunk > end_chunk) {
930 fprintf(stderr,
"Cycles: End chunk should be higher than start one.\n");
935 VLOG(1) <<
"Initialized resumable render: "
936 <<
"num_resumable_chunks=" << num_chunks <<
", "
937 <<
"start_resumable_chunk=" << start_chunk <<
"end_resumable_chunk=" << end_chunk;
942 printf(
"Cycles: Will render chunks %d to %d of %d\n", start_chunk, end_chunk, num_chunks);
949 VLOG(1) <<
"Clear resumable render";
965 bool has_cuda =
false, has_optix =
false, has_opencl =
false;
966 foreach (
DeviceType device_type, device_types) {
971 PyObject *list = PyTuple_New(3);
972 PyTuple_SET_ITEM(list, 0, PyBool_FromLong(has_cuda));
973 PyTuple_SET_ITEM(list, 1, PyBool_FromLong(has_optix));
974 PyTuple_SET_ITEM(list, 2, PyBool_FromLong(has_opencl));
980 PyObject *override_string = PyObject_Str(arg);
981 string override = PyUnicode_AsUTF8(override_string);
982 Py_DECREF(override_string);
984 bool include_cpu =
false;
985 const string cpu_suffix =
"+CPU";
988 override =
override.substr(0,
override.
length() - cpu_suffix.length());
991 if (
override ==
"CPU") {
994 else if (
override ==
"OPENCL") {
997 else if (
override ==
"CUDA") {
1000 else if (
override ==
"OPTIX") {
1004 printf(
"\nError: %s is not a valid Cycles device.\n",
override.c_str());
1027 {
"osl_update_node", osl_update_node_func, METH_VARARGS,
""},
1028 {
"osl_compile", osl_compile_func, METH_VARARGS,
""},
1033 {
"opencl_disable", opencl_disable_func, METH_NOARGS,
""},
1034 {
"opencl_compile", opencl_compile_func, METH_VARARGS,
""},
1038 {
"denoise", (PyCFunction)
denoise_func, METH_VARARGS | METH_KEYWORDS,
""},
1039 {
"merge", (PyCFunction)
merge_func, METH_VARARGS | METH_KEYWORDS,
""},
1060 static struct PyModuleDef
module = {
1061 PyModuleDef_HEAD_INIT,
1063 "Blender cycles render integration",
1084 int curversion = OSL_LIBRARY_VERSION_CODE;
1085 PyModule_AddObject(
mod,
"with_osl", Py_True);
1090 Py_BuildValue(
"(iii)", curversion / 10000, (curversion / 100) % 100, curversion % 100));
1093 "osl_version_string",
1094 PyUnicode_FromFormat(
1095 "%2d, %2d, %2d", curversion / 10000, (curversion / 100) % 100, curversion % 100));
1097 PyModule_AddObject(
mod,
"with_osl", Py_False);
1098 Py_INCREF(Py_False);
1099 PyModule_AddStringConstant(
mod,
"osl_version",
"unknown");
1100 PyModule_AddStringConstant(
mod,
"osl_version_string",
"unknown");
1103 #ifdef WITH_CYCLES_DEBUG
1104 PyModule_AddObject(
mod,
"with_cycles_debug", Py_True);
1107 PyModule_AddObject(
mod,
"with_cycles_debug", Py_False);
1108 Py_INCREF(Py_False);
1112 PyModule_AddObject(
mod,
"with_network", Py_True);
1115 PyModule_AddObject(
mod,
"with_network", Py_False);
1116 Py_INCREF(Py_False);
1120 PyModule_AddObject(
mod,
"with_embree", Py_True);
1123 PyModule_AddObject(
mod,
"with_embree", Py_False);
1124 Py_INCREF(Py_False);
1128 PyModule_AddObject(
mod,
"with_openimagedenoise", Py_True);
1132 PyModule_AddObject(
mod,
"with_openimagedenoise", Py_False);
1133 Py_INCREF(Py_False);
struct Depsgraph Depsgraph
struct RegionView3D RegionView3D
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum query
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
struct RenderEngine RenderEngine
StructRNA RNA_SpaceView3D
StructRNA RNA_RenderEngine
StructRNA RNA_Preferences
StructRNA RNA_ShaderNodeScript
DeviceInfo blender_device_info(BL::Preferences &b_preferences, BL::Scene &b_scene, bool background)
static PyObject * available_devices_func(PyObject *, PyObject *args)
CCL_NAMESPACE_END void * CCL_python_module_init()
void python_thread_state_restore(void **python_thread_state)
static PyObject * draw_func(PyObject *, PyObject *args)
static PyObject * create_func(PyObject *, PyObject *args)
static PyObject * debug_flags_reset_func(PyObject *, PyObject *)
static PyObject * set_device_override_func(PyObject *, PyObject *arg)
static PyObject * sync_func(PyObject *, PyObject *args)
static struct PyModuleDef module
static PyObject * debug_flags_update_func(PyObject *, PyObject *args)
static bool image_parse_filepaths(PyObject *pyfilepaths, vector< string > &filepaths)
static PyMethodDef methods[]
static PyObject * clear_resumable_chunk_func(PyObject *, PyObject *)
static PyObject * merge_func(PyObject *, PyObject *args, PyObject *keywords)
static PyObject * set_resumable_chunk_func(PyObject *, PyObject *args)
static PyObject * render_func(PyObject *, PyObject *args)
static PyObject * enable_print_stats_func(PyObject *, PyObject *)
static PyObject * system_info_func(PyObject *, PyObject *)
static PyObject * exit_func(PyObject *, PyObject *)
static const char * PyC_UnicodeAsByte(PyObject *py_str, PyObject **coerce)
void python_thread_state_save(void **python_thread_state)
static PyObject * get_device_types_func(PyObject *, PyObject *)
static PyObject * denoise_func(PyObject *, PyObject *args, PyObject *keywords)
static PyObject * free_func(PyObject *, PyObject *value)
static PyObject * set_resumable_chunk_range_func(PyObject *, PyObject *args)
static PyObject * reset_func(PyObject *, PyObject *args)
static PyObject * bake_func(PyObject *, PyObject *args)
static PyObject * init_func(PyObject *, PyObject *args)
static float get_float(PointerRNA &ptr, const char *name)
static bool get_boolean(PointerRNA &ptr, const char *name)
static void set_float3(PointerRNA &ptr, const char *name, float3 value)
static int get_int(PointerRNA &ptr, const char *name)
static int get_enum(PointerRNA &ptr, const char *name, int num_values=-1, int default_value=-1)
static void set_float4(PointerRNA &ptr, const char *name, float4 value)
static void set_int(PointerRNA &ptr, const char *name, int value)
static void set_float(PointerRNA &ptr, const char *name, float value)
static void set_string(PointerRNA &ptr, const char *name, const string &value)
SIMD_FORCE_INLINE btScalar length(const btQuaternion &q)
Return the length of a quaternion.
CCL_NAMESPACE_BEGIN typedef KernelBVHLayout BVHLayout
static bool print_render_stats
void synchronize(BL::Depsgraph &b_depsgraph)
static int end_resumable_chunk
void * python_thread_state
static int start_resumable_chunk
static int current_resumable_chunk
void reset_session(BL::BlendData &b_data, BL::Depsgraph &b_depsgraph)
void bake(BL::Depsgraph &b_depsgrah, BL::Object &b_object, const string &pass_type, const int custom_flag, const int bake_width, const int bake_height)
void render(BL::Depsgraph &b_depsgraph)
static int num_resumable_chunks
static DeviceTypeMask device_override
bool running_inside_blender
static void free_memory()
static vector< DeviceInfo > available_devices(uint device_type_mask=DEVICE_MASK_ALL)
static DeviceType type_from_string(const char *name)
static string device_capabilities(uint device_type_mask=DEVICE_MASK_ALL)
static vector< DeviceType > available_types()
static string string_from_type(DeviceType type)
void append(const uint8_t *data, int size)
static void free_memory()
static void free_memory()
#define DEVICE_MASK(type)
bool device_opencl_compile_kernel(const vector< string > ¶meters)
static KeywordTokenDef keyword_list[]
#define CCL_NAMESPACE_END
#define make_float4(x, y, z, w)
double parameters[NUM_PARAMETERS]
bool debug_flags_sync_from_scene(BL::Scene b_scene)
void * pylong_as_voidptr_typesafe(PyObject *object)
PyObject * pyunicode_from_string(const char *str)
static const VertexNature POINT
Vector< CPUDevice > devices
list of all CPUDevices. for every hardware thread an instance of CPUDevice is created
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name)
void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr)
const PointerRNA PointerRNA_NULL
void RNA_main_pointer_create(struct Main *main, PointerRNA *r_ptr)
DebugFlags & DebugFlags()
ccl_device_inline int mod(int x, int m)
ccl_device_inline float3 float4_to_float3(const float4 a)
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
static CCL_NAMESPACE_BEGIN bool openimagedenoise_supported()
void path_init(const string &path, const string &user_path)
bool string_endswith(const string &s, const string &end)