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>2017-11-02 07:44:33 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-11-02 07:45:19 +0300
commit4a85089abe6d5abb9f6bb0d8255eba33dc030fcb (patch)
tree25459e54af9cf6712ca349b924319939ba853909 /source/blender/makesrna
parentcf6e45b5224d16263d7c87411a2ff71ed928410f (diff)
parent765e28948e706d8fce97c23d4d050a607971488b (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_armature.c27
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c10
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c63
3 files changed, 73 insertions, 27 deletions
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c
index 2ed147a75cf..f8a492c3cee 100644
--- a/source/blender/makesrna/intern/rna_armature.c
+++ b/source/blender/makesrna/intern/rna_armature.c
@@ -543,7 +543,22 @@ void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone)
RNA_def_property_range(prop, -5.0f, 5.0f);
RNA_def_property_ui_text(prop, "Out Y", "Y-axis handle offset for end of the B-Bone's curve, adjusts curvature");
RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone);
+
+ /* Ease In/Out */
+ prop = RNA_def_property(srna, "bbone_easein", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "ease1");
+ RNA_def_property_range(prop, -5.0f, 5.0f);
+ RNA_def_property_float_default(prop, 1.0f);
+ RNA_def_property_ui_text(prop, "B-Bone Ease In", "Length of first Bezier Handle (for B-Bones only)");
+ RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone);
+ prop = RNA_def_property(srna, "bbone_easeout", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "ease2");
+ RNA_def_property_range(prop, -5.0f, 5.0f);
+ RNA_def_property_float_default(prop, 1.0f);
+ RNA_def_property_ui_text(prop, "B-Bone Ease Out", "Length of second Bezier Handle (for B-Bones only)");
+ RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone);
+
/* Scale In/Out */
prop = RNA_def_property(srna, "bbone_scalein", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "scaleIn");
@@ -681,18 +696,6 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
RNA_def_property_ui_text(prop, "B-Bone Segments", "Number of subdivisions of bone (for B-Bones only)");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
- prop = RNA_def_property(srna, "bbone_in", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "ease1");
- RNA_def_property_range(prop, 0.0f, 2.0f);
- RNA_def_property_ui_text(prop, "B-Bone Ease In", "Length of first Bezier Handle (for B-Bones only)");
- RNA_def_property_update(prop, 0, "rna_Armature_update_data");
-
- prop = RNA_def_property(srna, "bbone_out", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "ease2");
- RNA_def_property_range(prop, 0.0f, 2.0f);
- RNA_def_property_ui_text(prop, "B-Bone Ease Out", "Length of second Bezier Handle (for B-Bones only)");
- RNA_def_property_update(prop, 0, "rna_Armature_update_data");
-
prop = RNA_def_property(srna, "bbone_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xwidth");
RNA_def_property_range(prop, 0.0f, 1000.0f);
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c
index 08aa681e17b..969424cd989 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -1897,6 +1897,11 @@ static void rna_def_fcurve(BlenderRNA *brna)
"Use custom hand-picked color for F-Curve"},
{0, NULL, 0, NULL, NULL}
};
+ static EnumPropertyItem prop_mode_smoothing_items[] = {
+ {FCURVE_SMOOTH_NONE, "NONE", 0, "None", "Auto handles only take adjacent keys into account (legacy mode)"},
+ {FCURVE_SMOOTH_CONT_ACCEL, "CONT_ACCEL", 0, "Continuous Acceleration", "Auto handles are placed to avoid jumps in acceleration"},
+ {0, NULL, 0, NULL, NULL}
+ };
srna = RNA_def_struct(brna, "FCurve", NULL);
RNA_def_struct_ui_text(srna, "F-Curve", "F-Curve defining values of a period of time");
@@ -1970,6 +1975,11 @@ static void rna_def_fcurve(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Hide", "F-Curve and its keyframes are hidden in the Graph Editor graphs");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
+ prop = RNA_def_property(srna, "auto_smoothing", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, prop_mode_smoothing_items);
+ RNA_def_property_ui_text(prop, "Auto Handle Smoothing", "Algorithm used to compute automatic handles");
+ RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FCurve_update_data");
+
/* State Info (for Debugging) */
prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FCURVE_DISABLED);
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index 267ac16e1be..2bed0eb7429 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -175,11 +175,11 @@ static void rna_uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, const c
uiItemPointerR(layout, ptr, propname, searchptr, searchpropname, name, icon);
}
-static PointerRNA rna_uiItemO(uiLayout *layout, const char *opname, const char *name, const char *text_ctxt,
- int translate, int icon, int emboss, int icon_value)
+static PointerRNA rna_uiItemO(
+ uiLayout *layout, const char *opname, const char *name, const char *text_ctxt,
+ int translate, int icon, int emboss, int depress, int icon_value)
{
wmOperatorType *ot;
- int flag;
ot = WM_operatortype_find(opname, 0); /* print error next */
if (!ot || !ot->srna) {
@@ -193,15 +193,39 @@ static PointerRNA rna_uiItemO(uiLayout *layout, const char *opname, const char *
if (icon_value && !icon) {
icon = icon_value;
}
-
- flag = 0;
- flag |= (emboss) ? 0 : UI_ITEM_R_NO_BG;
+ int flag = (emboss) ? 0 : UI_ITEM_R_NO_BG;
+ flag |= (depress) ? UI_ITEM_O_DEPRESS : 0;
PointerRNA opptr;
uiItemFullO_ptr(layout, ot, name, icon, NULL, uiLayoutGetOperatorContext(layout), flag, &opptr);
return opptr;
}
+static PointerRNA rna_uiItemOMenuHold(
+ uiLayout *layout, const char *opname, const char *name, const char *text_ctxt,
+ int translate, int icon, int emboss, int depress, int icon_value,
+ const char *menu)
+{
+ wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */
+ if (!ot || !ot->srna) {
+ RNA_warning("%s '%s'", ot ? "unknown operator" : "operator missing srna", opname);
+ return PointerRNA_NULL;
+ }
+
+ /* Get translated name (label). */
+ name = rna_translate_ui_text(name, text_ctxt, ot->srna, NULL, translate);
+ if (icon_value && !icon) {
+ icon = icon_value;
+ }
+ int flag = (emboss) ? 0 : UI_ITEM_R_NO_BG;
+ flag |= (depress) ? UI_ITEM_O_DEPRESS : 0;
+
+ PointerRNA opptr;
+ uiItemFullOMenuHold_ptr(layout, ot, name, icon, NULL, uiLayoutGetOperatorContext(layout), flag, menu, &opptr);
+ return opptr;
+}
+
+
static void rna_uiItemMenuEnumO(uiLayout *layout, bContext *C, const char *opname, const char *propname, const char *name,
const char *text_ctxt, int translate, int icon)
{
@@ -553,15 +577,24 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
api_ui_item_common(func);
- func = RNA_def_function(srna, "operator", "rna_uiItemO");
- api_ui_item_op_common(func);
- RNA_def_boolean(func, "emboss", true, "", "Draw the button itself, just the icon/text");
- parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_ui_text(parm, "Icon Value", "Override automatic icon of the item");
- parm = RNA_def_pointer(func, "properties", "OperatorProperties", "", "Operator properties to fill in");
- RNA_def_parameter_flags(parm, 0, PARM_REQUIRED | PARM_RNAPTR);
- RNA_def_function_return(func, parm);
- RNA_def_function_ui_description(func, "Item. Places a button into the layout to call an Operator");
+ for (int is_menu_hold = 0; is_menu_hold < 2; is_menu_hold++) {
+ func = (is_menu_hold) ?
+ RNA_def_function(srna, "operator_menu_hold", "rna_uiItemOMenuHold") :
+ RNA_def_function(srna, "operator", "rna_uiItemO");
+ api_ui_item_op_common(func);
+ RNA_def_boolean(func, "emboss", true, "", "Draw the button itself, just the icon/text");
+ RNA_def_boolean(func, "depress", false, "", "Draw pressed in");
+ parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_ui_text(parm, "Icon Value", "Override automatic icon of the item");
+ if (is_menu_hold) {
+ parm = RNA_def_string(func, "menu", NULL, 0, "", "Identifier of the menu");
+ RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
+ }
+ parm = RNA_def_pointer(func, "properties", "OperatorProperties", "", "Operator properties to fill in");
+ RNA_def_parameter_flags(parm, 0, PARM_REQUIRED | PARM_RNAPTR);
+ RNA_def_function_return(func, parm);
+ RNA_def_function_ui_description(func, "Item. Places a button into the layout to call an Operator");
+ }
func = RNA_def_function(srna, "operator_enum", "uiItemsEnumO");
parm = RNA_def_string(func, "operator", NULL, 0, "", "Identifier of the operator");