Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
| Context not available. | |||||
| MEM_freeN(vert_cache); | MEM_freeN(vert_cache); | ||||
| } | } | ||||
| ViewContext vc; | |||||
| int i = 0, vgroup_tot = 0, def_nr_lock = 0; | |||||
ankitm: Remove "fix". Comment to concisely describe what the code below does is fine. | |||||
Done Inline Actionsvc is only used to access scene use: Scene *scene = CTX_data_scene(C); instead. campbellbarton: `vc` is only used to access `scene` use: `Scene *scene = CTX_data_scene(C);` instead. | |||||
| bool is_normalize = false ; | |||||
| MDeformVert *dvert, *dv ; | |||||
| ED_view3d_viewcontext_init(C, &vc, depsgraph); | |||||
Done Inline ActionsThis should be initialized from BKE_object_defgroup_validmap_get. campbellbarton: This should be initialized from `BKE_object_defgroup_validmap_get`. | |||||
Not Done Inline ActionsMy mistake, that functions checks bones, this should be BKE_object_defgroup_lock_flags_get - to respect the groups lock icon. campbellbarton: My mistake, that functions checks bones, this should be `BKE_object_defgroup_lock_flags_get`… | |||||
| vgroup_tot = BLI_listbase_count(&ob->defbase); | |||||
Done Inline ActionsDon't declare uninitialized variables. ankitm: Don't declare uninitialized variables. | |||||
| is_normalize = vc.scene->toolsettings->auto_normalize; | |||||
| dvert = me->dvert; | |||||
| def_nr_lock = ob->actdef - 1; | |||||
Done Inline ActionsThis needs to be freed. campbellbarton: This needs to be freed. | |||||
Done Inline Actionsconst bool is_normalize ankitm: `const bool is_normalize` | |||||
| if (is_normalize) { | |||||
| for (i = 0; i < me->totvert; i++) { | |||||
| dv = (dvert + i); | |||||
| MDeformWeight *dw = dv->dw; | |||||
| BKE_devert_normalize_gradient_paint(dv, dw, vgroup_tot, def_nr_lock); | |||||
| } | |||||
| } | |||||
Done Inline ActionsThis is unnecessary data.vert_visit is already created and freed above (line 840 without this patch applied). campbellbarton: This is unnecessary `data.vert_visit` is already created and freed above (line 840 without this… | |||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| Context not available. | |||||
Remove "fix". Comment to concisely describe what the code below does is fine.