diff --git a/build_files/cmake/FindPythonLibsUnix.cmake b/build_files/cmake/FindPythonLibsUnix.cmake index 0752de4ce3c..2554b8a3585 100644 --- a/build_files/cmake/FindPythonLibsUnix.cmake +++ b/build_files/cmake/FindPythonLibsUnix.cmake @@ -53,8 +53,17 @@ if(NOT DEFINED PYTHON_INCLUDE_DIRS) if(NOT _Found_PYTHON_H) message(FATAL_ERROR "Python.h not found") endif() + + unset(_Found_PYTHON_H) + unset(_Python_HEADER) + unset(_CURRENT_ABI_FLAGS) + unset(_CURRENT_PATH) + endif() +unset(_Python_ABI_FLAGS) +unset(_Python_PATHS) + #============================================================================= # now the python versions are found diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 265d5072205..6c6621b7466 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -5,22 +5,28 @@ # use it instead of include_directories() macro(blender_include_dirs includes) - - foreach(inc ${ARGV}) - get_filename_component(abs_inc ${inc} ABSOLUTE) - list(APPEND all_incs ${abs_inc}) + set(_ALL_INCS "") + foreach(_INC ${ARGV}) + get_filename_component(_ABS_INC ${_INC} ABSOLUTE) + list(APPEND _ALL_INCS ${_ABS_INC}) endforeach() - include_directories(${all_incs}) + include_directories(${_ALL_INCS}) + unset(_INC) + unset(_ABS_INC) + unset(_ALL_INCS) endmacro() macro(blender_include_dirs_sys includes) - - foreach(inc ${ARGV}) - get_filename_component(abs_inc ${inc} ABSOLUTE) - list(APPEND all_incs ${abs_inc}) + set(_ALL_INCS "") + foreach(_INC ${ARGV}) + get_filename_component(_ABS_INC ${_INC} ABSOLUTE) + list(APPEND _ALL_INCS ${_ABS_INC}) endforeach() - include_directories(SYSTEM ${all_incs}) + include_directories(SYSTEM ${_ALL_INCS}) + unset(_INC) + unset(_ABS_INC) + unset(_ALL_INCS) endmacro() macro(blender_source_group @@ -29,14 +35,17 @@ macro(blender_source_group # Group by location on disk source_group("Source Files" FILES CMakeLists.txt) - foreach(SRC ${sources}) - get_filename_component(SRC_EXT ${SRC} EXT) - if(${SRC_EXT} MATCHES ".h" OR ${SRC_EXT} MATCHES ".hpp") - source_group("Header Files" FILES ${SRC}) + foreach(_SRC ${sources}) + get_filename_component(_SRC_EXT ${_SRC} EXT) + if(${_SRC_EXT} MATCHES ".h" OR ${_SRC_EXT} MATCHES ".hpp") + source_group("Header Files" FILES ${_SRC}) else() - source_group("Source Files" FILES ${SRC}) + source_group("Source Files" FILES ${_SRC}) endif() endforeach() + + unset(_SRC) + unset(_SRC_EXT) endmacro() @@ -196,10 +205,11 @@ macro(setup_liblinks endif() if(WITH_IMAGE_OPENEXR) if(WIN32 AND NOT UNIX) - foreach(loop_var ${OPENEXR_LIB}) - target_link_libraries(${target} debug ${loop_var}_d) - target_link_libraries(${target} optimized ${loop_var}) + foreach(_LOOP_VAR ${OPENEXR_LIB}) + target_link_libraries(${target} debug ${_LOOP_VAR}_d) + target_link_libraries(${target} optimized ${_LOOP_VAR}) endforeach() + unset(_LOOP_VAR) else() target_link_libraries(${target} ${OPENEXR_LIB}) endif() @@ -212,10 +222,11 @@ macro(setup_liblinks endif() if(WITH_OPENCOLLADA) if(WIN32 AND NOT UNIX) - foreach(loop_var ${OPENCOLLADA_LIB}) - target_link_libraries(${target} debug ${loop_var}_d) - target_link_libraries(${target} optimized ${loop_var}) + foreach(_LOOP_VAR ${OPENCOLLADA_LIB}) + target_link_libraries(${target} debug ${_LOOP_VAR}_d) + target_link_libraries(${target} optimized ${_LOOP_VAR}) endforeach() + unset(_LOOP_VAR) target_link_libraries(${target} debug ${PCRE_LIB}_d) target_link_libraries(${target} optimized ${PCRE_LIB}) if(EXPAT_LIB) @@ -472,4 +483,13 @@ macro(blender_project_hack_post) unset(_reset_standard_cflags_rel) unset(_reset_standard_cxxflags_rel) + + # -------------------------------------------------- + # workaround for omission in cmake 2.8.4's GNU.cmake + if(CMAKE_COMPILER_IS_GNUCC) + if(NOT DARWIN) + set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ") + endif() + endif() + endmacro() diff --git a/release/scripts/modules/console/intellisense.py b/release/scripts/modules/console/intellisense.py index 00f7dbd3657..072d467ff86 100644 --- a/release/scripts/modules/console/intellisense.py +++ b/release/scripts/modules/console/intellisense.py @@ -120,22 +120,25 @@ def expand(line, cursor, namespace, private=True): from . import complete_calltip matches, word, scrollback = complete_calltip.complete(line, cursor, namespace) + prefix = os.path.commonprefix(matches)[len(word):] no_calltip = False else: matches, word = complete(line, cursor, namespace, private) + prefix = os.path.commonprefix(matches)[len(word):] if len(matches) == 1: scrollback = '' else: # causes blender bug [#27495] since string keys may contain '.' # scrollback = ' '.join([m.split('.')[-1] for m in matches]) + word_prefix = word + prefix scrollback = ' '.join( - [m[len(word):] - if (word and m.startswith(word)) + [m[len(word_prefix):] + if (word_prefix and m.startswith(word_prefix)) else m.split('.')[-1] for m in matches]) no_calltip = True - prefix = os.path.commonprefix(matches)[len(word):] + if prefix: line = line[:cursor] + prefix + line[cursor:] cursor += len(prefix) diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py index 21640fa3ee6..90b0fa0af83 100644 --- a/release/scripts/startup/bl_operators/object_quick_effects.py +++ b/release/scripts/startup/bl_operators/object_quick_effects.py @@ -22,10 +22,9 @@ from mathutils import Vector import bpy from bpy.props import BoolProperty, EnumProperty, IntProperty, FloatProperty, FloatVectorProperty - -class MakeFur(bpy.types.Operator): - bl_idname = "object.make_fur" - bl_label = "Make Fur" +class QuickFur(bpy.types.Operator): + bl_idname = "object.quick_fur" + bl_label = "Quick Fur" bl_options = {'REGISTER', 'UNDO'} density = EnumProperty(items=( @@ -79,6 +78,155 @@ class MakeFur(bpy.types.Operator): return {'FINISHED'} +class QuickExplode(bpy.types.Operator): + bl_idname = "object.quick_explode" + bl_label = "Quick Explode" + bl_options = {'REGISTER', 'UNDO'} + + style = EnumProperty(items=( + ('EXPLODE', "Explode", ""), + ('BLEND', "Blend", "")), + name="Explode Style", + description="", + default='EXPLODE') + + amount = IntProperty(name="Amount of pieces", + default=100, min=2, max=10000, soft_min=2, soft_max=10000) + + duration = IntProperty(name="Duration", + default=50, min=1, max=10000, soft_min=1, soft_max=10000) + + start_frame = IntProperty(name="Start Frame", + default=1, min=1, max=10000, soft_min=1, soft_max=10000) + + end_frame = IntProperty(name="End Frame", + default=10, min=1, max=10000, soft_min=1, soft_max=10000) + + velocity = FloatProperty(name="Outwards Velocity", + default=1, min=0, max=1000, soft_min=0, soft_max=10) + + fade = BoolProperty(name="Fade", + description="Fade the pieces over time.", + default=True) + + invert_order = BoolProperty(name="Invert Order", + description="Blend objects in the opposite direction (only for Blend style explosion).", + default=False) + + def execute(self, context): + fake_context = bpy.context.copy() + mesh_objects = [obj for obj in context.selected_objects if obj.type == 'MESH'] + + if self.style == 'BLEND' and len(mesh_objects) != 2: + self.report({'ERROR'}, "Select two mesh objects.") + return {'CANCELLED'} + elif not mesh_objects: + self.report({'ERROR'}, "Select at least one mesh object.") + return {'CANCELLED'} + + for obj in mesh_objects: + if len(obj.particle_systems) > 0: + self.report({'ERROR'}, "Selected object's can't have particle systems.") + return {'CANCELLED'} + + if self.fade: + tex = bpy.data.textures.new("Explode fade", 'BLEND') + tex.use_color_ramp = True + + if self.style == 'BLEND': + tex.color_ramp.elements[0].position = 0.333 + tex.color_ramp.elements[1].position = 0.666 + + tex.color_ramp.elements[0].color[3] = 1 + tex.color_ramp.elements[1].color[3] = 0 + + if self.style == 'BLEND': + if self.invert_order: + from_obj = mesh_objects[1] + to_obj = mesh_objects[0] + else: + from_obj = mesh_objects[0] + to_obj = mesh_objects[1] + + for obj in mesh_objects: + fake_context["object"] = obj + bpy.ops.object.particle_system_add(fake_context) + + settings = obj.particle_systems[-1].settings + settings.count = self.amount + settings.frame_start = self.start_frame + settings.frame_end = self.end_frame - self.duration + settings.lifetime = self.duration + settings.normal_factor = self.velocity + settings.render_type = 'NONE' + + bpy.ops.object.modifier_add(fake_context, type='EXPLODE') + explode = obj.modifiers[-1] + explode.use_edge_cut = True + + if self.fade: + explode.show_dead = False + bpy.ops.mesh.uv_texture_add(fake_context); + uv = obj.data.uv_textures[-1] + uv.name = "Explode fade" + explode.particle_uv = uv.name + + if len(obj.material_slots) == 0: + obj.data.materials.append(bpy.data.materials.new("Explode fade")) + + mat = obj.data.materials[0] + mat.use_transparency = True + mat.use_transparent_shadows = True + mat.alpha = 0 + mat.specular_alpha = 0 + + tex_slot = mat.texture_slots.add() + + tex_slot.texture = tex + tex_slot.texture_coords = 'UV' + tex_slot.uv_layer = uv.name + + tex_slot.use_map_alpha = True + + if self.style == 'BLEND': + if obj == to_obj: + tex_slot.alpha_factor = -1 + elem = tex.color_ramp.elements[1] + elem.color[0] = mat.diffuse_color[0] + elem.color[1] = mat.diffuse_color[1] + elem.color[2] = mat.diffuse_color[2] + else: + elem = tex.color_ramp.elements[0] + elem.color[0] = mat.diffuse_color[0] + elem.color[1] = mat.diffuse_color[1] + elem.color[2] = mat.diffuse_color[2] + else: + tex_slot.use_map_color_diffuse = False + + if self.style == 'BLEND': + settings.physics_type = 'KEYED' + settings.use_emit_random = False + settings.rotation_mode = 'NOR' + + psys = obj.particle_systems[-1] + + fake_context["particle_system"] = obj.particle_systems[-1] + bpy.ops.particle.new_target(fake_context) + bpy.ops.particle.new_target(fake_context) + + if obj == from_obj: + psys.targets[1].object = to_obj + else: + psys.targets[0].object = from_obj + settings.normal_factor = -self.velocity + explode.show_unborn = False + explode.show_dead = True + else: + settings.factor_random = self.velocity + settings.angular_velocity_factor = self.velocity/10 + + return {'FINISHED'} + def obj_bb_minmax(obj, min_co, max_co): for i in range(0, 8): @@ -92,9 +240,9 @@ def obj_bb_minmax(obj, min_co, max_co): max_co[2] = max(bb_vec[2], max_co[2]) -class MakeSmoke(bpy.types.Operator): - bl_idname = "object.make_smoke" - bl_label = "Make Smoke" +class QuickSmoke(bpy.types.Operator): + bl_idname = "object.quick_smoke" + bl_label = "Quick Smoke" bl_options = {'REGISTER', 'UNDO'} style = EnumProperty(items=( @@ -201,9 +349,9 @@ class MakeSmoke(bpy.types.Operator): return {'FINISHED'} -class MakeFluid(bpy.types.Operator): - bl_idname = "object.make_fluid" - bl_label = "Make Fluid" +class QuickFluid(bpy.types.Operator): + bl_idname = "object.quick_fluid" + bl_label = "Quick Fluid" bl_options = {'REGISTER', 'UNDO'} style = EnumProperty(items=( @@ -293,4 +441,4 @@ class MakeFluid(bpy.types.Operator): if self.start_baking: bpy.ops.fluid.bake() - return {'FINISHED'} + return {'FINISHED'} \ No newline at end of file diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index 75069993521..586675f2ca0 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -483,11 +483,10 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel): col.label(text="Mode:") col.prop(md, "wrap_method", text="") - split = layout.split(percentage=0.25) - - col = split.column() - if md.wrap_method == 'PROJECT': + split = layout.split(percentage=0.25) + + col = split.column() col.label(text="Axis:") col.prop(md, "use_project_x") col.prop(md, "use_project_y") @@ -499,7 +498,6 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel): col.prop(md, "use_positive_direction") col = split.column() - col.label(text="Cull Faces:") col.prop(md, "cull_face", expand=True) diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py index 4e1c1b34363..54ca18ef828 100644 --- a/release/scripts/startup/bl_ui/properties_render.py +++ b/release/scripts/startup/bl_ui/properties_render.py @@ -376,8 +376,7 @@ class RENDER_PT_post_processing(RenderButtonsPanel, bpy.types.Panel): col.prop(rd, "use_compositing") col.prop(rd, "use_sequencer") - col = split.column() - col.prop(rd, "dither_intensity", text="Dither", slider=True) + split.prop(rd, "dither_intensity", text="Dither", slider=True) layout.separator() diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h index 4dfc53e1734..feeab98ad78 100644 --- a/source/blender/blenkernel/BKE_particle.h +++ b/source/blender/blenkernel/BKE_particle.h @@ -300,6 +300,8 @@ void psys_get_pointcache_start_end(struct Scene *scene, ParticleSystem *psys, in void psys_check_boid_data(struct ParticleSystem *psys); +void psys_get_birth_coordinates(struct ParticleSimulationData *sim, struct ParticleData *pa, struct ParticleKey *state, float dtime, float cfra); + void particle_system_update(struct Scene *scene, struct Object *ob, struct ParticleSystem *psys); /* ----------- functions needed only inside particlesystem ------------ */ diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c index 5520e4d1d41..cc45abb5998 100644 --- a/source/blender/blenkernel/intern/bvhutils.c +++ b/source/blender/blenkernel/intern/bvhutils.c @@ -493,7 +493,7 @@ static void mesh_edges_nearest_point(void *userdata, int index, const float *co, // NOTE: casts to "float*" here are due to co being "const float*" closest_to_line_segment_v3(nearest_tmp, (float*)co, t0, t1); - dist = len_v3v3(nearest_tmp, (float*)co); + dist = len_squared_v3v3(nearest_tmp, (float*)co); if(dist < nearest->dist) { diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index fca8d470dc1..4e3840832bb 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -1562,8 +1562,7 @@ static void initialize_all_particles(ParticleSimulationData *sim) } } } -/* sets particle to the emitter surface with initial velocity & rotation */ -void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime, float cfra) +void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, ParticleKey *state, float dtime, float cfra) { Object *ob = sim->ob; ParticleSystem *psys = sim->psys; @@ -1575,17 +1574,6 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime, float q_phase[4]; int p = pa - psys->particles; part=psys->part; - - /* get precise emitter matrix if particle is born */ - if(part->type!=PART_HAIR && dtime > 0.f && pa->time < cfra && pa->time >= sim->psys->cfra) { - /* we have to force RECALC_ANIM here since where_is_objec_time only does drivers */ - while(ob) { - BKE_animsys_evaluate_animdata(&ob->id, ob->adt, pa->time, ADT_RECALC_ANIM); - ob = ob->parent; - } - ob = sim->ob; - where_is_object_time(sim->scene, ob, pa->time); - } /* get birth location from object */ if(part->tanfac != 0.f) @@ -1594,7 +1582,7 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime, psys_particle_on_emitter(sim->psmd, part->from,pa->num, pa->num_dmcache, pa->fuv,pa->foffset,loc,nor,0,0,0,0); /* get possible textural influence */ - psys_get_texture(sim, pa, &ptex, PAMAP_IVEL|PAMAP_LIFE, cfra); + psys_get_texture(sim, pa, &ptex, PAMAP_IVEL, cfra); /* particles live in global space so */ /* let's convert: */ @@ -1654,37 +1642,27 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime, mat4_to_quat(rot,ob->obmat); mul_qt_qtqt(r_rot,r_rot,rot); } -#if 0 - } -#endif if(part->phystype==PART_PHYS_BOIDS && pa->boid) { - BoidParticle *bpa = pa->boid; float dvec[3], q[4], mat[3][3]; - copy_v3_v3(pa->state.co,loc); + copy_v3_v3(state->co,loc); /* boids don't get any initial velocity */ - zero_v3(pa->state.vel); + zero_v3(state->vel); /* boids store direction in ave */ if(fabsf(nor[2])==1.0f) { - sub_v3_v3v3(pa->state.ave, loc, ob->obmat[3]); - normalize_v3(pa->state.ave); + sub_v3_v3v3(state->ave, loc, ob->obmat[3]); + normalize_v3(state->ave); } else { - VECCOPY(pa->state.ave, nor); + VECCOPY(state->ave, nor); } - /* and gravity in r_ve */ - bpa->gravity[0] = bpa->gravity[1] = 0.0f; - bpa->gravity[2] = -1.0f; - if((sim->scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) - && sim->scene->physics_settings.gravity[2]!=0.0f) - bpa->gravity[2] = sim->scene->physics_settings.gravity[2]; /* calculate rotation matrix */ - project_v3_v3v3(dvec, r_vel, pa->state.ave); - sub_v3_v3v3(mat[0], pa->state.ave, dvec); + project_v3_v3v3(dvec, r_vel, state->ave); + sub_v3_v3v3(mat[0], state->ave, dvec); normalize_v3(mat[0]); negate_v3_v3(mat[2], r_vel); normalize_v3(mat[2]); @@ -1692,12 +1670,7 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime, /* apply rotation */ mat3_to_quat_is_ok( q,mat); - copy_qt_qt(pa->state.rot, q); - - bpa->data.health = part->boids->health; - bpa->data.mode = eBoidMode_InAir; - bpa->data.state_id = ((BoidState*)part->boids->states.first)->id; - bpa->data.acc[0]=bpa->data.acc[1]=bpa->data.acc[2]=0.0f; + copy_qt_qt(state->rot, q); } else { /* conversion done so now we apply new: */ @@ -1710,7 +1683,7 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime, /* *emitter velocity */ if(dtime != 0.f && part->obfac != 0.f){ - sub_v3_v3v3(vel, loc, pa->state.co); + sub_v3_v3v3(vel, loc, state->co); mul_v3_fl(vel, part->obfac/dtime); } @@ -1747,13 +1720,13 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime, if(part->partfac != 0.f) madd_v3_v3fl(vel, p_vel, part->partfac); - mul_v3_v3fl(pa->state.vel, vel, ptex.ivel); + mul_v3_v3fl(state->vel, vel, ptex.ivel); /* -location from emitter */ - copy_v3_v3(pa->state.co,loc); + copy_v3_v3(state->co,loc); /* -rotation */ - unit_qt(pa->state.rot); + unit_qt(state->rot); if(part->rotmode){ /* create vector into which rotation is aligned */ @@ -1793,32 +1766,74 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime, axis_angle_to_quat( q_phase,x_vec, phasefac*(float)M_PI); /* combine base rotation & phase */ - mul_qt_qtqt(pa->state.rot, rot, q_phase); + mul_qt_qtqt(state->rot, rot, q_phase); } /* -angular velocity */ - zero_v3(pa->state.ave); + zero_v3(state->ave); if(part->avemode){ switch(part->avemode){ case PART_AVE_SPIN: - copy_v3_v3(pa->state.ave, vel); + copy_v3_v3(state->ave, vel); break; case PART_AVE_RAND: - copy_v3_v3(pa->state.ave, r_ave); + copy_v3_v3(state->ave, r_ave); break; } - normalize_v3(pa->state.ave); - mul_v3_fl(pa->state.ave,part->avefac); + normalize_v3(state->ave); + mul_v3_fl(state->ave, part->avefac); } } +} +/* sets particle to the emitter surface with initial velocity & rotation */ +void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime, float cfra) +{ + Object *ob = sim->ob; + ParticleSystem *psys = sim->psys; + ParticleSettings *part; + ParticleTexture ptex; + int p = pa - psys->particles; + part=psys->part; + + /* get precise emitter matrix if particle is born */ + if(part->type!=PART_HAIR && dtime > 0.f && pa->time < cfra && pa->time >= sim->psys->cfra) { + /* we have to force RECALC_ANIM here since where_is_objec_time only does drivers */ + while(ob) { + BKE_animsys_evaluate_animdata(&ob->id, ob->adt, pa->time, ADT_RECALC_ANIM); + ob = ob->parent; + } + ob = sim->ob; + where_is_object_time(sim->scene, ob, pa->time); + } + + psys_get_birth_coordinates(sim, pa, &pa->state, dtime, cfra); + + if(part->phystype==PART_PHYS_BOIDS && pa->boid) { + BoidParticle *bpa = pa->boid; + + /* and gravity in r_ve */ + bpa->gravity[0] = bpa->gravity[1] = 0.0f; + bpa->gravity[2] = -1.0f; + if((sim->scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) + && sim->scene->physics_settings.gravity[2]!=0.0f) + bpa->gravity[2] = sim->scene->physics_settings.gravity[2]; + + bpa->data.health = part->boids->health; + bpa->data.mode = eBoidMode_InAir; + bpa->data.state_id = ((BoidState*)part->boids->states.first)->id; + bpa->data.acc[0]=bpa->data.acc[1]=bpa->data.acc[2]=0.0f; + } if(part->type == PART_HAIR){ pa->lifetime = 100.0f; } else{ + /* get possible textural influence */ + psys_get_texture(sim, pa, &ptex, PAMAP_LIFE, cfra); + pa->lifetime = part->lifetime * ptex.life; if(part->randlife != 0.0f) @@ -1904,6 +1919,7 @@ static void set_keyed_keys(ParticleSimulationData *sim) PARTICLE_P; ParticleKey *key; int totpart = psys->totpart, k, totkeys = psys->totkeyed; + int keyed_flag = 0; ksim.scene= sim->scene; @@ -1933,6 +1949,8 @@ static void set_keyed_keys(ParticleSimulationData *sim) for(k=0; kob ? pt->ob : sim->ob; ksim.psys = BLI_findlink(&ksim.ob->particlesystem, pt->psys - 1); + keyed_flag = (ksim.psys->flag & PSYS_KEYED); + ksim.psys->flag &= ~PSYS_KEYED; LOOP_PARTICLES { key = pa->keys + k; @@ -1956,6 +1974,8 @@ static void set_keyed_keys(ParticleSimulationData *sim) if(psys->flag & PSYS_KEYED_TIMING && pt->duration!=0.0f) k++; + ksim.psys->flag |= keyed_flag; + pt = (pt->next && pt->next->flag & PTARGET_VALID)? pt->next : psys->targets.first; } diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 41bb12e4433..c8e9244d431 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2326,39 +2326,43 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s wtb.outline= 0; widgetbase_draw(&wtb, wcol); - /* slider part */ - VECCOPY(outline, wcol->outline); - VECCOPY(wcol->outline, wcol->item); - VECCOPY(wcol->inner, wcol->item); + /* draw left/right parts only when not in text editing */ + if(!(state & UI_TEXTINPUT)) { + + /* slider part */ + VECCOPY(outline, wcol->outline); + VECCOPY(wcol->outline, wcol->item); + VECCOPY(wcol->inner, wcol->item); - if(!(state & UI_SELECT)) - SWAP(short, wcol->shadetop, wcol->shadedown); - - rect1= *rect; - - value= ui_get_but_val(but); - fac= ((float)value-but->softmin)*(rect1.xmax - rect1.xmin - offs)/(but->softmax - but->softmin); - - /* left part of slider, always rounded */ - rect1.xmax= rect1.xmin + ceil(offs+1.0f); - round_box_edges(&wtb1, roundboxalign & ~6, &rect1, offs); - wtb1.outline= 0; - widgetbase_draw(&wtb1, wcol); - - /* right part of slider, interpolate roundness */ - rect1.xmax= rect1.xmin + fac + offs; - rect1.xmin+= floor(offs-1.0f); - if(rect1.xmax + offs > rect->xmax) - offs*= (rect1.xmax + offs - rect->xmax)/offs; - else - offs= 0.0f; - round_box_edges(&wtb1, roundboxalign & ~9, &rect1, offs); - - widgetbase_draw(&wtb1, wcol); - VECCOPY(wcol->outline, outline); - - if(!(state & UI_SELECT)) - SWAP(short, wcol->shadetop, wcol->shadedown); + if(!(state & UI_SELECT)) + SWAP(short, wcol->shadetop, wcol->shadedown); + + rect1= *rect; + + value= ui_get_but_val(but); + fac= ((float)value-but->softmin)*(rect1.xmax - rect1.xmin - offs)/(but->softmax - but->softmin); + + /* left part of slider, always rounded */ + rect1.xmax= rect1.xmin + ceil(offs+1.0f); + round_box_edges(&wtb1, roundboxalign & ~6, &rect1, offs); + wtb1.outline= 0; + widgetbase_draw(&wtb1, wcol); + + /* right part of slider, interpolate roundness */ + rect1.xmax= rect1.xmin + fac + offs; + rect1.xmin+= floor(offs-1.0f); + if(rect1.xmax + offs > rect->xmax) + offs*= (rect1.xmax + offs - rect->xmax)/offs; + else + offs= 0.0f; + round_box_edges(&wtb1, roundboxalign & ~9, &rect1, offs); + + widgetbase_draw(&wtb1, wcol); + VECCOPY(wcol->outline, outline); + + if(!(state & UI_SELECT)) + SWAP(short, wcol->shadetop, wcol->shadedown); + } /* outline */ wtb.outline= 1; diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 424d3dd5a38..bfae101d38e 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -3967,6 +3967,7 @@ short sharesFace(EditMesh *em, EditEdge* e1, EditEdge* e2) return 0; } +#if 0 typedef struct SlideUv { float origuv[2]; @@ -3980,7 +3981,6 @@ typedef struct SlideVert { EditVert origvert; } SlideVert; -#if 0 int EdgeSlide(EditMesh *em, wmOperator *op, short immediate, float imperc) { return 0; diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 6191ec9c035..d4de1386871 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -302,6 +302,9 @@ static void make_renderinfo_string(RenderStats *rs, Scene *scene, char *str) BLI_timestr(rs->lastframetime, info_time_str); spos+= sprintf(spos, "Time:%s ", info_time_str); + if(rs->curfsa) + spos+= sprintf(spos, "| Full Sample %d ", rs->curfsa); + if(rs->infostr && rs->infostr[0]) spos+= sprintf(spos, "| %s ", rs->infostr); diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index cab8c522a89..be985342ea8 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -3559,7 +3559,7 @@ static int sculpt_brush_stroke_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sculpt_brush_stroke_cacel(bContext *C, wmOperator *op) +static int sculpt_brush_stroke_cancel(bContext *C, wmOperator *op) { Object *ob= CTX_data_active_object(C); SculptSession *ss = ob->sculpt; @@ -3595,7 +3595,7 @@ static void SCULPT_OT_brush_stroke(wmOperatorType *ot) ot->modal= paint_stroke_modal; ot->exec= sculpt_brush_stroke_exec; ot->poll= sculpt_poll; - ot->cancel= sculpt_brush_stroke_cacel; + ot->cancel= sculpt_brush_stroke_cancel; /* flags (sculpt does own undo? (ton) */ ot->flag= OPTYPE_BLOCKING; diff --git a/source/blender/editors/space_console/console_draw.c b/source/blender/editors/space_console/console_draw.c index bf5df87610c..905fed4f30b 100644 --- a/source/blender/editors/space_console/console_draw.c +++ b/source/blender/editors/space_console/console_draw.c @@ -83,11 +83,13 @@ typedef struct ConsoleDrawContext { int console_width; int winx; int ymin, ymax; +#if 0 /* used by textview, may use later */ int *xy; // [2] int *sel; // [2] int *pos_pick; // bottom of view == 0, top of file == combine chars, end of line is lower then start. int *mval; // [2] int draw; +#endif } ConsoleDrawContext; void console_scrollback_prompt_begin(struct SpaceConsole *sc, ConsoleLine *cl_dummy) diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index adce540cee4..0210b0dd78d 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -662,7 +662,6 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char block= uiLayoutGetBlock(layout); - imaptr= RNA_property_pointer_get(ptr, prop); ima= imaptr.data; iuser= userptr->data; @@ -719,21 +718,17 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char } } else { - row= uiLayoutRow(layout, 0); - uiItemR(row, &imaptr, "source", 0, NULL, ICON_NONE); + uiItemR(layout, &imaptr, "source", 0, NULL, ICON_NONE); if(ima->source != IMA_SRC_GENERATED) { row= uiLayoutRow(layout, 1); - split = uiLayoutSplit(row, 0.0, 0); if (ima->packedfile) - uiItemO(split, "", ICON_PACKAGE, "image.unpack"); + uiItemO(row, "", ICON_PACKAGE, "image.unpack"); else - uiItemO(split, "", ICON_UGLYPACKAGE, "image.pack"); + uiItemO(row, "", ICON_UGLYPACKAGE, "image.pack"); - split = uiLayoutSplit(row, 0.0, 0); - row= uiLayoutRow(split, 1); + row= uiLayoutRow(row, 0); uiLayoutSetEnabled(row, ima->packedfile==NULL); - uiItemR(row, &imaptr, "filepath", 0, "", ICON_NONE); uiItemO(row, "", ICON_FILE_REFRESH, "image.reload"); } @@ -771,11 +766,10 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char col= uiLayoutColumn(split, 0); uiItemR(col, &imaptr, "use_fields", 0, NULL, ICON_NONE); row= uiLayoutRow(col, 0); - uiItemR(row, &imaptr, "field_order", UI_ITEM_R_EXPAND, NULL, ICON_NONE); uiLayoutSetActive(row, RNA_boolean_get(&imaptr, "use_fields")); - - col= uiLayoutColumn(split, 0); - uiItemR(col, &imaptr, "use_premultiply", 0, NULL, ICON_NONE); + uiItemR(row, &imaptr, "field_order", UI_ITEM_R_EXPAND, NULL, ICON_NONE); + + uiItemR(split, &imaptr, "use_premultiply", 0, NULL, ICON_NONE); } } @@ -787,10 +781,9 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char col= uiLayoutColumn(split, 0); sprintf(str, "(%d) Frames", iuser->framenr); - row= uiLayoutRow(col, 1); uiItemR(col, userptr, "frame_duration", 0, str, ICON_NONE); if(ima->anim) { - block= uiLayoutGetBlock(row); + block= uiLayoutGetBlock(col); but= uiDefBut(block, BUT, 0, "Match Movie Length", 0, 0, UI_UNIT_X*2, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Set the number of frames to match the movie or sequence."); uiButSetFunc(but, set_frames_cb, ima, iuser); } @@ -810,8 +803,7 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char uiItemR(col, &imaptr, "generated_width", 0, "X", ICON_NONE); uiItemR(col, &imaptr, "generated_height", 0, "Y", ICON_NONE); - col= uiLayoutColumn(split, 0); - uiItemR(col, &imaptr, "generated_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE); + uiItemR(split, &imaptr, "generated_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE); } } diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 99f2ea99efc..e539334c282 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -1366,10 +1366,17 @@ static int node_resize_invoke(bContext *C, wmOperator *op, wmEvent *event) UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &snode->mx, &snode->my); - /* rect we're interested in is just the bottom right corner */ totr= node->totr; - totr.xmin= totr.xmax-10.0f; - totr.ymax= totr.ymin+10.0f; + + if(node->flag & NODE_HIDDEN) { + /* right part of node */ + totr.xmin= node->totr.xmax-20.0f; + } + else { + /* bottom right corner */ + totr.xmin= totr.xmax-10.0f; + totr.ymax= totr.ymin+10.0f; + } if(BLI_in_rctf(&totr, snode->mx, snode->my)) { NodeSizeWidget *nsw= MEM_callocN(sizeof(NodeSizeWidget), "size widget op data"); diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 6900271deea..c8965c4d3db 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -124,7 +124,7 @@ typedef struct TransSeq { int startstill, endstill; int startdisp, enddisp; int startofs, endofs; - int final_left, final_right; + /* int final_left, final_right; */ /* UNUSED */ int len; } TransSeq; diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 6e8107c8a0d..c033cffb33c 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -253,19 +253,12 @@ typedef struct RenderData { */ short yparts; - short winpos, planes, imtype, subimtype; - - /** Mode bits: */ - /* 0: Enable backbuffering for images */ - short bufflag; - short quality; + short planes, imtype, subimtype, quality; /** * Render to image editor, fullscreen or to new window. */ short displaymode; - - short rpad1, rpad2; /** * Flags for render settings. Use bit-masking to access the settings. @@ -322,11 +315,7 @@ typedef struct RenderData { /** * Adjustment factors for the aspect ratio in the x direction, was a short in 2.45 */ - float xasp; - /** - * Adjustment factors for the aspect ratio in the x direction, was a short in 2.45 - */ - float yasp; + float xasp, yasp; float frs_sec_base; @@ -349,7 +338,7 @@ typedef struct RenderData { short bake_normal_space, bake_quad_split; float bake_maxdist, bake_biasdist, bake_pad; - /* paths to backbufffer, output */ + /* path to render output */ char pic[240]; /* stamps flags. */ diff --git a/source/blender/makesrna/intern/rna_controller.c b/source/blender/makesrna/intern/rna_controller.c index 92c762098c7..db5409bf7ef 100644 --- a/source/blender/makesrna/intern/rna_controller.c +++ b/source/blender/makesrna/intern/rna_controller.c @@ -87,6 +87,20 @@ static void rna_Controller_type_set(struct PointerRNA *ptr, int value) } } +static void rna_Controller_mode_set(struct PointerRNA *ptr, int value) +{ + bController *cont= (bController *)ptr->data; + bPythonCont *pycon= (bPythonCont *)cont->data; + + // if mode changed and previous mode were Script + if (value != pycon->mode && pycon->mode == CONT_PY_SCRIPT) + { + // clear script to avoid it to get linked with the controller + pycon->text = NULL; + } + pycon->mode = value; +} + static int rna_Controller_state_number_get(struct PointerRNA *ptr) { bController *cont= (bController *)ptr->data; @@ -222,6 +236,7 @@ void RNA_def_controller(BlenderRNA *brna) prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, python_controller_modes); + RNA_def_property_enum_funcs(prop, NULL, "rna_Controller_mode_set", NULL); RNA_def_property_ui_text(prop, "Execution Method", "Python script type (textblock or module - faster)"); RNA_def_property_update(prop, NC_LOGIC, NULL); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 61057cc6342..fd0016f7a74 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -245,6 +245,13 @@ static void rna_UserDef_weight_color_update(Main *bmain, Scene *scene, PointerRN static void rna_UserDef_viewport_lights_update(Main *bmain, Scene *scene, PointerRNA *ptr) { + /* if all lights are off gpu_draw resets them all, [#27627] + * so disallow them all to be disabled */ + if(U.light[0].flag==0 && U.light[1].flag==0 && U.light[2].flag==0) { + SolidLight *light= ptr->data; + light->flag |= 1; + } + WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D|NS_VIEW3D_GPU, NULL); rna_userdef_update(bmain, scene, ptr); } diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c index f1bc0d33fd8..10bcbee6661 100644 --- a/source/blender/modifiers/intern/MOD_explode.c +++ b/source/blender/modifiers/intern/MOD_explode.c @@ -779,11 +779,11 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd, ParticleSettings *part=psmd->psys->part; ParticleSimulationData sim= {NULL}; ParticleData *pa=NULL, *pars=psmd->psys->particles; - ParticleKey state; + ParticleKey state, birth; EdgeHash *vertpahash; EdgeHashIterator *ehi; float *vertco= NULL, imat[4][4]; - float loc0[3], nor[3]; + float rot[4]; float cfra; /* float timestep; */ int *facepa=emd->facepa; @@ -814,7 +814,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd, for (i=0; itime) + if(facepa[i]==totpart || cfra < (pars+facepa[i])->time) mindex = totvert+totpart; else mindex = totvert+facepa[i]; @@ -868,26 +868,26 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd, /* get particle */ pa= pars+i; - /* get particle state */ - psys_particle_on_emitter(psmd,part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,loc0,nor,NULL,NULL,NULL,NULL); - mul_m4_v3(ob->obmat,loc0); + psys_get_birth_coordinates(&sim, pa, &birth, 0, 0); state.time=cfra; psys_get_particle_state(&sim, i, &state, 1); vertco=CDDM_get_vert(explode,v)->co; - mul_m4_v3(ob->obmat,vertco); - VECSUB(vertco,vertco,loc0); + sub_v3_v3(vertco, birth.co); /* apply rotation, size & location */ - mul_qt_v3(state.rot,vertco); + sub_qt_qtqt(rot, state.rot, birth.rot); + mul_qt_v3(rot, vertco); + if(emd->flag & eExplodeFlag_PaSize) mul_v3_fl(vertco,pa->size); - VECADD(vertco,vertco,state.co); - mul_m4_v3(imat,vertco); + add_v3_v3(vertco, state.co); + + mul_m4_v3(imat, vertco); } } BLI_edgehashIterator_free(ehi); @@ -911,7 +911,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd, orig_v4 = source.v4; - if(facepa[i]!=totpart && cfra <= pa->time) + if(facepa[i]!=totpart && cfra < pa->time) mindex = totvert+totpart; else mindex = totvert+facepa[i]; diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h index 47230ab3089..23f301249ba 100644 --- a/source/blender/render/extern/include/RE_pipeline.h +++ b/source/blender/render/extern/include/RE_pipeline.h @@ -146,7 +146,7 @@ typedef struct RenderResult { typedef struct RenderStats { int cfra; int totface, totvert, totstrand, tothalo, totlamp, totpart; - short curfield, curblur, curpart, partsdone, convertdone; + short curfield, curblur, curpart, partsdone, convertdone, curfsa; double starttime, lastframetime; const char *infostr, *statstr; char scenename[32]; diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index cf16211b6d1..b2535ebc9ea 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -214,7 +214,7 @@ struct Render ListBase instancetable; int totinstance; - struct Image *backbuf, *bakebuf; + struct Image *bakebuf; struct GHash *orco_hash; diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index c1c2fb60abd..15fc9d38c01 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -4665,7 +4665,6 @@ void RE_Database_Free(Render *re) re->totvlak=re->totvert=re->totstrand=re->totlamp=re->tothalo= 0; re->i.convertdone= 0; - re->backbuf= NULL; re->bakebuf= NULL; if(re->scene) diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c index 1e40ab886ae..e2ab21ef877 100644 --- a/source/blender/render/intern/source/envmap.c +++ b/source/blender/render/intern/source/envmap.c @@ -149,7 +149,6 @@ static Render *envmap_render_copy(Render *re, EnvMap *env) envre->r.layers.first= envre->r.layers.last= NULL; envre->r.filtertype= 0; envre->r.xparts= envre->r.yparts= 2; - envre->r.bufflag= 0; envre->r.size= 100; envre->r.yasp= envre->r.xasp= 1; diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index e120854b6cf..90f07586786 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -2065,35 +2065,6 @@ static void do_render_fields_3d(Render *re) re->display_draw(re->ddh, re->result, NULL); } -static void load_backbuffer(Render *re) -{ - if(re->r.alphamode == R_ADDSKY) { - ImBuf *ibuf; - char name[256]; - - BLI_path_abs(name, re->main->name); - BLI_path_frame(name, re->r.cfra, 0); - - if(re->backbuf) { - re->backbuf->id.us--; - if(re->backbuf->id.us<1) - BKE_image_signal(re->backbuf, NULL, IMA_SIGNAL_RELOAD); - } - - re->backbuf= BKE_add_image_file(name); - ibuf= BKE_image_get_ibuf(re->backbuf, NULL); - if(ibuf==NULL) { - // error() doesnt work with render window open - //error("No backbuf there!"); - printf("Error: No backbuf %s\n", name); - } - else { - if (re->r.mode & R_FIELDS) - image_de_interlace(re->backbuf, re->r.mode & R_ODDFIELD); - } - } -} - /* main render routine, no compositing */ static void do_render_fields_blur_3d(Render *re) { @@ -2104,10 +2075,6 @@ static void do_render_fields_blur_3d(Render *re) G.afbreek= 1; return; } - - /* backbuffer initialize */ - if(re->r.bufflag & 1) - load_backbuffer(re); /* now use renderdata and camera to set viewplane */ RE_SetCamera(re, camera); @@ -2202,6 +2169,24 @@ static void render_scene(Render *re, Scene *sce, int cfra) do_render_fields_blur_3d(resc); } +/* helper call to detect if this scene needs a render, or if there's a any render layer to render */ +static int composite_needs_render(Scene *sce, int this_scene) +{ + bNodeTree *ntree= sce->nodetree; + bNode *node; + + if(ntree==NULL) return 1; + if(sce->use_nodes==0) return 1; + if((sce->r.scemode & R_DOCOMP)==0) return 1; + + for(node= ntree->nodes.first; node; node= node->next) { + if(node->type==CMP_NODE_R_LAYERS) + if(this_scene==0 || node->id==NULL || node->id==&sce->id) + return 1; + } + return 0; +} + static void tag_scenes_for_render(Render *re) { bNode *node; @@ -2210,7 +2195,8 @@ static void tag_scenes_for_render(Render *re) for(sce= re->main->scene.first; sce; sce= sce->id.next) sce->id.flag &= ~LIB_DOIT; - re->scene->id.flag |= LIB_DOIT; + if(RE_GetCamera(re) && composite_needs_render(re->scene, 1)) + re->scene->id.flag |= LIB_DOIT; if(re->scene->nodetree==NULL) return; @@ -2257,24 +2243,6 @@ static void ntree_render_scenes(Render *re) set_scene_bg(re->main, re->scene); } -/* helper call to detect if theres a composite with render-result node */ -static int composite_needs_render(Scene *sce) -{ - bNodeTree *ntree= sce->nodetree; - bNode *node; - - if(ntree==NULL) return 1; - if(sce->use_nodes==0) return 1; - if((sce->r.scemode & R_DOCOMP)==0) return 1; - - for(node= ntree->nodes.first; node; node= node->next) { - if(node->type==CMP_NODE_R_LAYERS) - if(node->id==NULL || node->id==&sce->id) - return 1; - } - return 0; -} - /* bad call... need to think over proper method still */ static void render_composit_stats(void *UNUSED(arg), char *str) { @@ -2290,6 +2258,16 @@ static void do_merge_fullsample(Render *re, bNodeTree *ntree) float *rectf, filt[3][3]; int sample; + /* interaction callbacks */ + if(ntree) { + ntree->stats_draw= render_composit_stats; + ntree->test_break= re->test_break; + ntree->progress= re->progress; + ntree->sdh= re->sdh; + ntree->tbh= re->tbh; + ntree->prh= re->prh; + } + /* filtmask needs it */ R= *re; @@ -2297,25 +2275,27 @@ static void do_merge_fullsample(Render *re, bNodeTree *ntree) rectf= MEM_mapallocN(re->rectx*re->recty*sizeof(float)*4, "fullsample rgba"); for(sample=0; sampler.osa; sample++) { + Render *re1; RenderResult rres; int x, y, mask; - /* set all involved renders on the samplebuffers (first was done by render itself) */ + /* enable full sample print */ + R.i.curfsa= sample+1; + + /* set all involved renders on the samplebuffers (first was done by render itself, but needs tagged) */ /* also function below assumes this */ - if(sample) { - Render *re1; - tag_scenes_for_render(re); - for(re1= RenderGlobal.renderlist.first; re1; re1= re1->next) { - if(re1->scene->id.flag & LIB_DOIT) { - if(re1->r.scemode & R_FULL_SAMPLE) { + tag_scenes_for_render(re); + for(re1= RenderGlobal.renderlist.first; re1; re1= re1->next) { + if(re1->scene->id.flag & LIB_DOIT) { + if(re1->r.scemode & R_FULL_SAMPLE) { + if(sample) read_render_result(re1, sample); - ntreeCompositTagRender(re1->scene); /* ensure node gets exec to put buffers on stack */ - } + ntreeCompositTagRender(re1->scene); /* ensure node gets exec to put buffers on stack */ } } } - + /* composite */ if(ntree) { ntreeCompositTagRender(re->scene); @@ -2358,6 +2338,17 @@ static void do_merge_fullsample(Render *re, bNodeTree *ntree) break; } + /* clear interaction callbacks */ + if(ntree) { + ntree->stats_draw= NULL; + ntree->test_break= NULL; + ntree->progress= NULL; + ntree->tbh= ntree->sdh= ntree->prh= NULL; + } + + /* disable full sample print */ + R.i.curfsa= 0; + BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE); if(re->result->rectf) MEM_freeN(re->result->rectf); @@ -2397,8 +2388,10 @@ void RE_MergeFullSample(Render *re, Main *bmain, Scene *sce, bNodeTree *ntree) } /* own render result should be read/allocated */ - if(re->scene->id.flag & LIB_DOIT) + if(re->scene->id.flag & LIB_DOIT) { RE_ReadRenderResult(re->scene, re->scene); + re->scene->id.flag &= ~LIB_DOIT; + } /* and now we can draw (result is there) */ re->display_init(re->dih, re->result); @@ -2416,12 +2409,21 @@ static void do_render_composite_fields_blur_3d(Render *re) /* INIT seeding, compositor can use random texture */ BLI_srandom(re->r.cfra); - if(composite_needs_render(re->scene)) { + if(composite_needs_render(re->scene, 1)) { /* save memory... free all cached images */ ntreeFreeCache(ntree); do_render_fields_blur_3d(re); - } else { + } + else { + /* ensure new result gets added, like for regular renders */ + BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE); + + RE_FreeRenderResult(re->result); + re->result= new_render_result(re, &re->disprect, 0, RR_USEMEM); + + BLI_rw_mutex_unlock(&re->resultmutex); + /* scene render process already updates animsys */ update_newframe = 1; } @@ -2757,7 +2759,7 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, void *erh, vo } if(scene->r.scemode & R_FULL_SAMPLE) { - if(composite_needs_render(scene)==0) { + if(composite_needs_render(scene, 0)==0) { error(erh, "Full Sample AA not supported without 3d rendering"); return 0; } diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c index 2d42938f6ac..56a1c870904 100644 --- a/source/blender/render/intern/source/pixelshading.c +++ b/source/blender/render/intern/source/pixelshading.c @@ -502,21 +502,6 @@ int shadeHaloFloat(HaloRen *har, float *col, int zz, /* ------------------------------------------------------------------------- */ -static void fillBackgroundImage(float *collector, float fx, float fy) -{ - collector[0] = 0.0; - collector[1] = 0.0; - collector[2] = 0.0; - collector[3] = 0.0; - - if(R.backbuf) { - float dx= 1.0f/(float)R.winx; - float dy= 1.0f/(float)R.winy; - - image_sample(R.backbuf, fx*dx, fy*dy, dx, dy, collector); - } -} - /* Only view vector is important here. Result goes to colf[3] */ void shadeSkyView(float *colf, float *rco, float *view, float *dxyview, short thread) { @@ -626,18 +611,14 @@ void shadeSkyPixel(float *collector, float fx, float fy, short thread) float fac; - /* 1. Do a backbuffer image: */ - if(R.r.bufflag & 1) { - fillBackgroundImage(collector, fx, fy); - } - else if((R.wrld.skytype & (WO_SKYBLEND+WO_SKYTEX))==0) { - /* 2. solid color */ + if((R.wrld.skytype & (WO_SKYBLEND+WO_SKYTEX))==0) { + /* 1. solid color */ VECCOPY(collector, &R.wrld.horr); collector[3] = 0.0f; } else { - /* 3. */ + /* 2. */ /* This one true because of the context of this routine */ if(R.wrld.skytype & WO_SKYPAPER) { diff --git a/source/blenderplayer/CMakeLists.txt b/source/blenderplayer/CMakeLists.txt index 901aaea3eca..5fe045fda10 100644 --- a/source/blenderplayer/CMakeLists.txt +++ b/source/blenderplayer/CMakeLists.txt @@ -183,6 +183,12 @@ endif() message(STATUS "Player Skipping: (${REM_MSG})") endif() target_link_libraries(blenderplayer ${BLENDER_SORTED_LIBS}) + + unset(SEARCHLIB) + unset(SORTLIB) + unset(REMLIB) + unset(REM_MSG) + # else() # target_link_libraries(blenderplayer ${BLENDER_LINK_LIBS}) # endif() diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 7dd22bba08a..d493f789479 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -853,6 +853,12 @@ endif() message(STATUS "Blender Skipping: (${REM_MSG})") endif() target_link_libraries(blender ${BLENDER_SORTED_LIBS}) + + unset(SEARCHLIB) + unset(SORTLIB) + unset(REMLIB) + unset(REM_MSG) + #else() # target_link_libraries(blender ${BLENDER_LINK_LIBS}) #endif() diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h index 97dc65c5850..08445654916 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h @@ -226,18 +226,43 @@ struct CcdConstructionInfo CcdConstructionInfo() - : m_localInertiaTensor(1.f, 1.f, 1.f), + :m_localInertiaTensor(1.f, 1.f, 1.f), m_gravity(0,0,0), m_scaling(1.f,1.f,1.f), m_mass(0.f), - m_clamp_vel_min(-1.f), - m_clamp_vel_max(-1.f), + m_clamp_vel_min(-1.f), + m_clamp_vel_max(-1.f), m_restitution(0.1f), m_friction(0.5f), m_linearDamping(0.1f), m_angularDamping(0.1f), m_margin(0.06f), m_gamesoftFlag(0), + m_soft_linStiff(1.f), + m_soft_angStiff(1.f), + m_soft_volume(1.f), + m_soft_viterations(0), + m_soft_piterations(1), + m_soft_diterations(0), + m_soft_citerations(4), + m_soft_kSRHR_CL(0.1f), + m_soft_kSKHR_CL(1.f), + m_soft_kSSHR_CL(0.5f), + m_soft_kSR_SPLT_CL(0.5f), + m_soft_kSK_SPLT_CL(0.5f), + m_soft_kSS_SPLT_CL(0.5f), + m_soft_kVCF(1.f), + m_soft_kDP(0.f), + m_soft_kDG(0.f), + m_soft_kLF(0.f), + m_soft_kPR(0.f), + m_soft_kVC(0.f), + m_soft_kDF(0.2f), + m_soft_kMT(0), + m_soft_kCHR(1.0f), + m_soft_kKHR(0.1f), + m_soft_kSHR(1.0f), + m_soft_kAHR(0.7f), m_collisionFlags(0), m_bRigid(false), m_bSoft(false), @@ -252,38 +277,13 @@ struct CcdConstructionInfo m_inertiaFactor(1.f), m_do_anisotropic(false), m_anisotropicFriction(1.f,1.f,1.f), - m_contactProcessingThreshold(1e10f), - m_soft_linStiff(1.f), - m_soft_angStiff(1.f), - m_soft_volume(1.f), - m_soft_viterations(0), - m_soft_piterations(1), - m_soft_diterations(0), - m_soft_citerations(4), m_do_fh(false), m_do_rot_fh(false), m_fh_spring(0.f), m_fh_damping(0.f), m_fh_distance(1.f), m_fh_normal(false), - m_soft_kVCF(1.f), - m_soft_kDG(0.f), - m_soft_kLF(0.f), - m_soft_kDP(0.f), - m_soft_kPR(0.f), - m_soft_kVC(0.f), - m_soft_kDF(0.2f), - m_soft_kMT(0), - m_soft_kCHR(1.0f), - m_soft_kKHR(0.1f), - m_soft_kSHR(1.0f), - m_soft_kAHR(0.7f), - m_soft_kSRHR_CL(0.1f), - m_soft_kSKHR_CL(1.f), - m_soft_kSSHR_CL(0.5f), - m_soft_kSR_SPLT_CL(0.5f), - m_soft_kSK_SPLT_CL(0.5f), - m_soft_kSS_SPLT_CL(0.5f) + m_contactProcessingThreshold(1e10f) { }