Merge remote-tracking branch 'origin/master' into blender2.8

This commit is contained in:
Dalai Felinto 2017-11-13 11:48:48 -02:00
commit 1cb6cea71c
12 changed files with 61 additions and 20 deletions

View File

@ -76,6 +76,8 @@ IF(OPENIMAGEIO_FOUND)
SET(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO_INCLUDE_DIR})
IF(EXISTS ${OPENIMAGEIO_INCLUDE_DIR}/OpenImageIO/pugixml.hpp)
SET(OPENIMAGEIO_PUGIXML_FOUND TRUE)
ELSE()
SET(OPENIMAGEIO_PUGIXML_FOUND FALSE)
ENDIF()
ELSE()
SET(OPENIMAGEIO_PUGIXML_FOUND FALSE)

View File

@ -209,6 +209,10 @@ if(WITH_CYCLES_DEBUG)
add_definitions(-DWITH_CYCLES_DEBUG)
endif()
if(NOT OPENIMAGEIO_PUGIXML_FOUND)
add_definitions(-DWITH_SYSTEM_PUGIXML)
endif()
include_directories(
SYSTEM
${BOOST_INCLUDE_DIR}

View File

@ -358,7 +358,7 @@ static void xml_read_shader(XMLReadState& state, xml_node node)
/* Background */
static void xml_read_background(XMLReadState& state, pugi::xml_node node)
static void xml_read_background(XMLReadState& state, xml_node node)
{
/* Background Settings */
xml_read_node(state, state.scene->background, node);

View File

@ -908,7 +908,7 @@ public:
cmem->texobject = 0;
cmem->array = array_3d;
}
else if(mem.data_height > 1) {
else if(mem.data_height > 0) {
/* 2D texture, using pitch aligned linear memory. */
int alignment = 0;
cuda_assert(cuDeviceGetAttribute(&alignment, CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT, cuDevice));
@ -962,7 +962,7 @@ public:
resDesc.res.array.hArray = array_3d;
resDesc.flags = 0;
}
else if(mem.data_height > 1) {
else if(mem.data_height > 0) {
resDesc.resType = CU_RESOURCE_TYPE_PITCH2D;
resDesc.res.pitch2D.devPtr = mem.device_pointer;
resDesc.res.pitch2D.format = format;
@ -1012,7 +1012,7 @@ public:
if(array_3d) {
cuda_assert(cuTexRefSetArray(texref, array_3d, CU_TRSA_OVERRIDE_FORMAT));
}
else if(mem.data_height > 1) {
else if(mem.data_height > 0) {
CUDA_ARRAY_DESCRIPTOR array_desc;
array_desc.Format = format;
array_desc.Height = mem.data_height;

View File

@ -91,6 +91,7 @@ bool DeviceSplitKernel::load_kernels(const DeviceRequestedFeatures& requested_fe
#define LOAD_KERNEL(name) \
kernel_##name = get_split_kernel_function(#name, requested_features); \
if(!kernel_##name) { \
device->set_error(string("Split kernel error: failed to load kernel_") + #name); \
return false; \
}

View File

@ -723,6 +723,7 @@ void ImageManager::device_load_image(Device *device,
*tex_img))
{
/* on failure to load, we set a 1x1 pixels pink image */
thread_scoped_lock device_lock(device_mutex);
float *pixels = (float*)tex_img->alloc(1, 1);
pixels[0] = TEX_IMAGE_MISSING_R;
@ -748,6 +749,7 @@ void ImageManager::device_load_image(Device *device,
*tex_img))
{
/* on failure to load, we set a 1x1 pixels pink image */
thread_scoped_lock device_lock(device_mutex);
float *pixels = (float*)tex_img->alloc(1, 1);
pixels[0] = TEX_IMAGE_MISSING_R;
@ -770,6 +772,7 @@ void ImageManager::device_load_image(Device *device,
*tex_img))
{
/* on failure to load, we set a 1x1 pixels pink image */
thread_scoped_lock device_lock(device_mutex);
uchar *pixels = (uchar*)tex_img->alloc(1, 1);
pixels[0] = (TEX_IMAGE_MISSING_R * 255);
@ -794,6 +797,7 @@ void ImageManager::device_load_image(Device *device,
texture_limit,
*tex_img)) {
/* on failure to load, we set a 1x1 pixels pink image */
thread_scoped_lock device_lock(device_mutex);
uchar *pixels = (uchar*)tex_img->alloc(1, 1);
pixels[0] = (TEX_IMAGE_MISSING_R * 255);
@ -815,6 +819,7 @@ void ImageManager::device_load_image(Device *device,
texture_limit,
*tex_img)) {
/* on failure to load, we set a 1x1 pixels pink image */
thread_scoped_lock device_lock(device_mutex);
half *pixels = (half*)tex_img->alloc(1, 1);
pixels[0] = TEX_IMAGE_MISSING_R;
@ -839,6 +844,7 @@ void ImageManager::device_load_image(Device *device,
texture_limit,
*tex_img)) {
/* on failure to load, we set a 1x1 pixels pink image */
thread_scoped_lock device_lock(device_mutex);
half *pixels = (half*)tex_img->alloc(1, 1);
pixels[0] = TEX_IMAGE_MISSING_R;

View File

@ -23,10 +23,19 @@
CCL_NAMESPACE_BEGIN
using OIIO_NAMESPACE::pugi::xml_node;
using OIIO_NAMESPACE::pugi::xml_attribute;
OIIO_NAMESPACE_USING
#ifdef WITH_SYSTEM_PUGIXML
# define PUGIXML_NAMESPACE pugi
#else
# define PUGIXML_NAMESPACE OIIO_NAMESPACE::pugi
#endif
using PUGIXML_NAMESPACE::xml_attribute;
using PUGIXML_NAMESPACE::xml_document;
using PUGIXML_NAMESPACE::xml_node;
using PUGIXML_NAMESPACE::xml_parse_result;
CCL_NAMESPACE_END
#endif /* __UTIL_XML_H__ */

View File

@ -987,10 +987,11 @@ void DepsgraphNodeBuilder::build_obdata_geom(Object *ob)
case OB_MBALL:
{
Object *mom = BKE_mball_basis_find(scene_, ob);
/* Motherball - mom depends on children! */
/* NOTE: Only the motherball gets evaluated, it's children are
* having empty placeholders for the correct relations being built.
*/
if (mom == ob) {
/* metaball evaluation operations */
/* NOTE: only the motherball gets evaluated! */
op_node = add_operation_node(obdata,
DEG_NODE_TYPE_GEOMETRY,
function_bind(
@ -999,6 +1000,12 @@ void DepsgraphNodeBuilder::build_obdata_geom(Object *ob)
(MetaBall *)obdata_cow),
DEG_OPCODE_PLACEHOLDER,
"Geometry Eval");
} else {
op_node = add_operation_node(obdata,
DEG_NODE_TYPE_GEOMETRY,
NULL,
DEG_OPCODE_PLACEHOLDER,
"Geometry Eval");
op_node->set_as_entry();
}
break;

View File

@ -1667,13 +1667,19 @@ void DepsgraphRelationBuilder::build_obdata_geom(Object *ob)
case OB_MBALL:
{
Object *mom = BKE_mball_basis_find(scene_, ob);
ComponentKey mom_geom_key(&mom->id, DEG_NODE_TYPE_GEOMETRY);
/* motherball - mom depends on children! */
if (mom != ob) {
/* non-motherball -> cannot be directly evaluated! */
ComponentKey mom_key(&mom->id, DEG_NODE_TYPE_GEOMETRY);
if (mom == ob) {
ComponentKey mom_transform_key(&mom->id,
DEG_NODE_TYPE_TRANSFORM);
add_relation(mom_transform_key,
mom_geom_key,
"Metaball Motherball Transform -> Geometry");
}
else if (mom != ob) {
ComponentKey transform_key(&ob->id, DEG_NODE_TYPE_TRANSFORM);
add_relation(geom_key, mom_key, "Metaball Motherball");
add_relation(transform_key, mom_key, "Metaball Motherball");
add_relation(geom_key, mom_geom_key, "Metaball Motherball");
add_relation(transform_key, mom_geom_key, "Metaball Motherball");
}
break;
}

View File

@ -1305,7 +1305,7 @@ static int image_open_exec(bContext *C, wmOperator *op)
if (iod->iuser) {
iuser = iod->iuser;
}
else if (sa->spacetype == SPACE_IMAGE) {
else if (sa && sa->spacetype == SPACE_IMAGE) {
SpaceImage *sima = sa->spacedata.first;
ED_space_image_set(sima, scene, obedit, ima);
iuser = &sima->iuser;

View File

@ -942,6 +942,11 @@ static char *rna_RenderSettings_path(PointerRNA *UNUSED(ptr))
return BLI_sprintfN("render");
}
static char *rna_BakeSettings_path(PointerRNA *UNUSED(ptr))
{
return BLI_sprintfN("render.bake");
}
static char *rna_ImageFormatSettings_path(PointerRNA *ptr)
{
ImageFormatData *imf = (ImageFormatData *)ptr->data;
@ -4207,6 +4212,7 @@ static void rna_def_bake_data(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "BakeData");
RNA_def_struct_nested(brna, srna, "RenderSettings");
RNA_def_struct_ui_text(srna, "Bake Data", "Bake data for a Scene data-block");
RNA_def_struct_path_func(srna, "rna_BakeSettings_path");
prop = RNA_def_property(srna, "cage_object", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "cage");

View File

@ -280,12 +280,12 @@ PyObject *BPy_BMVertSkin_CreatePyObject(struct MVertSkin *mvertskin)
static void mloopcol_to_float(const MLoopCol *mloopcol, float r_col[3])
{
rgb_uchar_to_float(r_col, (const unsigned char *)&mloopcol->r);
rgba_uchar_to_float(r_col, (const unsigned char *)&mloopcol->r);
}
static void mloopcol_from_float(MLoopCol *mloopcol, const float col[3])
{
rgb_float_to_uchar((unsigned char *)&mloopcol->r, col);
rgba_float_to_uchar((unsigned char *)&mloopcol->r, col);
}
static unsigned char mathutils_bmloopcol_cb_index = -1;
@ -346,8 +346,8 @@ static void bm_init_types_bmloopcol(void)
int BPy_BMLoopColor_AssignPyObject(struct MLoopCol *mloopcol, PyObject *value)
{
float tvec[3];
if (mathutils_array_parse(tvec, 3, 3, value, "BMLoopCol") != -1) {
float tvec[4];
if (mathutils_array_parse(tvec, 4, 4, value, "BMLoopCol") != -1) {
mloopcol_from_float(mloopcol, tvec);
return 0;
}
@ -360,7 +360,7 @@ PyObject *BPy_BMLoopColor_CreatePyObject(struct MLoopCol *data)
{
PyObject *color_capsule;
color_capsule = PyCapsule_New(data, NULL, NULL);
return Color_CreatePyObject_cb(color_capsule, mathutils_bmloopcol_cb_index, 0);
return Vector_CreatePyObject_cb(color_capsule, 4, mathutils_bmloopcol_cb_index, 0);
}
#undef MLOOPCOL_FROM_CAPSULE