diff options
30 files changed, 171 insertions, 175 deletions
diff --git a/intern/boolop/intern/BOP_CarveInterface.cpp b/intern/boolop/intern/BOP_CarveInterface.cpp index 274d9cac0cf..5a847ff26d4 100644 --- a/intern/boolop/intern/BOP_CarveInterface.cpp +++ b/intern/boolop/intern/BOP_CarveInterface.cpp @@ -150,12 +150,19 @@ static MeshSet<3> *Carve_unionIntersectingMeshes(MeshSet<3> *poly, MeshSet<3> *right = Carve_getIntersectedOperand(orig_meshes, precomputedAABB, otherAABB); try { - MeshSet<3> *result = csg.compute(left, right, carve::csg::CSG::UNION, NULL, carve::csg::CSG::CLASSIFY_EDGE); + if(left->meshes.size()==0) { + delete left; - delete left; - delete right; + left = right; + } + else { + MeshSet<3> *result = csg.compute(left, right, carve::csg::CSG::UNION, NULL, carve::csg::CSG::CLASSIFY_EDGE); - left = result; + delete left; + delete right; + + left = result; + } } catch(carve::exception e) { std::cerr << "CSG failed, exception " << e.str() << std::endl; @@ -492,7 +499,7 @@ BoolOpState BOP_performBooleanOperation(BoolOpType opType, CSG_VertexIteratorDescriptor obBVertices) { carve::csg::CSG::OP op; - MeshSet<3> *left, *right, *output; + MeshSet<3> *left, *right, *output = NULL; carve::csg::CSG csg; carve::geom3d::Vector min, max; carve::interpolate::FaceAttr<uint> oface_num; @@ -517,6 +524,17 @@ BoolOpState BOP_performBooleanOperation(BoolOpType opType, Carve_prepareOperands(&left, &right, oface_num); + if(left->meshes.size() == 0 || right->meshes.size()==0) { + // normally sohuldn't happen (zero-faces objects are handled by modifier itself), but + // unioning intersecting meshes which doesn't have consistent normals might lead to + // empty result which wouldn't work here + + delete left; + delete right; + + return BOP_ERROR; + } + min.x = max.x = left->vertex_storage[0].v.x; min.y = max.y = left->vertex_storage[0].v.y; min.z = max.z = left->vertex_storage[0].v.z; diff --git a/intern/cycles/blender/blender_session.cpp b/intern/cycles/blender/blender_session.cpp index 5e3102fd7c7..d9adc5480dc 100644 --- a/intern/cycles/blender/blender_session.cpp +++ b/intern/cycles/blender/blender_session.cpp @@ -206,7 +206,7 @@ void BlenderSession::render() vector<Pass> passes; Pass::add(PASS_COMBINED, passes); - if(session_params.device.type == DEVICE_CPU) { /* todo */ + if(session_params.device.advanced_shading) { BL::RenderLayer::passes_iterator b_pass_iter; for(b_rlay.passes.begin(b_pass_iter); b_pass_iter != b_rlay.passes.end(); ++b_pass_iter) { diff --git a/intern/cycles/device/device.cpp b/intern/cycles/device/device.cpp index e4beb4d7d8c..cceec8b8e5c 100644 --- a/intern/cycles/device/device.cpp +++ b/intern/cycles/device/device.cpp @@ -183,6 +183,9 @@ Device *Device::create(DeviceInfo& info, bool background, int threads) return NULL; } + if(device) + device->info = info; + return device; } diff --git a/intern/cycles/device/device.h b/intern/cycles/device/device.h index b8fea4c4c69..af2567498d9 100644 --- a/intern/cycles/device/device.h +++ b/intern/cycles/device/device.h @@ -51,6 +51,7 @@ public: string id; int num; bool display_device; + bool advanced_shading; vector<DeviceInfo> multi_devices; DeviceInfo() @@ -59,6 +60,7 @@ public: id = "CPU"; num = 0; display_device = false; + advanced_shading = true; } }; @@ -101,10 +103,8 @@ protected: public: virtual ~Device() {} - virtual bool support_full_kernel() = 0; - /* info */ - virtual string description() = 0; + DeviceInfo info; virtual const string& error_message() { return error_msg; } /* regular memory */ diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp index 2ca599f6c67..da977ed8472 100644 --- a/intern/cycles/device/device_cpu.cpp +++ b/intern/cycles/device/device_cpu.cpp @@ -72,16 +72,11 @@ public: kernel_globals_free(kg); } - bool support_full_kernel() + bool support_advanced_shading() { return true; } - string description() - { - return system_cpu_brand_string(); - } - void mem_alloc(device_memory& mem, MemoryType type) { mem.device_pointer = mem.data_pointer; @@ -271,6 +266,7 @@ void device_cpu_info(vector<DeviceInfo>& devices) info.description = system_cpu_brand_string(); info.id = "CPU"; info.num = 0; + info.advanced_shading = true; devices.insert(devices.begin(), info); } diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp index 55b467fc856..0c08baae3ff 100644 --- a/intern/cycles/device/device_cuda.cpp +++ b/intern/cycles/device/device_cuda.cpp @@ -106,11 +106,6 @@ public: } } - static int cuda_align_up(int& offset, int alignment) - { - return (offset + alignment - 1) & ~(alignment - 1); - } - #ifdef NDEBUG #define cuda_abort() #else @@ -194,26 +189,6 @@ public: cuda_assert(cuCtxDetach(cuContext)) } - bool support_full_kernel() - { - int major, minor; - cuDeviceComputeCapability(&major, &minor, cuDevId); - - return (major >= 2); - } - - string description() - { - /* print device information */ - char deviceName[256]; - - cuda_push_context(); - cuDeviceGetName(deviceName, 256, cuDevId); - cuda_pop_context(); - - return string("CUDA ") + deviceName; - } - bool support_device(bool experimental) { if(!experimental) { @@ -505,7 +480,7 @@ public: offset += sizeof(d_rng_state); int sample = task.sample; - offset = cuda_align_up(offset, __alignof(sample)); + offset = align_up(offset, __alignof(sample)); cuda_assert(cuParamSeti(cuPathTrace, offset, task.sample)) offset += sizeof(task.sample); @@ -569,7 +544,7 @@ public: offset += sizeof(d_buffer); int sample = task.sample; - offset = cuda_align_up(offset, __alignof(sample)); + offset = align_up(offset, __alignof(sample)); cuda_assert(cuParamSeti(cuFilmConvert, offset, task.sample)) offset += sizeof(task.sample); @@ -638,7 +613,7 @@ public: offset += sizeof(d_offset); int shader_eval_type = task.shader_eval_type; - offset = cuda_align_up(offset, __alignof(shader_eval_type)); + offset = align_up(offset, __alignof(shader_eval_type)); cuda_assert(cuParamSeti(cuDisplace, offset, task.shader_eval_type)) offset += sizeof(task.shader_eval_type); @@ -881,6 +856,10 @@ void device_cuda_info(vector<DeviceInfo>& devices) info.id = string_printf("CUDA_%d", num); info.num = num; + int major, minor; + cuDeviceComputeCapability(&major, &minor, num); + info.advanced_shading = (major >= 2); + /* if device has a kernel timeout, assume it is used for display */ if(cuDeviceGetAttribute(&attr, CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, num) == CUDA_SUCCESS && attr == 1) { info.display_device = true; diff --git a/intern/cycles/device/device_multi.cpp b/intern/cycles/device/device_multi.cpp index 41d0e268526..375719133b8 100644 --- a/intern/cycles/device/device_multi.cpp +++ b/intern/cycles/device/device_multi.cpp @@ -76,16 +76,6 @@ public: delete sub.device; } - bool support_full_kernel() - { - foreach(SubDevice& sub, devices) { - if(!sub.device->support_full_kernel()) - return false; - } - - return true; - } - const string& error_message() { foreach(SubDevice& sub, devices) { @@ -99,38 +89,6 @@ public: return error_msg; } - string description() - { - /* create map to find duplicate descriptions */ - map<string, int> dupli_map; - map<string, int>::iterator dt; - - foreach(SubDevice& sub, devices) { - string key = sub.device->description(); - - if(dupli_map.find(key) == dupli_map.end()) - dupli_map[key] = 1; - else - dupli_map[key]++; - } - - /* generate string */ - stringstream desc; - bool first = true; - - for(dt = dupli_map.begin(); dt != dupli_map.end(); dt++) { - if(!first) desc << ", "; - first = false; - - if(dt->second > 1) - desc << dt->second << "x " << dt->first; - else - desc << dt->first; - } - - return desc.str(); - } - bool load_kernels(bool experimental) { foreach(SubDevice& sub, devices) @@ -344,6 +302,8 @@ static void device_multi_add(vector<DeviceInfo>& devices, DeviceType type, bool map<string, int>::iterator dt; int num_added = 0, num_display = 0; + info.advanced_shading = true; + foreach(DeviceInfo& subinfo, devices) { if(subinfo.type == type) { if(subinfo.display_device) { @@ -363,6 +323,8 @@ static void device_multi_add(vector<DeviceInfo>& devices, DeviceType type, bool info.multi_devices.push_back(subinfo); if(subinfo.display_device) info.display_device = true; + if(!subinfo.advanced_shading) + info.advanced_shading = false; num_added++; } } diff --git a/intern/cycles/device/device_network.cpp b/intern/cycles/device/device_network.cpp index 14518b1507e..931890b5859 100644 --- a/intern/cycles/device/device_network.cpp +++ b/intern/cycles/device/device_network.cpp @@ -57,24 +57,6 @@ public: { } - bool support_full_kernel() - { - return false; - } - - string description() - { - RPCSend snd(socket, "description"); - snd.write(); - - RPCReceive rcv(socket); - string desc_string; - - *rcv.archive & desc_string; - - return desc_string + " (remote)"; - } - void mem_alloc(device_memory& mem, MemoryType type) { #if 0 diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp index ccfd8544362..9a55f957895 100644 --- a/intern/cycles/device/device_opencl.cpp +++ b/intern/cycles/device/device_opencl.cpp @@ -453,20 +453,6 @@ public: clReleaseContext(cxContext); } - bool support_full_kernel() - { - return false; - } - - string description() - { - char name[1024]; - - clGetDeviceInfo(cdDevice, CL_DEVICE_NAME, sizeof(name), &name, NULL); - - return string("OpenCL ") + name; - } - void mem_alloc(device_memory& mem, MemoryType type) { size_t size = mem.memory_size(); @@ -750,6 +736,7 @@ void device_opencl_info(vector<DeviceInfo>& devices) info.num = num; /* we don't know if it's used for display, but assume it is */ info.display_device = true; + info.advanced_shading = false; devices.push_back(info); } diff --git a/intern/cycles/kernel/kernel_emission.h b/intern/cycles/kernel/kernel_emission.h index b3a5b2bfcb4..513a453b585 100644 --- a/intern/cycles/kernel/kernel_emission.h +++ b/intern/cycles/kernel/kernel_emission.h @@ -27,6 +27,7 @@ __device float3 direct_emissive_eval(KernelGlobals *kg, float rando, ShaderData sd; float3 eval; +#ifdef __BACKGROUND_MIS__ if(ls->type == LIGHT_BACKGROUND) { Ray ray; ray.D = ls->D; @@ -36,7 +37,9 @@ __device float3 direct_emissive_eval(KernelGlobals *kg, float rando, shader_setup_from_background(kg, &sd, &ray); eval = shader_eval_background(kg, &sd, 0); } - else { + else +#endif + { shader_setup_from_sample(kg, &sd, ls->P, ls->Ng, I, ls->shader, ls->object, ls->prim, u, v); ls->Ng = sd.Ng; @@ -164,6 +167,7 @@ __device float3 indirect_background(KernelGlobals *kg, Ray *ray, int path_flag, float3 L = shader_eval_background(kg, &sd, path_flag); shader_release(kg, &sd); +#ifdef __BACKGROUND_MIS__ /* check if background light exists or if we should skip pdf */ int res = kernel_data.integrator.pdf_background_res; @@ -175,6 +179,7 @@ __device float3 indirect_background(KernelGlobals *kg, Ray *ray, int path_flag, return L*mis_weight; } +#endif return L; #else diff --git a/intern/cycles/kernel/kernel_light.h b/intern/cycles/kernel/kernel_light.h index 4c2b69c2716..aa125180a94 100644 --- a/intern/cycles/kernel/kernel_light.h +++ b/intern/cycles/kernel/kernel_light.h @@ -192,6 +192,7 @@ __device void regular_light_sample(KernelGlobals *kg, int point, ls->D = -D; ls->t = FLT_MAX; } +#ifdef __BACKGROUND_MIS__ else if(type == LIGHT_BACKGROUND) { /* infinite area light (e.g. light dome or env light) */ float3 D = background_light_sample(kg, randu, randv, pdf); @@ -201,6 +202,7 @@ __device void regular_light_sample(KernelGlobals *kg, int point, ls->D = -D; ls->t = FLT_MAX; } +#endif else { ls->P = make_float3(data0.y, data0.z, data0.w); diff --git a/intern/cycles/kernel/kernel_passes.h b/intern/cycles/kernel/kernel_passes.h index cfd73c98bad..a1b3b0e9038 100644 --- a/intern/cycles/kernel/kernel_passes.h +++ b/intern/cycles/kernel/kernel_passes.h @@ -36,7 +36,7 @@ __device_inline void kernel_write_pass_float4(__global float *buffer, int sample *buf = (sample == 0)? value: *buf + value; } -__device void kernel_write_data_passes(KernelGlobals *kg, __global float *buffer, PathRadiance *L, +__device_inline void kernel_write_data_passes(KernelGlobals *kg, __global float *buffer, PathRadiance *L, ShaderData *sd, int sample, int path_flag, float3 throughput) { #ifdef __PASSES__ @@ -86,7 +86,7 @@ __device void kernel_write_data_passes(KernelGlobals *kg, __global float *buffer #endif } -__device void kernel_write_light_passes(KernelGlobals *kg, __global float *buffer, PathRadiance *L, int sample) +__device_inline void kernel_write_light_passes(KernelGlobals *kg, __global float *buffer, PathRadiance *L, int sample) { #ifdef __PASSES__ int flag = kernel_data.film.pass_flag; diff --git a/intern/cycles/kernel/kernel_shader.h b/intern/cycles/kernel/kernel_shader.h index 1d2cf46aa56..0f04af1275d 100644 --- a/intern/cycles/kernel/kernel_shader.h +++ b/intern/cycles/kernel/kernel_shader.h @@ -26,7 +26,6 @@ * */ - #ifdef __OSL__ #include "osl_shader.h" diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h index b4b1da83162..477b08f2f87 100644 --- a/intern/cycles/kernel/kernel_types.h +++ b/intern/cycles/kernel/kernel_types.h @@ -70,9 +70,8 @@ CCL_NAMESPACE_BEGIN #ifdef __KERNEL_ADV_SHADING__ #define __MULTI_CLOSURE__ #define __TRANSPARENT_SHADOWS__ -#ifdef __KERNEL_CPU__ #define __PASSES__ -#endif +#define __BACKGROUND_MIS__ #endif //#define __MULTI_LIGHT__ @@ -185,6 +184,9 @@ typedef float3 PathThroughput; struct PathRadiance { int use_light_pass; + float3 emission; + float3 background; + float3 indirect; float3 direct_throughput; float3 direct_emission; @@ -200,9 +202,6 @@ struct PathRadiance { float3 indirect_diffuse; float3 indirect_glossy; float3 indirect_transmission; - - float3 emission; - float3 background; }; struct BsdfEval { diff --git a/intern/cycles/render/buffers.cpp b/intern/cycles/render/buffers.cpp index 56219482ef0..dd0ebf7195c 100644 --- a/intern/cycles/render/buffers.cpp +++ b/intern/cycles/render/buffers.cpp @@ -71,7 +71,7 @@ int BufferParams::get_passes_size() foreach(Pass& pass, passes) size += pass.components; - return size; + return align_up(size, 4); } /* Render Buffers */ @@ -130,7 +130,7 @@ bool RenderBuffers::copy_from_device() if(!buffer.device_pointer) return false; - device->mem_copy_from(buffer, 0, params.width, params.height, sizeof(float4)); + device->mem_copy_from(buffer, 0, params.width, params.height, params.get_passes_size()*sizeof(float)); return true; } diff --git a/intern/cycles/render/film.cpp b/intern/cycles/render/film.cpp index bc51384b873..376e9d6d0ca 100644 --- a/intern/cycles/render/film.cpp +++ b/intern/cycles/render/film.cpp @@ -21,12 +21,20 @@ #include "film.h" #include "scene.h" +#include "util_algorithm.h" #include "util_foreach.h" CCL_NAMESPACE_BEGIN /* Pass */ +static bool compare_pass_order(const Pass& a, const Pass& b) +{ + if(a.components == b.components) + return (a.type < b.type); + return (a.components > b.components); +} + void Pass::add(PassType type, vector<Pass>& passes) { Pass pass; @@ -106,6 +114,10 @@ void Pass::add(PassType type, vector<Pass>& passes) } passes.push_back(pass); + + /* order from by components, to ensure alignment so passes with size 4 + come first and then passes with size 1 */ + sort(passes.begin(), passes.end(), compare_pass_order); } bool Pass::equals(const vector<Pass>& A, const vector<Pass>& B) @@ -219,6 +231,8 @@ void Film::device_update(Device *device, DeviceScene *dscene) kfilm->pass_stride += pass.components; } + kfilm->pass_stride = align_up(kfilm->pass_stride, 4); + need_update = false; } diff --git a/intern/cycles/render/light.cpp b/intern/cycles/render/light.cpp index 777e764558f..405aa800457 100644 --- a/intern/cycles/render/light.cpp +++ b/intern/cycles/render/light.cpp @@ -402,6 +402,16 @@ void LightManager::device_update_points(Device *device, DeviceScene *dscene, Sce float4 *light_data = dscene->light_data.resize(scene->lights.size()*LIGHT_SIZE); + if(!device->info.advanced_shading) { + /* remove unsupported light */ + foreach(Light *light, scene->lights) { + if(light->type == LIGHT_BACKGROUND) { + scene->lights.erase(std::remove(scene->lights.begin(), scene->lights.end(), light), scene->lights.end()); + break; + } + } + } + for(size_t i = 0; i < scene->lights.size(); i++) { Light *light = scene->lights[i]; float3 co = light->co; diff --git a/intern/cycles/render/svm.cpp b/intern/cycles/render/svm.cpp index f088a8143cc..ae666ddfe68 100644 --- a/intern/cycles/render/svm.cpp +++ b/intern/cycles/render/svm.cpp @@ -58,7 +58,7 @@ void SVMShaderManager::device_update(Device *device, DeviceScene *dscene, Scene } bool sunsky_done = false; - bool use_multi_closure = device->support_full_kernel(); + bool use_multi_closure = device->info.advanced_shading; for(i = 0; i < scene->shaders.size(); i++) { Shader *shader = scene->shaders[i]; diff --git a/intern/cycles/util/util_types.h b/intern/cycles/util/util_types.h index 2c0ae13ad2a..efdda98571a 100644 --- a/intern/cycles/util/util_types.h +++ b/intern/cycles/util/util_types.h @@ -277,6 +277,11 @@ __device float4 make_float4(float x, float y, float z, float w) return a; } +__device int align_up(int offset, int alignment) +{ + return (offset + alignment - 1) & ~(alignment - 1); +} + #endif CCL_NAMESPACE_END diff --git a/release/scripts/startup/bl_ui/properties_object_constraint.py b/release/scripts/startup/bl_ui/properties_object_constraint.py index 57adfa1fa20..dff23e6238f 100644 --- a/release/scripts/startup/bl_ui/properties_object_constraint.py +++ b/release/scripts/startup/bl_ui/properties_object_constraint.py @@ -434,25 +434,28 @@ class ConstraintButtonsPanel(): def ACTION(self, context, layout, con): self.target_template(layout, con) - layout.prop(con, "action") - - layout.prop(con, "transform_channel") - split = layout.split() - - col = split.column(align=True) - col.label(text="Action Length:") - col.prop(con, "frame_start", text="Start") - col.prop(con, "frame_end", text="End") - + + col = split.column() + col.label(text="From Target:") + col.prop(con, "transform_channel", text="") + col.prop(con, "target_space", text="") + + col = split.column() + col.label(text="To Action:") + col.prop(con, "action", text="") + + split = layout.split() + col = split.column(align=True) col.label(text="Target Range:") col.prop(con, "min", text="Min") col.prop(con, "max", text="Max") - - row = layout.row() - row.label(text="Convert:") - row.prop(con, "target_space", text="") + + col = split.column(align=True) + col.label(text="Action Range:") + col.prop(con, "frame_start", text="Start") + col.prop(con, "frame_end", text="End") def LOCKED_TRACK(self, context, layout, con): self.target_template(layout, con) diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 02266801935..48f1df2bd73 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -51,7 +51,7 @@ extern "C" { /* can be left blank, otherwise a,b,c... etc with no quotes */ #define BLENDER_VERSION_CHAR /* alpha/beta/rc/release, docs use this */ -#define BLENDER_VERSION_CYCLE alpha +#define BLENDER_VERSION_CYCLE beta extern char versionstr[]; /* from blender.c */ diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h index 4af19f7b0e7..b69ad4d1b8b 100644 --- a/source/blender/blenkernel/BKE_customdata.h +++ b/source/blender/blenkernel/BKE_customdata.h @@ -71,7 +71,7 @@ extern const CustomDataMask CD_MASK_FACECORNERS; #define CD_DUPLICATE 4 /* do a full copy of all layers, only allowed if source has same number of elements */ -#define CD_TYPE_AS_MASK(_type) (CustomDataMask)(1 << (CustomDataMask)(_type)) +#define CD_TYPE_AS_MASK(_type) (CustomDataMask)((CustomDataMask)1 << (CustomDataMask)(_type)) /* Checks if the layer at physical offset layern (in data->layers) support math * the below operations. diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 5c945c3a17c..d944d12b0c0 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -835,6 +835,7 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba int editmode = (!forRender && cu->editnurb); DerivedMesh *dm= NULL, *ndm; float (*vertCos)[3] = NULL; + int useCache = !forRender; if(forRender) required_mode = eModifierMode_Render; else required_mode = eModifierMode_Realtime; @@ -913,7 +914,7 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba vertCos= NULL; } - ndm = mti->applyModifier(md, ob, dm, forRender, editmode); + ndm = mti->applyModifier(md, ob, dm, forRender, useCache); if (ndm) { /* Modifier returned a new derived mesh */ diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index 0d0e98b816f..f4e69624839 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -3557,7 +3557,7 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface, /* Proceed only if particle is active */ if(pa->alive == PARS_UNBORN && (part->flag & PART_UNBORN)==0) continue; else if(pa->alive == PARS_DEAD && (part->flag & PART_DIED)==0) continue; - else if(pa->flag & PARS_NO_DISP || pa->flag & PARS_UNEXIST) continue; + else if(pa->flag & PARS_UNEXIST) continue; /* for debug purposes check if any NAN particle proceeds * For some reason they get past activity check, this should rule most of them out */ diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 3258b8c3dcb..e12f411f81f 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -1026,15 +1026,15 @@ static void rna_def_constraint_action(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem transform_channel_items[] = { - {20, "LOCATION_X", 0, "Location X", ""}, - {21, "LOCATION_Y", 0, "Location Y", ""}, - {22, "LOCATION_Z", 0, "Location Z", ""}, - {00, "ROTATION_X", 0, "Rotation X", ""}, - {01, "ROTATION_Y", 0, "Rotation Y", ""}, - {02, "ROTATION_Z", 0, "Rotation Z", ""}, - {10, "SCALE_X", 0, "Scale X", ""}, - {11, "SCALE_Y", 0, "Scale Y", ""}, - {12, "SCALE_Z", 0, "Scale Z", ""}, + {20, "LOCATION_X", 0, "X Location", ""}, + {21, "LOCATION_Y", 0, "Y Location", ""}, + {22, "LOCATION_Z", 0, "Z Location", ""}, + {00, "ROTATION_X", 0, "X Rotation", ""}, + {01, "ROTATION_Y", 0, "Y Rotation", ""}, + {02, "ROTATION_Z", 0, "Z Rotation", ""}, + {10, "SCALE_X", 0, "Z Scale", ""}, + {11, "SCALE_Y", 0, "Y Scale", ""}, + {12, "SCALE_Z", 0, "Z Scale", ""}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "ActionConstraint", "Constraint"); @@ -2011,12 +2011,12 @@ static void rna_def_constraint_spline_ik(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "chainlen"); RNA_def_property_range(prop, 1, 255); // TODO: this should really check the max length of the chain the constraint is attached to RNA_def_property_ui_text(prop, "Chain Length", "How many bones are included in the chain"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); // XXX: this update goes wrong... needs extra flush? /* direct access to bindings */ // NOTE: only to be used by experienced users prop= RNA_def_property(srna, "joint_bindings", PROP_FLOAT, PROP_FACTOR); - RNA_def_property_array(prop, 32); // XXX this is the maximum value allowed + RNA_def_property_array(prop, 32); // XXX this is the maximum value allowed - why? RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_dynamic_array_funcs(prop, "rna_SplineIKConstraint_joint_bindings_get_length"); RNA_def_property_float_funcs(prop, "rna_SplineIKConstraint_joint_bindings_get", "rna_SplineIKConstraint_joint_bindings_set", NULL); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 34764c30e97..e2c0a7cfca1 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -3156,18 +3156,21 @@ static void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "xsch"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 4, 10000); RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the rendered image"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneCamera_update"); prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ysch"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 4, 10000); RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the rendered image"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneCamera_update"); prop= RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE); RNA_def_property_int_sdna(prop, NULL, "size"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 1, SHRT_MAX); RNA_def_property_ui_range(prop, 1, 100, 10, 1); RNA_def_property_ui_text(prop, "Resolution %", "Percentage scale for render resolution"); @@ -3187,12 +3190,14 @@ static void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "pixel_aspect_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "xasp"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 1.0f, 200.0f); RNA_def_property_ui_text(prop, "Pixel Aspect X", "Horizontal aspect ratio - for anamorphic or non-square pixel output"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneCamera_update"); prop= RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "yasp"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 1.0f, 200.0f); RNA_def_property_ui_text(prop, "Pixel Aspect Y", "Vertical aspect ratio - for anamorphic or non-square pixel output"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneCamera_update"); @@ -3406,6 +3411,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) /* border */ prop= RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Border", "Render a user-defined border region, within the frame size " "(note that this disables save_buffers and full_sample)"); @@ -3437,6 +3443,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "use_crop_to_border", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_CROP); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Crop to Border", "Crop the rendered frame to the defined border size"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 571fe05238d..799366a5234 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2902,7 +2902,7 @@ static void rna_def_space_clip(BlenderRNA *brna) /* lock to time cursor */ prop= RNA_def_property(srna, "lock_time_cursor", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_ui_text(prop, "Lock to Time Cursor", "Lock curves view to time cursos during playback and tracking"); + RNA_def_property_ui_text(prop, "Lock to Time Cursor", "Lock curves view to time cursor during playback and tracking"); RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_LOCK_TIMECURSOR); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); diff --git a/source/blender/modifiers/intern/MOD_boolean_util.c b/source/blender/modifiers/intern/MOD_boolean_util.c index 1f2c65e4cca..510179c01d7 100644 --- a/source/blender/modifiers/intern/MOD_boolean_util.c +++ b/source/blender/modifiers/intern/MOD_boolean_util.c @@ -374,10 +374,10 @@ static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh( } // a hash table to remap materials to indices - if (mat) { - material_hash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "CSG_mat gh"); + material_hash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "CSG_mat gh"); + + if (mat) *totmat = 0; - } origindex_layer = result->getTessFaceDataArray(result, CD_ORIGINDEX); @@ -422,6 +422,32 @@ static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh( else mface->mat_nr = GET_INT_FROM_POINTER(BLI_ghash_lookup(material_hash, orig_mat)); } + else if(orig_mat) { + if(orig_ob == ob1) { + // No need to change materian index for faces from left operand + } + else { + // for faces from right operand checn if there's needed material in left operand and if it is, + // use index of that material, otherwise fallback to first material (material with index=0) + if (!BLI_ghash_haskey(material_hash, orig_mat)) { + int a; + + mat_nr = 0; + for(a = 0; a < ob1->totcol; a++) { + if(give_current_material(ob1, a+1) == orig_mat) { + mat_nr = a; + break; + } + } + + BLI_ghash_insert(material_hash, orig_mat, SET_INT_IN_POINTER(mat_nr)); + + mface->mat_nr = mat_nr; + } + else + mface->mat_nr = GET_INT_FROM_POINTER(BLI_ghash_lookup(material_hash, orig_mat)); + } + } else mface->mat_nr = 0; diff --git a/source/blender/modifiers/intern/MOD_cloth.c b/source/blender/modifiers/intern/MOD_cloth.c index 7e46d3f0fe3..f626a2f86fe 100644 --- a/source/blender/modifiers/intern/MOD_cloth.c +++ b/source/blender/modifiers/intern/MOD_cloth.c @@ -84,6 +84,10 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, } dm = get_dm(ob, NULL, derivedData, NULL, 0); + if(dm == derivedData) + dm = CDDM_copy(dm, 0); + + CDDM_apply_vert_coords(dm, vertexCos); clothModifier_do(clmd, md->scene, ob, dm, vertexCos); @@ -92,8 +96,7 @@ static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, result->release(result); } - if(dm != derivedData) - dm->release(dm); + dm->release(dm); } static void updateDepgraph( diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index faf2d3fd352..4052c221935 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1277,22 +1277,17 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar #ifdef WITH_BUILDINFO int ver_width, rev_width; - char *version_str = NULL; - char *revision_str = NULL; char version_buf[128]; char revision_buf[128]; extern char build_rev[]; - version_str = &version_buf[0]; - revision_str = &revision_buf[0]; - - BLI_snprintf(version_str, sizeof(version_str), + BLI_snprintf(version_buf, sizeof(version_buf), "%d.%02d.%d", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION); - BLI_snprintf(revision_str, sizeof(revision_str), "r%s", build_rev); + BLI_snprintf(revision_buf, sizeof(revision_buf), "r%s", build_rev); BLF_size(style->widgetlabel.uifont_id, style->widgetlabel.points, U.dpi); - ver_width = (int)BLF_width(style->widgetlabel.uifont_id, version_str) + 5; - rev_width = (int)BLF_width(style->widgetlabel.uifont_id, revision_str) + 5; + ver_width = (int)BLF_width(style->widgetlabel.uifont_id, version_buf) + 5; + rev_width = (int)BLF_width(style->widgetlabel.uifont_id, revision_buf) + 5; #endif //WITH_BUILDINFO block= uiBeginBlock(C, ar, "_popup", UI_EMBOSS); @@ -1303,8 +1298,8 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar uiBlockSetFunc(block, wm_block_splash_refreshmenu, block, NULL); #ifdef WITH_BUILDINFO - uiDefBut(block, LABEL, 0, version_str, 494-ver_width, 282-24, ver_width, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); - uiDefBut(block, LABEL, 0, revision_str, 494-rev_width, 282-36, rev_width, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); + uiDefBut(block, LABEL, 0, version_buf, 494-ver_width, 282-24, ver_width, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); + uiDefBut(block, LABEL, 0, revision_buf, 494-rev_width, 282-36, rev_width, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); #endif //WITH_BUILDINFO layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 10, 2, 480, 110, style); |