Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-06-04 10:39:04 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-06-04 10:39:04 +0300
commit95011f6d484b369db92ae13c674a6522d664ea8f (patch)
tree91ba2719c9f3096fad0f1f768aa7b1c4d79aa32a /source/blender/editors/object/object_vgroup.c
parent0911acb5cf49c5ba05b1df045b41697704aa288a (diff)
parent44505b38df557a5711703613685a1dec9fc2c3d9 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/object/object_vgroup.c')
-rw-r--r--source/blender/editors/object/object_vgroup.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index ff40aa07cd2..e39d889d9d9 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -772,7 +772,7 @@ static void ED_vgroup_nr_vert_add(
/* get the vert */
BKE_object_defgroup_array_get(ob->data, &dvert, &tot);
-
+
if (dvert == NULL)
return;
@@ -937,7 +937,7 @@ static float get_vert_def_nr(Object *ob, const int def_nr, const int vertnum)
dv = &lt->dvert[vertnum];
}
}
-
+
if (dv) {
MDeformWeight *dw = defvert_find_index(dv, def_nr);
if (dw) {
@@ -1024,12 +1024,12 @@ static void vgroup_select_verts(Object *ob, int select)
}
else if (ob->type == OB_LATTICE) {
Lattice *lt = vgroup_edit_lattice(ob);
-
+
if (lt->dvert) {
MDeformVert *dv;
BPoint *bp, *actbp = BKE_lattice_active_point_get(lt);
int a, tot;
-
+
dv = lt->dvert;
tot = lt->pntsu * lt->pntsv * lt->pntsw;
@@ -1057,7 +1057,7 @@ static void vgroup_duplicate(Object *ob)
dg = BLI_findlink(&ob->defbase, (ob->actdef - 1));
if (!dg)
return;
-
+
if (!strstr(dg->name, "_copy")) {
BLI_snprintf(name, sizeof(name), "%s_copy", dg->name);
}
@@ -1127,7 +1127,7 @@ static bool vgroup_normalize(Object *ob)
if (weight_max > 0.0f) {
for (i = 0; i < dvert_tot; i++) {
-
+
/* in case its not selected */
if (!(dv = dvert_array[i])) {
continue;
@@ -1136,7 +1136,7 @@ static bool vgroup_normalize(Object *ob)
dw = defvert_find_index(dv, def_nr);
if (dw) {
dw->weight /= weight_max;
-
+
/* in case of division errors with very low weights */
CLAMP(dw->weight, 0.0f, 1.0f);
}
@@ -1461,7 +1461,7 @@ static void moveCloserToDistanceFromPlane(
MEM_freeN(dwIndices);
}
-/* this is used to try to smooth a surface by only adjusting the nonzero weights of a vertex
+/* this is used to try to smooth a surface by only adjusting the nonzero weights of a vertex
* but it could be used to raise or lower an existing 'bump.' */
static void vgroup_fix(const bContext *C, Scene *scene, Object *ob, float distToBe, float strength, float cp)
{
@@ -1487,7 +1487,7 @@ static void vgroup_fix(const bContext *C, Scene *scene, Object *ob, float distTo
dm->getVert(dm, verts[k], &m);
p[k] = m;
}
-
+
if (count >= 3) {
float d /*, dist */ /* UNUSED */, mag;
float coord[3];
@@ -2642,7 +2642,7 @@ static int vertex_group_add_exec(bContext *C, wmOperator *UNUSED(op))
DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_GEOM | ND_VERTEX_GROUP, ob->data);
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
-
+
return OPERATOR_FINISHED;
}
@@ -2652,7 +2652,7 @@ void OBJECT_OT_vertex_group_add(wmOperatorType *ot)
ot->name = "Add Vertex Group";
ot->idname = "OBJECT_OT_vertex_group_add";
ot->description = "Add a new vertex group to the active object";
-
+
/* api callbacks */
ot->poll = vertex_group_supported_poll;
ot->exec = vertex_group_add_exec;
@@ -2675,7 +2675,7 @@ static int vertex_group_remove_exec(bContext *C, wmOperator *op)
DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_GEOM | ND_VERTEX_GROUP, ob->data);
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
-
+
return OPERATOR_FINISHED;
}
@@ -2685,7 +2685,7 @@ void OBJECT_OT_vertex_group_remove(wmOperatorType *ot)
ot->name = "Remove Vertex Group";
ot->idname = "OBJECT_OT_vertex_group_remove";
ot->description = "Delete the active or all vertex groups from the active object";
-
+
/* api callbacks */
ot->poll = vertex_group_poll;
ot->exec = vertex_group_remove_exec;
@@ -2705,11 +2705,11 @@ static int vertex_group_assign_exec(bContext *C, wmOperator *UNUSED(op))
{
ToolSettings *ts = CTX_data_tool_settings(C);
Object *ob = ED_object_context(C);
-
+
vgroup_assign_verts(ob, ts->vgroup_weight);
DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data);
-
+
return OPERATOR_FINISHED;
}
@@ -2719,7 +2719,7 @@ void OBJECT_OT_vertex_group_assign(wmOperatorType *ot)
ot->name = "Assign to Vertex Group";
ot->idname = "OBJECT_OT_vertex_group_assign";
ot->description = "Assign the selected vertices to the active vertex group";
-
+
/* api callbacks */
ot->poll = vertex_group_vert_select_unlocked_poll;
ot->exec = vertex_group_assign_exec;
@@ -2737,7 +2737,7 @@ static int vertex_group_assign_new_exec(bContext *C, wmOperator *op)
/* create new group... */
Object *ob = ED_object_context(C);
BKE_object_defgroup_add(ob);
-
+
/* assign selection to new group */
return vertex_group_assign_exec(C, op);
}
@@ -2748,11 +2748,11 @@ void OBJECT_OT_vertex_group_assign_new(wmOperatorType *ot)
ot->name = "Assign to New Group";
ot->idname = "OBJECT_OT_vertex_group_assign_new";
ot->description = "Assign the selected vertices to a new vertex group";
-
+
/* api callbacks */
ot->poll = vertex_group_vert_select_poll;
ot->exec = vertex_group_assign_new_exec;
-
+
/* flags */
/* redo operator will fail in this case because vertex group assignment
* isn't stored in local edit mode stack and toggling "new" property will
@@ -2894,7 +2894,7 @@ void OBJECT_OT_vertex_group_copy(wmOperatorType *ot)
static int vertex_group_levels_exec(bContext *C, wmOperator *op)
{
Object *ob = ED_object_context(C);
-
+
float offset = RNA_float_get(op->ptr, "offset");
float gain = RNA_float_get(op->ptr, "gain");
eVGroupSelect subset_type = RNA_enum_get(op->ptr, "group_select_mode");
@@ -2904,11 +2904,11 @@ static int vertex_group_levels_exec(bContext *C, wmOperator *op)
const bool *vgroup_validmap = BKE_object_defgroup_subset_from_select_type(ob, subset_type, &vgroup_tot, &subset_count);
vgroup_levels_subset(ob, vgroup_validmap, vgroup_tot, subset_count, offset, gain);
MEM_freeN((void *)vgroup_validmap);
-
+
DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data);
-
+
return OPERATOR_FINISHED;
}
@@ -2918,14 +2918,14 @@ void OBJECT_OT_vertex_group_levels(wmOperatorType *ot)
ot->name = "Vertex Group Levels";
ot->idname = "OBJECT_OT_vertex_group_levels";
ot->description = "Add some offset and multiply with some gain the weights of the active vertex group";
-
+
/* api callbacks */
ot->poll = vertex_group_poll;
ot->exec = vertex_group_levels_exec;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
+
vgroup_operator_subset_select_props(ot, true);
RNA_def_float(ot->srna, "offset", 0.f, -1.0, 1.0, "Offset", "Value to add to weights", -1.0f, 1.f);
RNA_def_float(ot->srna, "gain", 1.f, 0.f, FLT_MAX, "Gain", "Value to multiply weights by", 0.0f, 10.f);
@@ -3014,7 +3014,7 @@ static int vertex_group_fix_exec(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_active_object(C);
Scene *scene = CTX_data_scene(C);
-
+
float distToBe = RNA_float_get(op->ptr, "dist");
float strength = RNA_float_get(op->ptr, "strength");
float cp = RNA_float_get(op->ptr, "accuracy");
@@ -3026,17 +3026,17 @@ static int vertex_group_fix_exec(bContext *C, wmOperator *op)
}
md = md->next;
}
-
+
if (md && md->type == eModifierType_Mirror) {
BKE_report(op->reports, RPT_ERROR_INVALID_CONTEXT, "This operator does not support an active mirror modifier");
return OPERATOR_CANCELLED;
}
vgroup_fix(C, scene, ob, distToBe, strength, cp);
-
+
DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data);
-
+
return OPERATOR_FINISHED;
}
@@ -3047,11 +3047,11 @@ void OBJECT_OT_vertex_group_fix(wmOperatorType *ot)
ot->idname = "OBJECT_OT_vertex_group_fix";
ot->description = "Modify the position of selected vertices by changing only their respective "
"groups' weights (this tool may be slow for many vertices)";
-
+
/* api callbacks */
ot->poll = vertex_group_mesh_poll;
ot->exec = vertex_group_fix_exec;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_float(ot->srna, "dist", 0.0f, -FLT_MAX, FLT_MAX, "Distance", "The distance to move to", -10.0f, 10.0f);
@@ -3449,16 +3449,16 @@ static int set_active_group_exec(bContext *C, wmOperator *op)
}
static const EnumPropertyItem *vgroup_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
-{
+{
Object *ob = ED_object_context(C);
EnumPropertyItem tmp = {0, "", 0, "", ""};
EnumPropertyItem *item = NULL;
bDeformGroup *def;
int a, totitem = 0;
-
+
if (!ob)
return DummyRNA_NULL_items;
-
+
for (a = 0, def = ob->defbase.first; def; def = def->next, a++) {
tmp.value = a;
tmp.icon = ICON_GROUP_VERTEX;
@@ -3583,7 +3583,7 @@ static int vgroup_do_remap(Object *ob, const char *name_array, wmOperator *op)
BLI_assert(sort_map_update[ob->actdef] >= 0);
ob->actdef = sort_map_update[ob->actdef];
-
+
MEM_freeN(sort_map_update);
return OPERATOR_FINISHED;
@@ -3651,7 +3651,7 @@ static int vertex_group_sort_exec(bContext *C, wmOperator *op)
vgroup_sort_bone_hierarchy(ob, NULL);
break;
}
-
+
/*remap vgroup data to map to correct names*/
ret = vgroup_do_remap(ob, name_array, op);