Merge branch 'master' into blender2.8

This commit is contained in:
Campbell Barton 2018-06-26 09:34:13 +02:00
commit ea339dc62c
18 changed files with 73 additions and 16 deletions

View File

@ -21,7 +21,10 @@
#ifdef WITH_OSL
/* So no context pollution happens from indirectly included windows.h */
# include "util/util_windows.h"
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdeprecated-register"
# include <OSL/oslexec.h>
# pragma clang diagnostic pop
#endif
#include "device/device.h"

View File

@ -30,8 +30,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-register"
#pragma clang diagnostic ignored "-Wexpansion-to-defined"
#include <OSL/genclosure.h>
#include <OSL/oslclosure.h>
#pragma clang diagnostic pop
#include "kernel/osl/osl_closures.h"
#include "kernel/osl/osl_shader.h"

View File

@ -14,7 +14,10 @@
* limitations under the License.
*/
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-register"
#include <OSL/oslexec.h>
#pragma clang diagnostic pop
#include "kernel/kernel_compat_cpu.h"
#include "kernel/kernel_montecarlo.h"

View File

@ -587,7 +587,7 @@ void LightManager::device_update_background(Device *device,
double time_start = time_dt();
if(max(res.x, res.y) < 512) {
/* Small enough resolution, faster to do single-threaded. */
background_cdf(0, res.x, res.x, res.y, &pixels, cond_cdf);
background_cdf(0, res.y, res.x, res.y, &pixels, cond_cdf);
}
else {
/* Threaded evaluation for large resolution. */

View File

@ -20,7 +20,10 @@
#ifdef WITH_OSL
/* So no context pollution happens from indirectly included windows.h */
# include "util/util_windows.h"
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdeprecated-register"
# include <OSL/oslexec.h>
# pragma clang diagnostic pop
#endif
#include "render/attribute.h"

View File

@ -19,7 +19,11 @@
/* OpenImageIO is used for all image file reading and writing. */
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-register"
#pragma clang diagnostic ignored "-Wexpansion-to-defined"
#include <OpenImageIO/imageio.h>
#pragma clang diagnostic pop
#include "util/util_vector.h"

View File

@ -20,9 +20,13 @@
/* Parameter value lists from OpenImageIO are used to store custom properties
* on various data, which can then later be used in shaders. */
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-register"
#pragma clang diagnostic ignored "-Wexpansion-to-defined"
#include <OpenImageIO/paramlist.h>
#include <OpenImageIO/typedesc.h>
#include <OpenImageIO/ustring.h>
#pragma clang diagnostic pop
CCL_NAMESPACE_BEGIN

View File

@ -40,6 +40,9 @@
#include <algorithm>
#include <iostream>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-register"
#include <half.h>
#include <Iex.h>
#include <ImfVersion.h>
@ -64,6 +67,7 @@
#include <ImfTiledOutputPart.h>
#include <ImfPartType.h>
#include <ImfPartHelper.h>
#pragma clang diagnostic pop
#include "DNA_scene_types.h" /* For OpenEXR compression constants */

View File

@ -45,6 +45,8 @@
#include <errno.h>
#include "BLI_fileops.h"
static PyObject *Py_ImBuf_CreatePyObject(ImBuf *ibuf);
/* -------------------------------------------------------------------- */
/** \name Type & Utilities
* \{ */
@ -109,6 +111,27 @@ static PyObject *py_imbuf_resize(Py_ImBuf *self, PyObject *args, PyObject *kw)
Py_RETURN_NONE;
}
PyDoc_STRVAR(py_imbuf_copy_doc,
".. method:: copy()\n"
"\n"
" :return: A copy of the image.\n"
" :rtype: :class:`ImBuf`\n"
);
static PyObject *py_imbuf_copy(Py_ImBuf *self)
{
PY_IMBUF_CHECK_OBJ(self);
return Py_ImBuf_CreatePyObject(self->ibuf);
}
static PyObject *py_imbuf_deepcopy(Py_ImBuf *self, PyObject *args)
{
if (!PyC_CheckArgs_DeepCopy(args)) {
return NULL;
}
return py_imbuf_copy(self);
}
PyDoc_STRVAR(py_imbuf_free_doc,
".. method:: free()\n"
"\n"
@ -126,6 +149,9 @@ static PyObject *py_imbuf_free(Py_ImBuf *self)
static struct PyMethodDef Py_ImBuf_methods[] = {
{"resize", (PyCFunction)py_imbuf_resize, METH_VARARGS | METH_KEYWORDS, (char *)py_imbuf_resize_doc},
{"free", (PyCFunction)py_imbuf_free, METH_NOARGS, (char *)py_imbuf_free_doc},
{"copy", (PyCFunction)py_imbuf_copy, METH_NOARGS, (char *)py_imbuf_copy_doc},
{"__copy__", (PyCFunction)py_imbuf_copy, METH_NOARGS, (char *)py_imbuf_copy_doc},
{"__deepcopy__", (PyCFunction)py_imbuf_deepcopy, METH_VARARGS, (char *)py_imbuf_copy_doc},
{NULL, NULL, 0, NULL}
};

View File

@ -230,6 +230,12 @@ int PyC_ParseBool(PyObject *o, void *p)
return 1;
}
/* silly function, we dont use arg. just check its compatible with __deepcopy__ */
int PyC_CheckArgs_DeepCopy(PyObject *args)
{
PyObject *dummy_pydict;
return PyArg_ParseTuple(args, "|O!:__deepcopy__", &PyDict_Type, &dummy_pydict) != 0;
}
#ifndef MATH_STANDALONE

View File

@ -106,6 +106,7 @@ bool PyC_RunString_AsString(const char *expr, const char *filename, char **r_val
int PyC_ParseBool(PyObject *o, void *p);
int PyC_CheckArgs_DeepCopy(PyObject *args);
/* Integer parsing (with overflow checks), -1 on error. */
int PyC_Long_AsBool(PyObject *value);

View File

@ -419,13 +419,6 @@ PyObject *mathutils_dynstr_to_py(struct DynStr *ds)
}
#endif
/* silly function, we dont use arg. just check its compatible with __deepcopy__ */
int mathutils_deepcopy_args_check(PyObject *args)
{
PyObject *dummy_pydict;
return PyArg_ParseTuple(args, "|O!:__deepcopy__", &PyDict_Type, &dummy_pydict) != 0;
}
/* Mathutils Callbacks */
/* for mathutils internal use only, eventually should re-alloc but to start with we only have a few users */

View File

@ -174,6 +174,4 @@ int column_vector_multiplication(float rvec[4], VectorObject *vec, MatrixObject
PyObject *mathutils_dynstr_to_py(struct DynStr *ds);
#endif
int mathutils_deepcopy_args_check(PyObject *args);
#endif /* __MATHUTILS_H__ */

View File

@ -33,6 +33,7 @@
#include "BLI_utildefines.h"
#include "../generic/python_utildefines.h"
#include "../generic/py_capi_utils.h"
#ifndef MATH_STANDALONE
# include "BLI_dynstr.h"
@ -113,8 +114,9 @@ static PyObject *Color_copy(ColorObject *self)
}
static PyObject *Color_deepcopy(ColorObject *self, PyObject *args)
{
if (!mathutils_deepcopy_args_check(args))
if (!PyC_CheckArgs_DeepCopy(args)) {
return NULL;
}
return Color_copy(self);
}

View File

@ -32,6 +32,7 @@
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "../generic/python_utildefines.h"
#include "../generic/py_capi_utils.h"
#ifndef MATH_STANDALONE
# include "BLI_dynstr.h"
@ -312,8 +313,9 @@ static PyObject *Euler_copy(EulerObject *self)
}
static PyObject *Euler_deepcopy(EulerObject *self, PyObject *args)
{
if (!mathutils_deepcopy_args_check(args))
if (!PyC_CheckArgs_DeepCopy(args)) {
return NULL;
}
return Euler_copy(self);
}

