From f64189573d70422fd4b98e2c204b2d2478d2b5d3 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Mon, 28 Nov 2011 17:10:32 +0000 Subject: * Never, ever use "col2" or something like that as UI variable name. --- release/scripts/startup/bl_ui/space_clip.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index d5171d119f7..89e15fec828 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -120,9 +120,9 @@ class CLIP_PT_tools_marker(Panel): col.separator() - col2 = col.column(align=True) - col2.prop(settings, "default_pattern_size") - col2.prop(settings, "default_search_size") + sub = col.column(align=True) + sub.prop(settings, "default_pattern_size") + sub.prop(settings, "default_search_size") col.label(text="Tracker:") col.prop(settings, "default_tracker", text="") @@ -134,9 +134,9 @@ class CLIP_PT_tools_marker(Panel): col.separator() - col2 = col.column(align=True) - col2.prop(settings, "default_frames_limit") - col2.prop(settings, "default_margin") + sub = col.column(align=True) + sub.prop(settings, "default_frames_limit") + sub.prop(settings, "default_margin") col.label(text="Match:") col.prop(settings, "default_pattern_match", text="") -- cgit v1.2.3 From 9aaa67cc4c4e1116dffe802969ea3a17ff88e4d8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 28 Nov 2011 17:19:25 +0000 Subject: corrections for docs --- doc/python_api/rst/info_best_practice.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/python_api/rst/info_best_practice.rst b/doc/python_api/rst/info_best_practice.rst index 180a9fd1aa3..f4daed9ad9f 100644 --- a/doc/python_api/rst/info_best_practice.rst +++ b/doc/python_api/rst/info_best_practice.rst @@ -39,7 +39,7 @@ As well as pep8 we have other conventions used for blender python scripts. .. code-block:: python - bpy.context.scene.render.file_format = 'PNG' + bpy.context.scene.render.image_settings.file_format = 'PNG' bpy.context.scene.render.filepath = "//render_out" * pep8 also defines that lines should not exceed 79 characters, we felt this is too restrictive so this is optional per script. @@ -181,7 +181,7 @@ When removing many items in a large list this can provide a good speedup. Avoid Copying Lists ^^^^^^^^^^^^^^^^^^^ -When passing a list/dictionary to a function, it is faster to have the function modify the list rather then returning a new list so python dosn't have tp duplicate the list in memory. +When passing a list/dictionary to a function, it is faster to have the function modify the list rather then returning a new list so python doesn't have to duplicate the list in memory. Functions that modify a list in-place are more efficient then functions that create new lists. -- cgit v1.2.3 From 3ff8ff90ea66481b2604c147312a3348daece0c6 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 28 Nov 2011 17:55:01 +0000 Subject: Reset V3D_RENDER_SHADOW flag on file loading. This flag shouldn't be saved in .blend files but because of strange reason some files contains this flags which leads to object disappearing when disabling buffer shadow in material. Current trunk shouldn't be saving this flag and most probably buggy files were saved in some intermediate version of blender where this flag can be be saved. This should fix remained issue in #29255: Object invisible and weird polygons appearance --- source/blender/blenloader/intern/readfile.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 3db36a075d7..61d023d7fc0 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -12608,6 +12608,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) { Scene *sce; MovieClip *clip; + bScreen *sc; for(sce = main->scene.first; sce; sce = sce->id.next) { if (sce->r.im_format.depth == 0) { @@ -12626,6 +12627,19 @@ static void do_versions(FileData *fd, Library *lib, Main *main) settings->default_search_size= 51; } } + + for (sc= main->screen.first; sc; sc= sc->id.next) { + ScrArea *sa; + for (sa= sc->areabase.first; sa; sa= sa->next) { + SpaceLink *sl; + for (sl= sa->spacedata.first; sl; sl= sl->next) { + if(sl->spacetype==SPACE_VIEW3D) { + View3D *v3d= (View3D *)sl; + v3d->flag2&= ~V3D_RENDER_SHADOW; + } + } + } + } } /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ -- cgit v1.2.3 From ac88b67b3034757854a3038582ef8dd31a2e91a7 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 28 Nov 2011 19:22:26 +0000 Subject: Now wiki link in help menu opens the 2.6 index... Better to do it now than one day before release, and good incitation to finish 2.5/6 index before release! --- release/scripts/startup/bl_ui/space_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py index 2d22a398624..ebe0e4d756e 100644 --- a/release/scripts/startup/bl_ui/space_info.py +++ b/release/scripts/startup/bl_ui/space_info.py @@ -359,7 +359,7 @@ class INFO_MT_help(Menu): layout = self.layout - layout.operator("wm.url_open", text="Manual", icon='HELP').url = 'http://wiki.blender.org/index.php/Doc:Manual' + layout.operator("wm.url_open", text="Manual", icon='HELP').url = 'http://wiki.blender.org/index.php/Doc:2.6/Manual' layout.operator("wm.url_open", text="Release Log", icon='URL').url = 'http://www.blender.org/development/release-logs/blender-260/' layout.separator() -- cgit v1.2.3 From 0668ad2d55935b5f7ecc6f8f4c9b38e27db7ec65 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 28 Nov 2011 21:48:49 +0000 Subject: Camera tracking: SAD tracker now supports patterns with any size (rectangle patterns are getting enlarged to square like it's happening for KLT) --- extern/libmv/libmv-capi.cpp | 8 +++--- extern/libmv/libmv-capi.h | 4 +-- extern/libmv/libmv/tracking/sad.cc | 23 +++++++++++++--- source/blender/blenkernel/intern/tracking.c | 41 ++++++++++++++++------------- 4 files changed, 48 insertions(+), 28 deletions(-) diff --git a/extern/libmv/libmv-capi.cpp b/extern/libmv/libmv-capi.cpp index f08aea9fbd1..aa05279d731 100644 --- a/extern/libmv/libmv-capi.cpp +++ b/extern/libmv/libmv-capi.cpp @@ -297,16 +297,16 @@ void libmv_regionTrackerDestroy(libmv_RegionTracker *libmv_tracker) /* ************ Tracks ************ */ void libmv_SADSamplePattern(unsigned char *image, int stride, - float warp[3][2], unsigned char *pattern) + float warp[3][2], unsigned char *pattern, int pattern_size) { libmv::mat32 mat32; memcpy(mat32.data, warp, sizeof(float)*3*2); - libmv::SamplePattern(image, stride, mat32, pattern, 16); + libmv::SamplePattern(image, stride, mat32, pattern, pattern_size); } -float libmv_SADTrackerTrack(unsigned char *pattern, unsigned char *warped, unsigned char *image, int stride, +float libmv_SADTrackerTrack(unsigned char *pattern, unsigned char *warped, int pattern_size, unsigned char *image, int stride, int width, int height, float warp[3][2]) { float result; @@ -314,7 +314,7 @@ float libmv_SADTrackerTrack(unsigned char *pattern, unsigned char *warped, unsig memcpy(mat32.data, warp, sizeof(float)*3*2); - result = libmv::Track(pattern, warped, 16, image, stride, width, height, &mat32, 16, 16); + result = libmv::Track(pattern, warped, pattern_size, image, stride, width, height, &mat32, 16, 16); memcpy(warp, mat32.data, sizeof(float)*3*2); diff --git a/extern/libmv/libmv-capi.h b/extern/libmv/libmv-capi.h index 536f8a5f14c..321593520b5 100644 --- a/extern/libmv/libmv-capi.h +++ b/extern/libmv/libmv-capi.h @@ -50,8 +50,8 @@ void libmv_regionTrackerDestroy(struct libmv_RegionTracker *libmv_tracker); /* SAD Tracker */ void libmv_SADSamplePattern(unsigned char *image, int stride, - float warp[3][2], unsigned char *pattern); -float libmv_SADTrackerTrack(unsigned char *pattern, unsigned char *warped, unsigned char *image, + float warp[3][2], unsigned char *pattern, int pattern_size); +float libmv_SADTrackerTrack(unsigned char *pattern, unsigned char *warped, int pattern_size, unsigned char *image, int stride, int width, int height, float warp[3][2]); /* Tracks */ diff --git a/extern/libmv/libmv/tracking/sad.cc b/extern/libmv/libmv/tracking/sad.cc index 9b446bb4c35..0876ef2fe73 100644 --- a/extern/libmv/libmv/tracking/sad.cc +++ b/extern/libmv/libmv/tracking/sad.cc @@ -25,6 +25,7 @@ #include "libmv/tracking/sad.h" #include #include +#include namespace libmv { @@ -78,15 +79,31 @@ void SamplePattern(ubyte* image, int stride, mat32 warp, ubyte* pattern, int siz #ifdef __SSE2__ #include -static uint SAD(const ubyte* pattern, const ubyte* image, int stride, int size) { + static uint SAD(/*const*/ ubyte* pattern, /*const*/ ubyte* image, int stride, int size) { + uint sad = 0; __m128i a = _mm_setzero_si128(); + for(int i = 0; i < size; i++) { - for(int j = 0; j < size/16; j++) { + int j = 0; + + for(j = 0; j < size/16; j++) { + if((i*size/16+j) % 32 == 0) { + sad += _mm_extract_epi16(a,0) + _mm_extract_epi16(a,4); + a = _mm_setzero_si128(); + } + a = _mm_adds_epu16(a, _mm_sad_epu8( _mm_loadu_si128((__m128i*)(pattern+i*size+j*16)), _mm_loadu_si128((__m128i*)(image+i*stride+j*16)))); } + + for(j = j*16; j < size; j++) { + sad += abs((int)pattern[i*size+j] - image[i*stride+j]); + } } - return _mm_extract_epi16(a,0) + _mm_extract_epi16(a,4); + + sad += _mm_extract_epi16(a,0) + _mm_extract_epi16(a,4); + + return sad; } #else static uint SAD(const ubyte* pattern, const ubyte* image, int stride, int size) { diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c index cb94e3f3ec1..2d906a9199b 100644 --- a/source/blender/blenkernel/intern/tracking.c +++ b/source/blender/blenkernel/intern/tracking.c @@ -718,7 +718,7 @@ typedef struct TrackContext { float *patch; /* keyframed patch */ /* ** SAD tracker ** */ - int patsize; /* size of pattern (currently only 16x16 due to libmv side) */ + int pattern_size; /* size of pattern */ unsigned char *pattern; /* keyframed pattern */ unsigned char *warped; /* warped version of reference */ #else @@ -786,12 +786,16 @@ MovieTrackingContext *BKE_tracking_context_new(MovieClip *clip, MovieClipUser *u #ifdef WITH_LIBMV { + float patx, paty; + patx= (int)((track->pat_max[0]-track->pat_min[0])*width); + paty= (int)((track->pat_max[1]-track->pat_min[1])*height); + if(track->tracker==TRACKER_KLT) { float search_size_x= (track->search_max[0]-track->search_min[0])*width; float search_size_y= (track->search_max[1]-track->search_min[1])*height; float pattern_size_x= (track->pat_max[0]-track->pat_min[0])*width; float pattern_size_y= (track->pat_max[1]-track->pat_min[1])*height; - int wndx, wndy; + int wndx= (int)patx/2, wndy= (int)paty/2; /* compute the maximum pyramid size */ float search_to_pattern_ratio= MIN2(search_size_x, search_size_y) @@ -804,13 +808,10 @@ MovieTrackingContext *BKE_tracking_context_new(MovieClip *clip, MovieClipUser *u * than the search size */ int level= MIN2(track->pyramid_levels, max_pyramid_levels); - wndx= (int)((track->pat_max[0]-track->pat_min[0])*width)/2; - wndy= (int)((track->pat_max[1]-track->pat_min[1])*height)/2; - track_context.region_tracker= libmv_regionTrackerNew(100, level, MAX2(wndx, wndy)); } else if(track->tracker==TRACKER_SAD) { - /* nothing to initialize */ + track_context.pattern_size= MAX2(patx, paty); } } #endif @@ -1093,10 +1094,10 @@ static void get_warped(TrackContext *track_context, int x, int y, int width, uns { int i, j; - for(i=0; ipatsize; i++) { - for(j=0; jpatsize; j++) { - track_context->warped[i*track_context->patsize+j]= - image[(y+i-track_context->patsize/2)*width+x+j-track_context->patsize/2]; + for(i=0; ipattern_size; i++) { + for(j=0; jpattern_size; j++) { + track_context->warped[i*track_context->pattern_size+j]= + image[(y+i-track_context->pattern_size/2)*width+x+j-track_context->pattern_size/2]; } } } @@ -1226,13 +1227,12 @@ int BKE_tracking_next(MovieTrackingContext *context) warp[2][0]= pos[0]; warp[2][1]= pos[1]; - /* pattern size is hardcoded to 16x16px in libmv */ - track_context->patsize= 16; - - if(!track_context->pattern) - track_context->pattern= MEM_callocN(sizeof(unsigned char)*track_context->patsize*track_context->patsize, "trackking pattern"); + if(!track_context->pattern) { + int square= track_context->pattern_size*track_context->pattern_size; + track_context->pattern= MEM_callocN(sizeof(unsigned char)*square, "trackking pattern"); + } - libmv_SADSamplePattern(image, width, warp, track_context->pattern); + libmv_SADSamplePattern(image, width, warp, track_context->pattern, track_context->pattern_size); MEM_freeN(image); IMB_freeImBuf(ibuf); @@ -1245,8 +1245,10 @@ int BKE_tracking_next(MovieTrackingContext *context) ibuf= get_frame_ibuf(context, curfra); - if(track_context->warped==NULL) - track_context->warped= MEM_callocN(sizeof(unsigned char)*track_context->patsize*track_context->patsize, "trackking warped"); + if(track_context->warped==NULL) { + int square= track_context->pattern_size*track_context->pattern_size; + track_context->warped= MEM_callocN(sizeof(unsigned char)*square, "trackking warped"); + } image_old= get_search_bytebuf(ibuf, track, marker, &width, &height, pos, origin); get_warped(track_context, pos[0], pos[1], width, image_old); @@ -1260,7 +1262,8 @@ int BKE_tracking_next(MovieTrackingContext *context) warp[2][0]= pos[0]; warp[2][1]= pos[1]; - correlation= libmv_SADTrackerTrack(track_context->pattern, track_context->warped, image_new, width, width, height, warp); + correlation= libmv_SADTrackerTrack(track_context->pattern, track_context->warped, + track_context->pattern_size, image_new, width, width, height, warp); x2= warp[2][0]; y2= warp[2][1]; -- cgit v1.2.3 From 00afa5900486dd95a43d1415014c43d3544be720 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 29 Nov 2011 01:05:26 +0000 Subject: fix for crash adding empty object --- source/blender/editors/object/object_add.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index bcd8b8903e7..f1bc63aa746 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -326,7 +326,9 @@ Object *ED_object_add_type(bContext *C, int type, float *loc, float *rot, int en DAG_id_type_tag(bmain, ID_OB); DAG_scene_sort(bmain, scene); - ED_render_id_flush_update(bmain, ob->data); + if (ob->data) { + ED_render_id_flush_update(bmain, ob->data); + } if(enter_editmode) ED_object_enter_editmode(C, EM_IGNORE_LAYER); @@ -1809,7 +1811,9 @@ Base *ED_object_add_duplicate(Main *bmain, Scene *scene, Base *base, int dupflag set_sca_new_poins_ob(ob); DAG_scene_sort(bmain, scene); - ED_render_id_flush_update(bmain, ob->data); + if (ob->data) { + ED_render_id_flush_update(bmain, ob->data); + } return basen; } -- cgit v1.2.3 From 9dd85d35f9e3f3e112c9be72499eb7298529163c Mon Sep 17 00:00:00 2001 From: Jason Hays Date: Tue, 29 Nov 2011 02:23:59 +0000 Subject: The locking + multi-paint section of code needed correction and simplification: The ratios were only being maintained between the altered weights when they were redistributed, and the resulting weights did not fully respect the locks--now they do. --- source/blender/editors/sculpt_paint/paint_vertex.c | 51 ++++++---------------- 1 file changed, 14 insertions(+), 37 deletions(-) diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 7144ae3e31a..b42ce28911b 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1273,12 +1273,12 @@ static float redistribute_change(MDeformVert *ndv, char *change_status, int chan /* left overs */ return totchange; } - +static float get_mp_change(MDeformVert *odv, char *defbase_sel, float brush_change); /* observe the changes made to the weights of groups. * make sure all locked groups on the vertex have the same deformation * by moving the changes made to groups onto other unlocked groups */ -static void enforce_locks(MDeformVert *odv, MDeformVert *ndv, int defbase_tot, - const char *lock_flags, const char *vgroup_validmap, char do_auto_normalize) +static void enforce_locks(MDeformVert *odv, MDeformVert *ndv, int defbase_tot, char *defbase_sel, + const char *lock_flags, const char *vgroup_validmap, char do_auto_normalize, char do_multipaint) { float totchange = 0.0f; float totchange_allowed = 0.0f; @@ -1291,11 +1291,11 @@ static void enforce_locks(MDeformVert *odv, MDeformVert *ndv, int defbase_tot, MDeformWeight *odw; MDeformWeight *ndw2; MDeformWeight *odw2; - int designatedw = -1; - int designatedw_changed = FALSE; + + float changed_sum = 0.0f; + float storedw; char *change_status; - char new_weight_has_zero = FALSE; if(!lock_flags || !has_locked_group(ndv, lock_flags)) { return; @@ -1322,14 +1322,9 @@ static void enforce_locks(MDeformVert *odv, MDeformVert *ndv, int defbase_tot, } else if(ndw->weight != odw->weight) { /* changed groups are handled here */ totchange += ndw->weight - odw->weight; + changed_sum += ndw->weight; change_status[i] = 2; /* was altered already */ total_changed++; - if(ndw->weight == 0) { - new_weight_has_zero = TRUE; - } - else if(designatedw == -1){ - designatedw = i; - } } /* unchanged, unlocked bone groups are handled here */ else if (vgroup_validmap[i]){ totchange_allowed += ndw->weight; @@ -1369,30 +1364,12 @@ static void enforce_locks(MDeformVert *odv, MDeformVert *ndv, int defbase_tot, totchange_allowed = redistribute_change(ndv, change_status, 1, -1, totchange_allowed, total_valid, do_auto_normalize); left_over += totchange_allowed; if(left_over) { - /* more than one nonzero weights were changed with the same ratio, so keep them changed that way! */ - if(total_changed > 1 && !new_weight_has_zero && designatedw >= 0) { - /* this dw is special, it is used as a base to determine how to change the others */ - ndw = defvert_find_index(ndv, designatedw); - odw = defvert_find_index(odv, designatedw); - storedw = ndw->weight; - for(i = 0; i < ndv->totweight; i++) { - if(ndv->dw[i].def_nr == designatedw) { - continue; - } - ndw2 = &ndv->dw[i]; - if(change_status[ndw2->def_nr] == 2) { - odw2 = &odv->dw[i]; - - if(!designatedw_changed) { - ndw->weight = (-left_over + odw->weight + odw2->weight)/(1.0f + ndw2->weight/ndw->weight); - designatedw_changed = TRUE; - } - ndw2->weight = ndw->weight * ndw2->weight / storedw; - } - } - } - /* a weight was changed to zero, only one weight was changed, - * or designatedw is still -1 put weight back as evenly as possible */ + /* more than one nonzero weights were changed with the same ratio with multipaint, so keep them changed that way! */ + if(total_changed > 1 && do_multipaint) { + float undo_change = get_mp_change(ndv, defbase_sel, left_over); + multipaint_selection(ndv, undo_change, defbase_sel, defbase_tot); + } + /* or designatedw is still -1 put weight back as evenly as possible */ else { redistribute_change(ndv, change_status, 2, -2, left_over, total_changed, do_auto_normalize); } @@ -1513,7 +1490,7 @@ static int apply_mp_locks_normalize(Mesh *me, const WeightPaintInfo *wpi, } clamp_weights(dv); - enforce_locks(&dv_test, dv, wpi->defbase_tot, wpi->lock_flags, wpi->vgroup_validmap, wpi->do_auto_normalize); + enforce_locks(&dv_test, dv, wpi->defbase_tot, wpi->defbase_sel, wpi->lock_flags, wpi->vgroup_validmap, wpi->do_auto_normalize, wpi->do_multipaint); do_weight_paint_auto_normalize_all_groups(dv, wpi->vgroup_validmap, wpi->do_auto_normalize); -- cgit v1.2.3 From 9125c53d4bbf80c171050d61b760475356a551f9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 29 Nov 2011 06:34:11 +0000 Subject: avoid allocating verts & faces for dupliface + editmode. --- source/blender/blenkernel/intern/anim.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 36df1101a24..f9b41c36791 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -1030,27 +1030,17 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa em = BKE_mesh_get_editmesh(me); if(em) { - int totvert; - dm= editmesh_get_derived_cage(scene, par, em, CD_MASK_BAREMESH); - - totface= dm->getNumFaces(dm); - mface= MEM_mallocN(sizeof(MFace)*totface, "mface temp"); - dm->copyFaceArray(dm, mface); - totvert= dm->getNumVerts(dm); - mvert= MEM_mallocN(sizeof(MVert)*totvert, "mvert temp"); - dm->copyVertArray(dm, mvert); - BKE_mesh_end_editmesh(me, em); } else { dm = mesh_get_derived_deform(scene, par, CD_MASK_BAREMESH); - - totface= dm->getNumFaces(dm); - mface= dm->getFaceArray(dm); - mvert= dm->getVertArray(dm); } + totface= dm->getNumFaces(dm); + mface= dm->getFaceArray(dm); + mvert= dm->getVertArray(dm); + if(G.rendering) { orco= (float(*)[3])get_mesh_orco_verts(par); @@ -1189,11 +1179,6 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa if (sce) base= base->next; /* scene loop */ else go= go->next; /* group loop */ } - - if(em) { - MEM_freeN(mface); - MEM_freeN(mvert); - } if(orco) MEM_freeN(orco); -- cgit v1.2.3 From 3f57c06c7b8f01e16109c8bdbaba9643fe380d3c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 29 Nov 2011 06:50:18 +0000 Subject: remove unused vars & minor formatting. --- source/blender/editors/sculpt_paint/paint_vertex.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index b42ce28911b..a5bd38d6696 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1150,7 +1150,7 @@ static char *gen_lock_flags(Object* ob, int defbase_tot) lock_flags[i] = ((defgroup->flag & DG_LOCK_WEIGHT) != 0); is_locked |= lock_flags[i]; } - if(is_locked){ + if (is_locked) { return lock_flags; } @@ -1289,12 +1289,9 @@ static void enforce_locks(MDeformVert *odv, MDeformVert *ndv, int defbase_tot, c unsigned int i; MDeformWeight *ndw; MDeformWeight *odw; - MDeformWeight *ndw2; - MDeformWeight *odw2; float changed_sum = 0.0f; - float storedw; char *change_status; if(!lock_flags || !has_locked_group(ndv, lock_flags)) { @@ -1308,7 +1305,7 @@ static void enforce_locks(MDeformVert *odv, MDeformVert *ndv, int defbase_tot, c odw = defvert_find_index(odv, i); /* the weights are zero, so we can assume a lot */ if(!ndw || !odw) { - if (!lock_flags[i] && vgroup_validmap[i]){ + if (!lock_flags[i] && vgroup_validmap[i]) { defvert_verify_index(odv, i); defvert_verify_index(ndv, i); total_valid++; @@ -1326,7 +1323,7 @@ static void enforce_locks(MDeformVert *odv, MDeformVert *ndv, int defbase_tot, c change_status[i] = 2; /* was altered already */ total_changed++; } /* unchanged, unlocked bone groups are handled here */ - else if (vgroup_validmap[i]){ + else if (vgroup_validmap[i]) { totchange_allowed += ndw->weight; total_valid++; change_status[i] = 1; /* can be altered while redistributing */ -- cgit v1.2.3