Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/blender/blender_python.cpp
| Show First 20 Lines • Show All 776 Lines • ▼ Show 20 Lines | static PyObject *denoise_func(PyObject * /*self*/, PyObject *args, PyObject *keywords) | ||||
| } | } | ||||
| if (input.size() != output.size()) { | if (input.size() != output.size()) { | ||||
| PyErr_SetString(PyExc_ValueError, "Number of input and output file paths does not match."); | PyErr_SetString(PyExc_ValueError, "Number of input and output file paths does not match."); | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| /* Create denoiser. */ | /* Create denoiser. */ | ||||
| Denoiser denoiser(device); | Denoiser denoiser(device); | ||||
| denoiser.params = params; | denoiser.set_params(params); | ||||
| denoiser.input = input; | denoiser.set_input(input); | ||||
| denoiser.output = output; | denoiser.set_output(output); | ||||
| if (tile_size > 0) { | if (tile_size > 0) { | ||||
| denoiser.tile_size = make_int2(tile_size, tile_size); | denoiser.set_tile_size(make_int2(tile_size, tile_size)); | ||||
| } | } | ||||
| if (samples > 0) { | if (samples > 0) { | ||||
| denoiser.samples_override = samples; | denoiser.set_samples_override(samples); | ||||
| } | } | ||||
| /* Run denoiser. */ | /* Run denoiser. */ | ||||
| if (!denoiser.run()) { | if (!denoiser.run()) { | ||||
| PyErr_SetString(PyExc_ValueError, denoiser.error.c_str()); | PyErr_SetString(PyExc_ValueError, denoiser.get_error().c_str()); | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| Py_RETURN_NONE; | Py_RETURN_NONE; | ||||
| } | } | ||||
| static PyObject *merge_func(PyObject * /*self*/, PyObject *args, PyObject *keywords) | static PyObject *merge_func(PyObject * /*self*/, PyObject *args, PyObject *keywords) | ||||
| { | { | ||||
| Show All 15 Lines | static PyObject *merge_func(PyObject * /*self*/, PyObject *args, PyObject *keywords) | ||||
| if (!PyUnicode_Check(pyoutput)) { | if (!PyUnicode_Check(pyoutput)) { | ||||
| PyErr_SetString(PyExc_ValueError, "Output must be a string."); | PyErr_SetString(PyExc_ValueError, "Output must be a string."); | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| string output = PyUnicode_AsUTF8(pyoutput); | string output = PyUnicode_AsUTF8(pyoutput); | ||||
| /* Merge. */ | /* Merge. */ | ||||
| ImageMerger merger; | ImageMerger merger; | ||||
| merger.input = input; | merger.set_input(input); | ||||
| merger.output = output; | merger.set_output(output); | ||||
| if (!merger.run()) { | if (!merger.run()) { | ||||
| PyErr_SetString(PyExc_ValueError, merger.error.c_str()); | PyErr_SetString(PyExc_ValueError, merger.get_error().c_str()); | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| Py_RETURN_NONE; | Py_RETURN_NONE; | ||||
| } | } | ||||
| static PyObject *debug_flags_update_func(PyObject * /*self*/, PyObject *args) | static PyObject *debug_flags_update_func(PyObject * /*self*/, PyObject *args) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 294 Lines • Show Last 20 Lines | |||||