Merge branch 'master' into blender2.8

This commit is contained in:
Campbell Barton 2017-08-22 18:18:38 +10:00
commit bd935b5aed
23 changed files with 155 additions and 155 deletions

@ -397,6 +397,8 @@ class CyclesRender_PT_performance(CyclesButtonsPanel, Panel):
sub.enabled = rd.threads_mode == 'FIXED'
sub.prop(rd, "threads")
col.separator()
sub = col.column(align=True)
sub.label(text="Tiles:")
sub.prop(cscene, "tile_order", text="")
@ -406,20 +408,10 @@ class CyclesRender_PT_performance(CyclesButtonsPanel, Panel):
sub.prop(cscene, "use_progressive_refine")
subsub = sub.column(align=True)
subsub.prop(rd, "use_save_buffers")
col = split.column(align=True)
col.label(text="Viewport:")
col.prop(cscene, "debug_bvh_type", text="")
col.separator()
col.prop(cscene, "preview_start_resolution")
col.prop(rd, "preview_pixel_size", text="")
col.separator()
col = split.column()
col.label(text="Final Render:")
col.prop(rd, "use_save_buffers")
col.prop(rd, "use_persistent_data", text="Persistent Images")
col.separator()
@ -432,6 +424,12 @@ class CyclesRender_PT_performance(CyclesButtonsPanel, Panel):
row.active = not cscene.debug_use_spatial_splits
row.prop(cscene, "debug_bvh_time_steps")
col = layout.column()
col.label(text="Viewport Resolution:")
split = col.split()
split.prop(rd, "preview_pixel_size", text="")
split.prop(cscene, "preview_start_resolution")
class CyclesRender_PT_layer_options(CyclesButtonsPanel, Panel):
bl_label = "Layer"
@ -1575,11 +1573,15 @@ class CyclesRender_PT_debug(CyclesButtonsPanel, Panel):
col.prop(cscene, "debug_use_qbvh")
col.prop(cscene, "debug_use_cpu_split_kernel")
col.separator()
col = layout.column()
col.label('CUDA Flags:')
col.prop(cscene, "debug_use_cuda_adaptive_compile")
col.prop(cscene, "debug_use_cuda_split_kernel")
col.separator()
col = layout.column()
col.label('OpenCL Flags:')
col.prop(cscene, "debug_opencl_kernel_type", text="Kernel")
@ -1588,6 +1590,11 @@ class CyclesRender_PT_debug(CyclesButtonsPanel, Panel):
col.prop(cscene, "debug_use_opencl_debug", text="Debug")
col.prop(cscene, "debug_opencl_mem_limit")
col.separator()
col = layout.column()
col.prop(cscene, "debug_bvh_type")
class CyclesParticle_PT_CurveSettings(CyclesButtonsPanel, Panel):
bl_label = "Cycles Hair Settings"

@ -60,6 +60,8 @@ bool debug_flags_sync_from_scene(BL::Scene b_scene)
/* Backup some settings for comparison. */
DebugFlags::OpenCL::DeviceType opencl_device_type = flags.opencl.device_type;
DebugFlags::OpenCL::KernelType opencl_kernel_type = flags.opencl.kernel_type;
/* Synchronize shared flags. */
flags.viewport_static_bvh = get_enum(cscene, "debug_bvh_type");
/* Synchronize CPU flags. */
flags.cpu.avx2 = get_boolean(cscene, "debug_use_cpu_avx2");
flags.cpu.avx = get_boolean(cscene, "debug_use_cpu_avx");