View File

@ -33,6 +33,7 @@
#include "BLI_utildefines.h"
#include "../generic/python_utildefines.h"
#include "../generic/py_capi_utils.h"
#ifndef MATH_STANDALONE
# include "BLI_string.h"
@ -1945,8 +1946,9 @@ static PyObject *Matrix_copy(MatrixObject *self)
}
static PyObject *Matrix_deepcopy(MatrixObject *self, PyObject *args)
{
if (!mathutils_deepcopy_args_check(args))
if (!PyC_CheckArgs_DeepCopy(args)) {
return NULL;
}
return Matrix_copy(self);
}

View File

@ -33,6 +33,7 @@
#include "BLI_utildefines.h"
#include "../generic/python_utildefines.h"
#include "../generic/py_capi_utils.h"
#ifndef MATH_STANDALONE
# include "BLI_dynstr.h"
@ -496,8 +497,9 @@ static PyObject *Quaternion_copy(QuaternionObject *self)
}
static PyObject *Quaternion_deepcopy(QuaternionObject *self, PyObject *args)
{
if (!mathutils_deepcopy_args_check(args))
if (!PyC_CheckArgs_DeepCopy(args)) {
return NULL;
}
return Quaternion_copy(self);
}
@ -1393,4 +1395,3 @@ PyObject *Quaternion_CreatePyObject_cb(PyObject *cb_user,
return (PyObject *)self;
}

View File

@ -1331,8 +1331,9 @@ static PyObject *Vector_copy(VectorObject *self)
}
static PyObject *Vector_deepcopy(VectorObject *self, PyObject *args)
{
if (!mathutils_deepcopy_args_check(args))
if (!PyC_CheckArgs_DeepCopy(args)) {
return NULL;
}
return Vector_copy(self);
}