From 001789d7337a5497a662427369ae9a178f717845 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 18 Jan 2018 14:49:09 +1100 Subject: Fix T53808: VSE doesn't show scene strip markers --- source/blender/blenkernel/intern/scene.c | 4 ++++ source/blender/blenkernel/intern/sequencer.c | 13 +++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 0baf611b293..126761ed14b 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -1139,6 +1139,10 @@ Object *BKE_scene_camera_find(Scene *sc) #ifdef DURIAN_CAMERA_SWITCH Object *BKE_scene_camera_switch_find(Scene *scene) { + if (scene->r.mode & R_NO_CAMERA_SWITCH) { + return NULL; + } + TimeMarker *m; int cfra = scene->r.cfra; int frame = -(MAXFRAME + 1); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index b3db2080cb8..5066759f343 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -3199,11 +3199,12 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, Sequence *seq int scemode; int cfra; float subframe; + #ifdef DURIAN_CAMERA_SWITCH - ListBase markers; + int mode; #endif } orig_data; - + /* Old info: * Hack! This function can be called from do_render_seq(), in that case * the seq->scene can already have a Render initialized with same name, @@ -3263,7 +3264,7 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, Sequence *seq orig_data.cfra = scene->r.cfra; orig_data.subframe = scene->r.subframe; #ifdef DURIAN_CAMERA_SWITCH - orig_data.markers = scene->markers; + orig_data.mode = scene->r.mode; #endif BKE_scene_frame_set(scene, frame); @@ -3286,10 +3287,10 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, Sequence *seq /* prevent eternal loop */ scene->r.scemode &= ~R_DOSEQ; - + #ifdef DURIAN_CAMERA_SWITCH /* stooping to new low's in hackyness :( */ - BLI_listbase_clear(&scene->markers); + scene->r.mode |= R_NO_CAMERA_SWITCH; #endif is_frame_update = (orig_data.cfra != scene->r.cfra) || (orig_data.subframe != scene->r.subframe); @@ -3409,7 +3410,7 @@ finally: #ifdef DURIAN_CAMERA_SWITCH /* stooping to new low's in hackyness :( */ - scene->markers = orig_data.markers; + scene->r.mode &= ~(orig_data.mode & R_NO_CAMERA_SWITCH); #endif return ibuf; -- cgit v1.2.3 From 42a562496b506614c01f4df2589039f35a0fb536 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 18 Jan 2018 20:54:49 +1100 Subject: Fix memory leak in recent curve refactor 5b25605761fb7 --- source/blender/blenkernel/intern/curve.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 1a744ddaf03..d18fda632aa 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -2623,6 +2623,9 @@ void BKE_curve_bevelList_free(ListBase *bev) if (bl->segbevcount != NULL) { MEM_freeN(bl->segbevcount); } + if (bl->bevpoints != NULL) { + MEM_freeN(bl->bevpoints); + } MEM_freeN(bl); } -- cgit v1.2.3 From 2b9fb723edc2eba3f408c64b07291dc72434b680 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 19 Jan 2018 12:07:14 +1100 Subject: Fix T53832: Particle weight paint crash Drawing hair weights read before the hair array start. This code could be improved since it currently copy-pastes, from do_particle_interpolation, but this would need larger changes. For now just correct existing logic. --- source/blender/blenkernel/intern/particle.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index c0849e6bff4..ba75760c07a 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -2827,7 +2827,8 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf if (pset->brushtype == PE_BRUSH_WEIGHT) { pind.hkey[0] = NULL; /* pa != NULL since the weight brush is only available for hair */ - pind.hkey[1] = pa->hair; + pind.hkey[0] = pa->hair; + pind.hkey[1] = pa->hair + 1; } @@ -2885,12 +2886,26 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf /* selection coloring in edit mode */ if (pset->brushtype == PE_BRUSH_WEIGHT) { - float t2; - if (k == 0) { weight_to_rgb(ca->col, pind.hkey[1]->weight); } else { + /* warning: copied from 'do_particle_interpolation' (without 'mvert' array stepping) */ + float real_t; + if (result.time < 0.0f) { + real_t = -result.time; + } + else { + real_t = pind.hkey[0]->time + t * (pind.hkey[0][pa->totkey - 1].time - pind.hkey[0]->time); + } + + while (pind.hkey[1]->time < real_t) { + pind.hkey[1]++; + } + pind.hkey[0] = pind.hkey[1] - 1; + /* end copy */ + + float w1[3], w2[3]; keytime = (t - (*pind.ekey[0]->time)) / ((*pind.ekey[1]->time) - (*pind.ekey[0]->time)); @@ -2899,13 +2914,6 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf interp_v3_v3v3(ca->col, w1, w2, keytime); } - - /* at the moment this is only used for weight painting. - * will need to move out of this check if its used elsewhere. */ - t2 = birthtime + ((float)k / (float)segments) * (dietime - birthtime); - - while (pind.hkey[1]->time < t2) pind.hkey[1]++; - pind.hkey[0] = pind.hkey[1] - 1; } else { if ((ekey + (pind.ekey[0] - point->keys))->flag & PEK_SELECT) { -- cgit v1.2.3 From 368414efacc2b7260c02b0cb77a7b24c1e054f39 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 19 Jan 2018 12:25:09 +1100 Subject: Fix T53823: Particle weight brush crash Entering particle edit mode w/ the weight brush enabled crashed on non-hair particle systems. --- source/blender/blenkernel/intern/particle.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index ba75760c07a..26e7562590d 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -2794,7 +2794,9 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf /* frs_sec = (psys || edit->pid.flag & PTCACHE_VEL_PER_SEC) ? 25.0f : 1.0f; */ /* UNUSED */ - if (pset->brushtype == PE_BRUSH_WEIGHT) { + const bool use_weight = (pset->brushtype == PE_BRUSH_WEIGHT) && (psys != NULL) && (psys->particles != NULL); + + if (use_weight) { ; /* use weight painting colors now... */ } else { @@ -2824,7 +2826,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf /* should init_particle_interpolation set this ? */ - if (pset->brushtype == PE_BRUSH_WEIGHT) { + if (use_weight) { pind.hkey[0] = NULL; /* pa != NULL since the weight brush is only available for hair */ pind.hkey[0] = pa->hair; @@ -2885,7 +2887,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf } /* selection coloring in edit mode */ - if (pset->brushtype == PE_BRUSH_WEIGHT) { + if (use_weight) { if (k == 0) { weight_to_rgb(ca->col, pind.hkey[1]->weight); } -- cgit v1.2.3 From 7a24e0d175827824d139f7627de2a5af34d687fb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 19 Jan 2018 15:34:54 +1100 Subject: Cleanup: typos --- source/blender/blenkernel/BKE_world.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/BKE_world.h b/source/blender/blenkernel/BKE_world.h index dfa367afeb2..b28bac08727 100644 --- a/source/blender/blenkernel/BKE_world.h +++ b/source/blender/blenkernel/BKE_world.h @@ -38,11 +38,10 @@ struct World; void BKE_world_free(struct World *sc); void BKE_world_init(struct World *wrld); -struct World *BKE_world_add(struct Main *bmian, const char *name); +struct World *BKE_world_add(struct Main *bmain, const char *name); void BKE_world_copy_data(struct Main *bmain, struct World *wrld_dst, const struct World *wrld_src, const int flag); struct World *BKE_world_copy(struct Main *bmain, const struct World *wrld); struct World *BKE_world_localize(struct World *wrld); void BKE_world_make_local(struct Main *bmain, struct World *wrld, const bool lib_local); -#endif - +#endif /* __BKE_WORLD_H__ */ -- cgit v1.2.3