@ -611,14 +611,10 @@ SceneParams BlenderSync::get_scene_params(BL::Scene& b_scene,
else if(shadingsystem == 1)
params.shadingsystem = SHADINGSYSTEM_OSL;
if(background)
if(background || DebugFlags().viewport_static_bvh)
params.bvh_type = SceneParams::BVH_STATIC;
else
params.bvh_type = (SceneParams::BVHType)get_enum(
cscene,
"debug_bvh_type",
SceneParams::BVH_NUM_TYPES,
SceneParams::BVH_STATIC);
params.bvh_type = SceneParams::BVH_DYNAMIC;
params.use_bvh_spatial_split = RNA_boolean_get(&cscene, "debug_use_spatial_splits");
params.use_bvh_unaligned_nodes = RNA_boolean_get(&cscene, "debug_use_hair_bvh");

@ -75,7 +75,6 @@ ccl_device void kernel_buffer_update(KernelGlobals *kg,
if(ray_index != QUEUE_EMPTY_SLOT) {
#endif
ccl_global uint *rng_state = kernel_split_params.rng_state;
int stride = kernel_split_params.stride;
ccl_global char *ray_state = kernel_split_state.ray_state;
@ -83,29 +82,17 @@ ccl_device void kernel_buffer_update(KernelGlobals *kg,
PathRadiance *L = &kernel_split_state.path_radiance[ray_index];
ccl_global Ray *ray = &kernel_split_state.ray[ray_index];
ccl_global float3 *throughput = &kernel_split_state.throughput[ray_index];
ccl_global float *buffer = kernel_split_params.buffer;
unsigned int work_index;
ccl_global uint *initial_rng;
unsigned int sample;
unsigned int tile_x;
unsigned int tile_y;
unsigned int pixel_x;
unsigned int pixel_y;
work_index = kernel_split_state.work_array[ray_index];
sample = get_work_sample(kg, work_index, ray_index) + kernel_split_params.start_sample;
get_work_pixel_tile_position(kg, &pixel_x, &pixel_y,
&tile_x, &tile_y,
work_index,
ray_index);
initial_rng = rng_state;
rng_state += kernel_split_params.offset + pixel_x + pixel_y*stride;
buffer += (kernel_split_params.offset + pixel_x + pixel_y*stride) * kernel_data.film.pass_stride;
if(IS_STATE(ray_state, ray_index, RAY_UPDATE_BUFFER)) {
uint work_index = kernel_split_state.work_array[ray_index];
uint sample = get_work_sample(kg, work_index, ray_index) + kernel_split_params.start_sample;
uint tile_x, tile_y, pixel_x, pixel_y;
get_work_pixel_tile_position(kg, &pixel_x, &pixel_y, &tile_x, &tile_y, work_index, ray_index);
ccl_global float *buffer = kernel_split_params.buffer;
buffer += (kernel_split_params.offset + pixel_x + pixel_y*stride) * kernel_data.film.pass_stride;
/* accumulate result in output buffer */
bool is_shadow_catcher = (state->flag & PATH_RAY_SHADOW_CATCHER);
kernel_write_result(kg, buffer, sample, L, is_shadow_catcher);
@ -115,6 +102,7 @@ ccl_device void kernel_buffer_update(KernelGlobals *kg,
if(IS_STATE(ray_state, ray_index, RAY_TO_REGENERATE)) {
/* We have completed current work; So get next work */
uint work_index;
int valid_work = get_next_work(kg, &work_index, ray_index);
if(!valid_work) {
/* If work is invalid, this means no more work is available and the thread may exit */
@ -124,13 +112,17 @@ ccl_device void kernel_buffer_update(KernelGlobals *kg,
if(IS_STATE(ray_state, ray_index, RAY_TO_REGENERATE)) {
kernel_split_state.work_array[ray_index] = work_index;
/* Get the sample associated with the current work */
sample = get_work_sample(kg, work_index, ray_index) + kernel_split_params.start_sample;
uint sample = get_work_sample(kg, work_index, ray_index) + kernel_split_params.start_sample;
/* Get pixel and tile position associated with current work */
uint tile_x, tile_y, pixel_x, pixel_y;
get_work_pixel_tile_position(kg, &pixel_x, &pixel_y, &tile_x, &tile_y, work_index, ray_index);
/* Remap rng_state according to the current work */
rng_state = initial_rng + kernel_split_params.offset + pixel_x + pixel_y*stride;
ccl_global uint *rng_state = kernel_split_params.rng_state;
rng_state += kernel_split_params.offset + pixel_x + pixel_y*stride;
/* Remap buffer according to the current work */
ccl_global float *buffer = kernel_split_params.buffer;
buffer += (kernel_split_params.offset + pixel_x + pixel_y*stride) * kernel_data.film.pass_stride;
/* Initialize random numbers and ray. */

@ -92,28 +92,19 @@ ccl_device void kernel_holdout_emission_blurring_pathtermination_ao(
int stride = kernel_split_params.stride;
unsigned int work_index;
unsigned int pixel_x;
unsigned int pixel_y;
unsigned int tile_x;
unsigned int tile_y;
unsigned int sample;
ccl_global PathState *state = 0x0;
float3 throughput;
uint sample;
ccl_global char *ray_state = kernel_split_state.ray_state;
ShaderData *sd = &kernel_split_state.sd[ray_index];
ccl_global float *buffer = kernel_split_params.buffer;
if(IS_STATE(ray_state, ray_index, RAY_ACTIVE)) {
throughput = kernel_split_state.throughput[ray_index];
state = &kernel_split_state.path_state[ray_index];
work_index = kernel_split_state.work_array[ray_index];
uint work_index = kernel_split_state.work_array[ray_index];
sample = get_work_sample(kg, work_index, ray_index) + kernel_split_params.start_sample;
uint pixel_x, pixel_y, tile_x, tile_y;
get_work_pixel_tile_position(kg, &pixel_x, &pixel_y,
&tile_x, &tile_y,
work_index,
@ -121,6 +112,9 @@ ccl_device void kernel_holdout_emission_blurring_pathtermination_ao(
buffer += (kernel_split_params.offset + pixel_x + pixel_y * stride) * kernel_data.film.pass_stride;
throughput = kernel_split_state.throughput[ray_index];
state = &kernel_split_state.path_state[ray_index];
#ifdef __SHADOW_TRICKS__
if((sd->object_flag & SD_OBJECT_SHADOW_CATCHER)) {
if(state->flag & PATH_RAY_CAMERA) {

@ -29,13 +29,7 @@ ccl_device void kernel_path_init(KernelGlobals *kg) {
*/
kernel_split_state.ray_state[ray_index] = RAY_ACTIVE;
unsigned int my_sample;
unsigned int pixel_x;
unsigned int pixel_y;
unsigned int tile_x;
unsigned int tile_y;
unsigned int work_index = 0;
uint work_index = 0;
/* Get work. */
if(!get_next_work(kg, &work_index, ray_index)) {
/* No more work, mark ray as inactive */
@ -45,9 +39,10 @@ ccl_device void kernel_path_init(KernelGlobals *kg) {
}
/* Get the sample associated with the work. */
my_sample = get_work_sample(kg, work_index, ray_index) + kernel_split_params.start_sample;
uint sample = get_work_sample(kg, work_index, ray_index) + kernel_split_params.start_sample;
/* Get pixel and tile position associated with the work. */
uint pixel_x, pixel_y, tile_x, tile_y;
get_work_pixel_tile_position(kg, &pixel_x, &pixel_y,
&tile_x, &tile_y,
work_index,
@ -60,12 +55,11 @@ ccl_device void kernel_path_init(KernelGlobals *kg) {
ccl_global float *buffer = kernel_split_params.buffer;
buffer += (kernel_split_params.offset + pixel_x + pixel_y * kernel_split_params.stride) * kernel_data.film.pass_stride;
uint rng_hash;
/* Initialize random numbers and ray. */
uint rng_hash;
kernel_path_trace_setup(kg,
rng_state,
my_sample,
sample,
pixel_x, pixel_y,
&rng_hash,
&kernel_split_state.ray[ray_index]);
@ -80,7 +74,7 @@ ccl_device void kernel_path_init(KernelGlobals *kg) {
&kernel_split_state.sd_DL_shadow[ray_index],
&kernel_split_state.path_state[ray_index],
rng_hash,
my_sample,
sample,
&kernel_split_state.ray[ray_index]);
#ifdef __SUBSURFACE__
kernel_path_subsurface_init_indirect(&kernel_split_state.ss_rays[ray_index]);
@ -90,7 +84,7 @@ ccl_device void kernel_path_init(KernelGlobals *kg) {
/* These rays do not participate in path-iteration. */
float4 L_rad = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
/* Accumulate result in output buffer. */
kernel_write_pass_float4(buffer, my_sample, L_rad);
kernel_write_pass_float4(buffer, sample, L_rad);
ASSIGN_RAY_STATE(kernel_split_state.ray_state, ray_index, RAY_TO_REGENERATE);
}
}

@ -122,13 +122,16 @@ void DebugFlags::OpenCL::reset()
}
DebugFlags::DebugFlags()
: viewport_static_bvh(false)
{
/* Nothing for now. */
}
void DebugFlags::reset()
{
viewport_static_bvh = false;
cpu.reset();
cuda.reset();
opencl.reset();
}

@ -30,6 +30,9 @@ CCL_NAMESPACE_BEGIN
*/
class DebugFlags {
public:
/* Use static BVH in viewport, to match final render exactly. */
bool viewport_static_bvh;
/* Descriptor of CPU feature-set to be used. */
struct CPU {
CPU();

@ -848,6 +848,7 @@ static ImBuf *accessor_get_ibuf(TrackingImageAccessor *accessor,
region,
transform_key,
final_ibuf);
BLI_spin_unlock(&accessor->cache_lock);
return final_ibuf;
}
@ -991,5 +992,6 @@ void tracking_image_accessor_destroy(TrackingImageAccessor *accessor)
{
IMB_moviecache_free(accessor->cache);
libmv_FrameAccessorDestroy(accessor->libmv_accessor);
BLI_spin_end(&accessor->cache_lock);
MEM_freeN(accessor);
}

@ -127,54 +127,52 @@ int PyC_AsArray(
return ret;
}
/* -------------------------------------------------------------------- */
/** \name Typed Tuple Packing
*
* \note See #PyC_Tuple_Pack_* macros that take multiple arguments.
*
* \{ */
/* array utility function */
PyObject *PyC_FromArray(const void *array, int length, const PyTypeObject *type,
const bool is_double, const char *error_prefix)
PyObject *PyC_Tuple_PackArray_F32(const float *array, uint len)
{
PyObject *tuple;
int i;
tuple = PyTuple_New(length);
/* for each type */
if (type == &PyFloat_Type) {
if (is_double) {
const double *array_double = array;
for (i = 0; i < length; ++i) {
PyTuple_SET_ITEM(tuple, i, PyFloat_FromDouble(array_double[i]));
PyObject *tuple = PyTuple_New(len);
for (uint i = 0; i < len; i++) {
PyTuple_SET_ITEM(tuple, i, PyFloat_FromDouble(array[i]));
}
}
else {
const float *array_float = array;
for (i = 0; i < length; ++i) {
PyTuple_SET_ITEM(tuple, i, PyFloat_FromDouble(array_float[i]));
}
}
}
else if (type == &PyLong_Type) {
/* could use is_double for 'long int' but no use now */
const int *array_int = array;
for (i = 0; i < length; ++i) {
PyTuple_SET_ITEM(tuple, i, PyLong_FromLong(array_int[i]));
}
}
else if (type == &PyBool_Type) {
const int *array_bool = array;
for (i = 0; i < length; ++i) {
PyTuple_SET_ITEM(tuple, i, PyBool_FromLong(array_bool[i]));
}
}
else {
Py_DECREF(tuple);
PyErr_Format(PyExc_TypeError,
"%s: internal error %s is invalid",
error_prefix, type->tp_name);
return NULL;
}
return tuple;
}
PyObject *PyC_Tuple_PackArray_I32(const int *array, uint len)
{
PyObject *tuple = PyTuple_New(len);
for (uint i = 0; i < len; i++) {
PyTuple_SET_ITEM(tuple, i, PyLong_FromLong(array[i]));
}
return tuple;
}
PyObject *PyC_Tuple_PackArray_I32FromBool(const int *array, uint len)
{
PyObject *tuple = PyTuple_New(len);
for (uint i = 0; i < len; i++) {
PyTuple_SET_ITEM(tuple, i, PyBool_FromLong(array[i]));
}
return tuple;
}
PyObject *PyC_Tuple_PackArray_Bool(const bool *array, uint len)
{
PyObject *tuple = PyTuple_New(len);
for (uint i = 0; i < len; i++) {
PyTuple_SET_ITEM(tuple, i, PyBool_FromLong(array[i]));
}
return tuple;
}
/** \} */
/**
* Caller needs to ensure tuple is uninitialized.
* Handy for filling a tuple with None for eg.

@ -27,6 +27,8 @@
#ifndef __PY_CAPI_UTILS_H__
#define __PY_CAPI_UTILS_H__
#include "BLI_sys_types.h"
void PyC_ObSpit(const char *name, PyObject *var);
void PyC_LineSpit(void);
void PyC_StackSpit(void);
@ -43,8 +45,21 @@ int PyC_AsArray_FAST(
int PyC_AsArray(
void *array, PyObject *value, const Py_ssize_t length,
const PyTypeObject *type, const bool is_double, const char *error_prefix);
PyObject * PyC_FromArray(const void *array, int length, const PyTypeObject *type,
const bool is_double, const char *error_prefix);
PyObject *PyC_Tuple_PackArray_F32(const float *array, uint len);
PyObject *PyC_Tuple_PackArray_I32(const int *array, uint len);
PyObject *PyC_Tuple_PackArray_I32FromBool(const int *array, uint len);
PyObject *PyC_Tuple_PackArray_Bool(const bool *array, uint len);
#define PyC_Tuple_Pack_F32(...) \
PyC_Tuple_PackArray_F32(((const float []){__VA_ARGS__}), (sizeof((const float []){__VA_ARGS__}) / sizeof(float)))
#define PyC_Tuple_Pack_I32(...) \
PyC_Tuple_PackArray_I32(((const int []){__VA_ARGS__}), (sizeof((const int []){__VA_ARGS__}) / sizeof(int)))
#define PyC_Tuple_Pack_I32FromBool(...) \
PyC_Tuple_PackArray_I32FromBool(((const int []){__VA_ARGS__}), (sizeof((const int []){__VA_ARGS__}) / sizeof(int)))
#define PyC_Tuple_Pack_Bool(...) \
PyC_Tuple_PackArray_Bool(((const bool []){__VA_ARGS__}), (sizeof((const bool []){__VA_ARGS__}) / sizeof(bool)))
void PyC_Tuple_Fill(PyObject *tuple, PyObject *value);
void PyC_List_Fill(PyObject *list, PyObject *value);

@ -157,8 +157,7 @@ static PyObject *make_app_info(void)
#define SetObjItem(obj) \
PyStructSequence_SET_ITEM(app_info, pos++, obj)
SetObjItem(Py_BuildValue("(iii)",
BLENDER_VERSION / 100, BLENDER_VERSION % 100, BLENDER_SUBVERSION));
SetObjItem(PyC_Tuple_Pack_I32(BLENDER_VERSION / 100, BLENDER_VERSION % 100, BLENDER_SUBVERSION));
SetObjItem(PyUnicode_FromFormat("%d.%02d (sub %d)",
BLENDER_VERSION / 100, BLENDER_VERSION % 100, BLENDER_SUBVERSION));

@ -34,6 +34,8 @@
#include "bpy_app_alembic.h"
#include "../generic/py_capi_utils.h"
#ifdef WITH_ALEMBIC
# include "ABC_alembic.h"
#endif
@ -79,11 +81,11 @@ static PyObject *make_alembic_info(void)
const int patch = curversion - ((curversion / 100 ) * 100);
SetObjItem(PyBool_FromLong(1));
SetObjItem(Py_BuildValue("(iii)", major, minor, patch));
SetObjItem(PyC_Tuple_Pack_I32(major, minor, patch));
SetObjItem(PyUnicode_FromFormat("%2d, %2d, %2d", major, minor, patch));
#else
SetObjItem(PyBool_FromLong(0));
SetObjItem(Py_BuildValue("(iii)", 0, 0, 0));
SetObjItem(PyC_Tuple_Pack_I32(0, 0, 0));
SetStrItem("Unknown");
#endif

@ -29,6 +29,8 @@
#include "bpy_app_ffmpeg.h"
#include "../generic/py_capi_utils.h"
#ifdef WITH_FFMPEG
#include <libavcodec/avcodec.h>
#include <libavdevice/avdevice.h>
@ -91,8 +93,7 @@ static PyObject *make_ffmpeg_info(void)
#ifdef WITH_FFMPEG
# define FFMPEG_LIB_VERSION(lib) { \
curversion = lib ## _version(); \
SetObjItem(Py_BuildValue("(iii)", \
curversion >> 16, (curversion >> 8) % 256, curversion % 256)); \
SetObjItem(PyC_Tuple_Pack_I32(curversion >> 16, (curversion >> 8) % 256, curversion % 256)); \
SetObjItem(PyUnicode_FromFormat("%2d, %2d, %2d", \
curversion >> 16, (curversion >> 8) % 256, curversion % 256)); \
} (void)0

@ -29,6 +29,8 @@
#include "bpy_app_ocio.h"
#include "../generic/py_capi_utils.h"
#ifdef WITH_OCIO
# include "ocio_capi.h"
#endif
@ -74,13 +76,12 @@ static PyObject *make_ocio_info(void)
#ifdef WITH_OCIO
curversion = OCIO_getVersionHex();
SetObjItem(PyBool_FromLong(1));
SetObjItem(Py_BuildValue("(iii)",
curversion >> 24, (curversion >> 16) % 256, (curversion >> 8) % 256));
SetObjItem(PyC_Tuple_Pack_I32(curversion >> 24, (curversion >> 16) % 256, (curversion >> 8) % 256));
SetObjItem(PyUnicode_FromFormat("%2d, %2d, %2d",
curversion >> 24, (curversion >> 16) % 256, (curversion >> 8) % 256));
#else
SetObjItem(PyBool_FromLong(0));
SetObjItem(Py_BuildValue("(iii)", 0, 0, 0));
SetObjItem(PyC_Tuple_Pack_I32(0, 0, 0));
SetStrItem("Unknown");
#endif

@ -29,6 +29,8 @@
#include "bpy_app_oiio.h"
#include "../generic/py_capi_utils.h"
#ifdef WITH_OPENIMAGEIO
# include "openimageio_api.h"
#endif
@ -74,13 +76,12 @@ static PyObject *make_oiio_info(void)
#ifdef WITH_OPENIMAGEIO
curversion = OIIO_getVersionHex();
SetObjItem(PyBool_FromLong(1));
SetObjItem(Py_BuildValue("(iii)",
curversion / 10000, (curversion / 100) % 100, curversion % 100));
SetObjItem(PyC_Tuple_Pack_I32(curversion / 10000, (curversion / 100) % 100, curversion % 100));
SetObjItem(PyUnicode_FromFormat("%2d, %2d, %2d",
curversion / 10000, (curversion / 100) % 100, curversion % 100));
#else
SetObjItem(PyBool_FromLong(0));
SetObjItem(Py_BuildValue("(iii)", 0, 0, 0));
SetObjItem(PyC_Tuple_Pack_I32(0, 0, 0));
SetStrItem("Unknown");
#endif

@ -29,6 +29,8 @@
#include "bpy_app_opensubdiv.h"
#include "../generic/py_capi_utils.h"
#ifdef WITH_OPENSUBDIV
# include "opensubdiv_capi.h"
#endif
@ -70,13 +72,12 @@ static PyObject *make_opensubdiv_info(void)
#ifdef WITH_OPENSUBDIV
int curversion = openSubdiv_getVersionHex();
SetObjItem(PyBool_FromLong(1));
SetObjItem(Py_BuildValue("(iii)",
curversion / 10000, (curversion / 100) % 100, curversion % 100));
SetObjItem(PyC_Tuple_Pack_I32(curversion / 10000, (curversion / 100) % 100, curversion % 100));
SetObjItem(PyUnicode_FromFormat("%2d, %2d, %2d",
curversion / 10000, (curversion / 100) % 100, curversion % 100));
#else
SetObjItem(PyBool_FromLong(0));
SetObjItem(Py_BuildValue("(iii)", 0, 0, 0));
SetObjItem(PyC_Tuple_Pack_I32(0, 0, 0));
SetStrItem("Unknown");
#endif

@ -34,6 +34,8 @@
#include "bpy_app_openvdb.h"
#include "../generic/py_capi_utils.h"
#ifdef WITH_OPENVDB
# include "openvdb_capi.h"
#endif
@ -79,13 +81,12 @@ static PyObject *make_openvdb_info(void)
#ifdef WITH_OPENVDB
curversion = OpenVDB_getVersionHex();
SetObjItem(PyBool_FromLong(1));
SetObjItem(Py_BuildValue("(iii)",
curversion >> 24, (curversion >> 16) % 256, (curversion >> 8) % 256));
SetObjItem(PyC_Tuple_Pack_I32(curversion >> 24, (curversion >> 16) % 256, (curversion >> 8) % 256));
SetObjItem(PyUnicode_FromFormat("%2d, %2d, %2d",
curversion >> 24, (curversion >> 16) % 256, (curversion >> 8) % 256));
#else
SetObjItem(PyBool_FromLong(0));
SetObjItem(Py_BuildValue("(iii)", 0, 0, 0));
SetObjItem(PyC_Tuple_Pack_I32(0, 0, 0));
SetStrItem("Unknown");
#endif

@ -29,6 +29,8 @@
#include "bpy_app_sdl.h"
#include "../generic/py_capi_utils.h"
#ifdef WITH_SDL
/* SDL force defines __SSE__ and __SSE2__ flags, which generates warnings
* because we pass those defines via command line as well. For until there's
@ -103,7 +105,7 @@ static PyObject *make_sdl_info(void)
# endif
# endif
SetObjItem(Py_BuildValue("(iii)", version.major, version.minor, version.patch));
SetObjItem(PyC_Tuple_Pack_I32(version.major, version.minor, version.patch));
if (sdl_available) {
SetObjItem(PyUnicode_FromFormat("%d.%d.%d", version.major, version.minor, version.patch));
}
@ -114,7 +116,7 @@ static PyObject *make_sdl_info(void)
#else // WITH_SDL=OFF
SetObjItem(PyBool_FromLong(0));
SetObjItem(Py_BuildValue("(iii)", 0, 0, 0));
SetObjItem(PyC_Tuple_Pack_I32(0, 0, 0));
SetStrItem("Unknown");
SetObjItem(PyBool_FromLong(0));
#endif

@ -530,11 +530,7 @@ static void bpy_prop_boolean_array_set_cb(struct PointerRNA *ptr, struct Propert
self = pyrna_struct_as_instance(ptr);
PyTuple_SET_ITEM(args, 0, self);
py_values = PyC_FromArray(values, len, &PyBool_Type, false, "BoolVectorProperty set");
if (!py_values) {
printf_func_error(py_func);
}
else
py_values = PyC_Tuple_PackArray_I32FromBool(values, len);
PyTuple_SET_ITEM(args, 1, py_values);
ret = PyObject_CallObject(py_func, args);
@ -764,11 +760,7 @@ static void bpy_prop_int_array_set_cb(struct PointerRNA *ptr, struct PropertyRNA
self = pyrna_struct_as_instance(ptr);
PyTuple_SET_ITEM(args, 0, self);
py_values = PyC_FromArray(values, len, &PyLong_Type, false, "IntVectorProperty set");
if (!py_values) {
printf_func_error(py_func);
}
else
py_values = PyC_Tuple_PackArray_I32(values, len);
PyTuple_SET_ITEM(args, 1, py_values);
ret = PyObject_CallObject(py_func, args);
@ -998,11 +990,7 @@ static void bpy_prop_float_array_set_cb(struct PointerRNA *ptr, struct PropertyR
self = pyrna_struct_as_instance(ptr);
PyTuple_SET_ITEM(args, 0, self);
py_values = PyC_FromArray(values, len, &PyFloat_Type, false, "FloatVectorProperty set");
if (!py_values) {
printf_func_error(py_func);
}
else
py_values = PyC_Tuple_PackArray_F32(values, len);
PyTuple_SET_ITEM(args, 1, py_values);
ret = PyObject_CallObject(py_func, args);

@ -121,8 +121,7 @@ static void py_rna_manipulator_handler_set_cb(
py_value = PyFloat_FromDouble(*value);
}
else {
py_value = PyC_FromArray((void *)value, mpr_prop->type->array_length, &PyFloat_Type, false,
"Manipulator set callback: ");
py_value = PyC_Tuple_PackArray_F32(value, mpr_prop->type->array_length);
}
if (py_value == NULL) {
goto fail;

@ -1279,7 +1279,7 @@ static PyObject *M_Geometry_tessellate_polygon(PyObject *UNUSED(self), PyObject
index = 0;
dl_face = dl->index;
while (index < dl->parts) {
PyList_SET_ITEM(tri_list, index, Py_BuildValue("iii", dl_face[0], dl_face[1], dl_face[2]));
PyList_SET_ITEM(tri_list, index, PyC_Tuple_Pack_I32(dl_face[0], dl_face[1], dl_face[2]));
dl_face += 3;
index++;
}

@ -44,8 +44,7 @@
#include "STR_String.h"
#include "MT_Vector3.h"
#include "SG_QList.h"
#include <cstddef>
#include <cstdint>
#include <stddef.h>
#ifdef WITH_PYTHON
#ifdef USE_MATHUTILS