[Bf-blender-cvs] [41d1af9a115] blender2.8: UI: check prop-separate before adding black decorator
Campbell Barton
noreply at git.blender.org
Thu Aug 30 12:45:55 CEST 2018
Commit: 41d1af9a1151331171f25c3c799254b70a28d371
Author: Campbell Barton
Date: Thu Aug 30 20:41:40 2018 +1000
Branches: blender2.8
https://developer.blender.org/rB41d1af9a1151331171f25c3c799254b70a28d371
UI: check prop-separate before adding black decorator
This caused the blank icon to be added to menus (ndof menu for eg).
===================================================================
M source/blender/editors/gpencil/gpencil_armature.c
M source/blender/editors/interface/interface_layout.c
===================================================================
diff --git a/source/blender/editors/gpencil/gpencil_armature.c b/source/blender/editors/gpencil/gpencil_armature.c
index 88118f8fe31..b55239deadc 100644
--- a/source/blender/editors/gpencil/gpencil_armature.c
+++ b/source/blender/editors/gpencil/gpencil_armature.c
@@ -262,8 +262,7 @@ static float get_weight(float dist, float decay_rad, float dif_rad)
/* This functions implements the automatic computation of vertex group weights */
static void gpencil_add_verts_to_dgroups(
- const bContext *C,
- Object *ob, Object *ob_arm, const float ratio, const float decay)
+ const bContext *C, Object *ob, Object *ob_arm, const float ratio, const float decay)
{
bArmature *arm = ob_arm->data;
Bone **bonelist, *bone;
@@ -518,10 +517,7 @@ bool ED_gpencil_add_armature_weights(
}
/* add weights */
- gpencil_object_vgroup_calc_from_armature(
- C,
- ob, ob_arm, mode,
- DEFAULT_RATIO, DEFAULT_DECAY);
+ gpencil_object_vgroup_calc_from_armature(C, ob, ob_arm, mode, DEFAULT_RATIO, DEFAULT_DECAY);
return true;
}
@@ -594,9 +590,7 @@ static int gpencil_generate_weights_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- gpencil_object_vgroup_calc_from_armature(
- C,
- ob, ob_arm, mode, ratio, decay);
+ gpencil_object_vgroup_calc_from_armature(C, ob, ob_arm, mode, ratio, decay);
/* notifiers */
DEG_id_tag_update(&gpd->id, OB_RECALC_OB | OB_RECALC_DATA);
@@ -644,9 +638,9 @@ static const EnumPropertyItem *gpencil_armatures_enum_itemf(
void GPENCIL_OT_generate_weights(wmOperatorType *ot)
{
static const EnumPropertyItem mode_type[] = {
- {GP_ARMATURE_NAME, "NAME", 0, "Empty Groups", ""},
- {GP_ARMATURE_AUTO, "AUTO", 0, "Automatic Weights", ""},
- {0, NULL, 0, NULL, NULL}
+ {GP_ARMATURE_NAME, "NAME", 0, "Empty Groups", ""},
+ {GP_ARMATURE_AUTO, "AUTO", 0, "Automatic Weights", ""},
+ {0, NULL, 0, NULL, NULL}
};
PropertyRNA *prop;
@@ -667,9 +661,11 @@ void GPENCIL_OT_generate_weights(wmOperatorType *ot)
prop = RNA_def_enum(ot->srna, "armature", DummyRNA_DEFAULT_items, 0, "Armature", "Armature to use");
RNA_def_enum_funcs(prop, gpencil_armatures_enum_itemf);
- RNA_def_float(ot->srna, "ratio", DEFAULT_RATIO, 0.0f, 2.0f, "Ratio",
- "Ratio between bone length and influence radius", 0.001f, 1.0f);
+ RNA_def_float(
+ ot->srna, "ratio", DEFAULT_RATIO, 0.0f, 2.0f, "Ratio",
+ "Ratio between bone length and influence radius", 0.001f, 1.0f);
- RNA_def_float(ot->srna, "decay", DEFAULT_DECAY, 0.0f, 1.0f, "Decay",
- "Factor to reduce influence depending of distance to bone axis", 0.0f, 1.0f);
+ RNA_def_float(
+ ot->srna, "decay", DEFAULT_DECAY, 0.0f, 1.0f, "Decay",
+ "Factor to reduce influence depending of distance to bone axis", 0.0f, 1.0f);
}
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index cb83f6e4f48..dea0e03fea2 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -813,10 +813,12 @@ static uiBut *ui_item_with_label(
#ifdef UI_PROP_DECORATE
/* Only for alignment. */
- if ((layout->item.flag & UI_ITEM_PROP_DECORATE) &&
- (layout->item.flag & UI_ITEM_PROP_DECORATE_NO_PAD) == 0)
- {
- uiItemL(sub, NULL, ICON_BLANK1);
+ if (layout->item.flag & UI_ITEM_PROP_SEP) {
+ if ((layout->item.flag & UI_ITEM_PROP_DECORATE) &&
+ (layout->item.flag & UI_ITEM_PROP_DECORATE_NO_PAD) == 0)
+ {
+ uiItemL(sub, NULL, ICON_BLANK1);
+ }
}
#endif /* UI_PROP_DECORATE */
More information about the Bf-blender-cvs
mailing list