diff options
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/library_remap.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh_evaluate.c | 24 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sound.c | 18 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/writeffmpeg.c | 48 |
5 files changed, 58 insertions, 42 deletions
diff --git a/source/blender/blenkernel/intern/library_remap.c b/source/blender/blenkernel/intern/library_remap.c index f76fc628ed0..d7d566a9ec0 100644 --- a/source/blender/blenkernel/intern/library_remap.c +++ b/source/blender/blenkernel/intern/library_remap.c @@ -562,8 +562,14 @@ void BKE_libblock_remap_locked( default: break; } + /* Node trees may virtually use any kind of data-block... */ + /* XXX Yuck!!!! nodetree update can do pretty much any thing when talking about py nodes, + * including creating new data-blocks (see T50385), so we need to unlock main here. :( + * Why can't we have re-entrent locks? */ + BKE_main_unlock(bmain); libblock_remap_data_postprocess_nodetree_update(bmain, new_id); + BKE_main_lock(bmain); /* Full rebuild of DAG! */ DAG_relations_tag_update(bmain); diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c b/source/blender/blenkernel/intern/mesh_evaluate.c index a3fe73e4b11..f9eba118383 100644 --- a/source/blender/blenkernel/intern/mesh_evaluate.c +++ b/source/blender/blenkernel/intern/mesh_evaluate.c @@ -1909,19 +1909,19 @@ void BKE_mesh_calc_poly_center( const MVert *mvarray, float r_cent[3]) { if (mpoly->totloop == 3) { - cent_tri_v3(r_cent, - mvarray[loopstart[0].v].co, - mvarray[loopstart[1].v].co, - mvarray[loopstart[2].v].co - ); + mid_v3_v3v3v3(r_cent, + mvarray[loopstart[0].v].co, + mvarray[loopstart[1].v].co, + mvarray[loopstart[2].v].co + ); } else if (mpoly->totloop == 4) { - cent_quad_v3(r_cent, - mvarray[loopstart[0].v].co, - mvarray[loopstart[1].v].co, - mvarray[loopstart[2].v].co, - mvarray[loopstart[3].v].co - ); + mid_v3_v3v3v3v3(r_cent, + mvarray[loopstart[0].v].co, + mvarray[loopstart[1].v].co, + mvarray[loopstart[2].v].co, + mvarray[loopstart[3].v].co + ); } else { mesh_calc_ngon_center(mpoly, loopstart, mvarray, r_cent); @@ -1978,7 +1978,7 @@ static float mesh_calc_poly_planar_area_centroid( tri_area = area_tri_signed_v3(v1, v2, v3, normal); total_area += tri_area; - cent_tri_v3(tri_cent, v1, v2, v3); + mid_v3_v3v3v3(tri_cent, v1, v2, v3); madd_v3_v3fl(r_cent, tri_cent, tri_area); copy_v3_v3(v2, v3); diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index c6666ec5ced..e93bfcdda83 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -246,6 +246,10 @@ bool BKE_object_support_modifier_type_check(Object *ob, int modifier_type) mti = modifierType_getInfo(modifier_type); + /* only geometry objects should be able to get modifiers [#25291] */ + if (!ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_LATTICE)) { + return false; + } if (ob->type == OB_LATTICE && (mti->flags & eModifierTypeFlag_AcceptsLattice) == 0) { return false; diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index d5a395ffc4b..22288127119 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -454,6 +454,16 @@ void BKE_sound_destroy_scene(struct Scene *scene) AUD_destroySet(scene->speaker_handles); } +void BKE_sound_reset_scene_specs(struct Scene *scene) +{ + AUD_Specs specs; + + specs.channels = AUD_Device_getChannels(sound_device); + specs.rate = AUD_Device_getRate(sound_device); + + AUD_Sequence_setSpecs(scene->sound_scene, specs); +} + void BKE_sound_mute_scene(struct Scene *scene, int muted) { if (scene->sound_scene) @@ -580,15 +590,10 @@ void BKE_sound_update_sequencer(struct Main *main, bSound *sound) static void sound_start_play_scene(struct Scene *scene) { - AUD_Specs specs; - if (scene->playback_handle) AUD_Handle_stop(scene->playback_handle); - specs.channels = AUD_Device_getChannels(sound_device); - specs.rate = AUD_Device_getRate(sound_device); - - AUD_Sequence_setSpecs(scene->sound_scene, specs); + BKE_sound_reset_scene_specs(scene); if ((scene->playback_handle = AUD_Device_play(sound_device, scene->sound_scene, 1))) AUD_Handle_setLoopCount(scene->playback_handle, -1); @@ -910,6 +915,7 @@ void BKE_sound_delete_cache(struct bSound *UNUSED(sound)) {} void BKE_sound_load(struct Main *UNUSED(bmain), struct bSound *UNUSED(sound)) {} void BKE_sound_create_scene(struct Scene *UNUSED(scene)) {} void BKE_sound_destroy_scene(struct Scene *UNUSED(scene)) {} +void BKE_sound_reset_scene_specs(struct Scene *UNUSED(scene)) {} void BKE_sound_mute_scene(struct Scene *UNUSED(scene), int UNUSED(muted)) {} void *BKE_sound_scene_add_scene_sound(struct Scene *UNUSED(scene), struct Sequence *UNUSED(sequence), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) { return NULL; } diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index b0ab6f707fa..9994d479ce7 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -444,7 +444,7 @@ static void set_ffmpeg_property_option(AVCodecContext *c, IDProperty *prop, AVDi param = strchr(name, ':'); if (param) { - *param++ = 0; + *param++ = '\0'; } switch (prop->type) { @@ -1114,7 +1114,7 @@ static void ffmpeg_filepath_get(FFMpegContext *context, char *string, RenderData BLI_make_existing_file(string); - autosplit[0] = 0; + autosplit[0] = '\0'; if ((rd->ffcodecdata.flags & FFMPEG_AUTOSPLIT_OUTPUT) != 0) { if (context) { @@ -1137,7 +1137,7 @@ static void ffmpeg_filepath_get(FFMpegContext *context, char *string, RenderData strcat(string, *exts); } else { - *(string + strlen(string) - strlen(*fe)) = 0; + *(string + strlen(string) - strlen(*fe)) = '\0'; strcat(string, autosplit); strcat(string, *fe); } @@ -1267,7 +1267,7 @@ static void end_ffmpeg_impl(FFMpegContext *context, int is_autosplit) if (is_autosplit == false) { if (context->audio_mixdown_device) { AUD_Device_free(context->audio_mixdown_device); - context->audio_mixdown_device = 0; + context->audio_mixdown_device = NULL; } } #endif @@ -1283,50 +1283,50 @@ static void end_ffmpeg_impl(FFMpegContext *context, int is_autosplit) /* Close the video codec */ - if (context->video_stream && context->video_stream->codec) { + if (context->video_stream != NULL && context->video_stream->codec != NULL) { avcodec_close(context->video_stream->codec); PRINT("zero video stream %p\n", context->video_stream); - context->video_stream = 0; + context->video_stream = NULL; } - if (context->audio_stream && context->audio_stream->codec) { + if (context->audio_stream != NULL && context->audio_stream->codec != NULL) { avcodec_close(context->audio_stream->codec); - context->audio_stream = 0; + context->audio_stream = NULL; } /* free the temp buffer */ - if (context->current_frame) { + if (context->current_frame != NULL) { delete_picture(context->current_frame); - context->current_frame = 0; + context->current_frame = NULL; } - if (context->outfile && context->outfile->oformat) { + if (context->outfile != NULL && context->outfile->oformat) { if (!(context->outfile->oformat->flags & AVFMT_NOFILE)) { avio_close(context->outfile->pb); } } - if (context->outfile) { + if (context->outfile != NULL) { avformat_free_context(context->outfile); - context->outfile = 0; + context->outfile = NULL; } - if (context->audio_input_buffer) { + if (context->audio_input_buffer != NULL) { av_free(context->audio_input_buffer); - context->audio_input_buffer = 0; + context->audio_input_buffer = NULL; } #ifndef FFMPEG_HAVE_ENCODE_AUDIO2 - if (context->audio_output_buffer) { + if (context->audio_output_buffer != NULL) { av_free(context->audio_output_buffer); - context->audio_output_buffer = 0; + context->audio_output_buffer = NULL; } #endif - if (context->audio_deinterleave_buffer) { + if (context->audio_deinterleave_buffer != NULL) { av_free(context->audio_deinterleave_buffer); - context->audio_deinterleave_buffer = 0; + context->audio_deinterleave_buffer = NULL; } - if (context->img_convert_ctx) { + if (context->img_convert_ctx != NULL) { sws_freeContext(context->img_convert_ctx); - context->img_convert_ctx = 0; + context->img_convert_ctx = NULL; } } @@ -1425,8 +1425,8 @@ static IDProperty *BKE_ffmpeg_property_add(RenderData *rd, const char *type, con int BKE_ffmpeg_property_add_string(RenderData *rd, const char *type, const char *str) { AVCodecContext c; - const AVOption *o = 0; - const AVOption *p = 0; + const AVOption *o = NULL; + const AVOption *p = NULL; char name_[128]; char *name; char *param; @@ -1445,7 +1445,7 @@ int BKE_ffmpeg_property_add_string(RenderData *rd, const char *type, const char param = strchr(name, ' '); } if (param) { - *param++ = 0; + *param++ = '\0'; while (*param == ' ') param++; } |