Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/blender/blender_python.cpp
| Show First 20 Lines • Show All 256 Lines • ▼ Show 20 Lines | static PyObject *render_func(PyObject * /*self*/, PyObject *args) | ||||
| session->render(b_depsgraph); | session->render(b_depsgraph); | ||||
| python_thread_state_restore(&session->python_thread_state); | python_thread_state_restore(&session->python_thread_state); | ||||
| Py_RETURN_NONE; | Py_RETURN_NONE; | ||||
| } | } | ||||
| static PyObject *draw_func(PyObject * /*self*/, PyObject *args) | |||||
| { | |||||
| PyObject *py_session, *py_graph, *py_screen, *py_space_image; | |||||
| if (!PyArg_ParseTuple(args, "OOOO", &py_session, &py_graph, &py_screen, &py_space_image)) { | |||||
| return nullptr; | |||||
| } | |||||
| BlenderSession *session = (BlenderSession *)PyLong_AsVoidPtr(py_session); | |||||
| ID *b_screen = (ID *)PyLong_AsVoidPtr(py_screen); | |||||
| PointerRNA b_space_image_ptr; | |||||
| RNA_pointer_create(b_screen, | |||||
| &RNA_SpaceImageEditor, | |||||
| pylong_as_voidptr_typesafe(py_space_image), | |||||
| &b_space_image_ptr); | |||||
| BL::SpaceImageEditor b_space_image(b_space_image_ptr); | |||||
| session->draw(b_space_image); | |||||
| Py_RETURN_NONE; | |||||
| } | |||||
| /* pixel_array and result passed as pointers */ | /* pixel_array and result passed as pointers */ | ||||
| static PyObject *bake_func(PyObject * /*self*/, PyObject *args) | static PyObject *bake_func(PyObject * /*self*/, PyObject *args) | ||||
| { | { | ||||
| PyObject *pysession, *pydepsgraph, *pyobject; | PyObject *pysession, *pydepsgraph, *pyobject; | ||||
| const char *pass_type; | const char *pass_type; | ||||
| int pass_filter, width, height; | int pass_filter, width, height; | ||||
| if (!PyArg_ParseTuple(args, | if (!PyArg_ParseTuple(args, | ||||
| ▲ Show 20 Lines • Show All 717 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static PyMethodDef methods[] = { | static PyMethodDef methods[] = { | ||||
| {"init", init_func, METH_VARARGS, ""}, | {"init", init_func, METH_VARARGS, ""}, | ||||
| {"exit", exit_func, METH_VARARGS, ""}, | {"exit", exit_func, METH_VARARGS, ""}, | ||||
| {"create", create_func, METH_VARARGS, ""}, | {"create", create_func, METH_VARARGS, ""}, | ||||
| {"free", free_func, METH_O, ""}, | {"free", free_func, METH_O, ""}, | ||||
| {"render", render_func, METH_VARARGS, ""}, | {"render", render_func, METH_VARARGS, ""}, | ||||
| {"draw", draw_func, METH_VARARGS, ""}, | |||||
| {"bake", bake_func, METH_VARARGS, ""}, | {"bake", bake_func, METH_VARARGS, ""}, | ||||
| {"view_draw", view_draw_func, METH_VARARGS, ""}, | {"view_draw", view_draw_func, METH_VARARGS, ""}, | ||||
| {"sync", sync_func, METH_VARARGS, ""}, | {"sync", sync_func, METH_VARARGS, ""}, | ||||
| {"reset", reset_func, METH_VARARGS, ""}, | {"reset", reset_func, METH_VARARGS, ""}, | ||||
| #ifdef WITH_OSL | #ifdef WITH_OSL | ||||
| {"osl_update_node", osl_update_node_func, METH_VARARGS, ""}, | {"osl_update_node", osl_update_node_func, METH_VARARGS, ""}, | ||||
| {"osl_compile", osl_compile_func, METH_VARARGS, ""}, | {"osl_compile", osl_compile_func, METH_VARARGS, ""}, | ||||
| #endif | #endif | ||||
| ▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines | |||||