diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-12-12 17:23:55 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-12-12 17:46:06 +0300 |
commit | 440d1042798113a0e8115ea1f1d016a44712e7a0 (patch) | |
tree | 147ca3dfc851aa635538a988005afa5ed89ac65a /source/blender/makesrna/intern/rna_action.c | |
parent | 62703850ad560b5832c4e42143f563d11ba21cf4 (diff) |
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
Diffstat (limited to 'source/blender/makesrna/intern/rna_action.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_action.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c index 3f2c0f3d434..0c4c7ddac81 100644 --- a/source/blender/makesrna/intern/rna_action.c +++ b/source/blender/makesrna/intern/rna_action.c @@ -586,7 +586,7 @@ static void rna_def_action_groups(BlenderRNA *brna, PropertyRNA *cprop) func = RNA_def_function(srna, "new", "rna_Action_groups_new"); RNA_def_function_ui_description(func, "Create a new action group and add it to the action"); parm = RNA_def_string(func, "name", "Group", 0, "", "New name for the action group"); - RNA_def_property_flag(parm, PROP_REQUIRED); + RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); parm = RNA_def_pointer(func, "action_group", "ActionGroup", "", "Newly created action group"); RNA_def_function_return(func, parm); @@ -596,8 +596,8 @@ static void rna_def_action_groups(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_ui_description(func, "Remove action group"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "action_group", "ActionGroup", "", "Action group to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); - RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); + RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); + RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); } static void rna_def_action_fcurves(BlenderRNA *brna, PropertyRNA *cprop) @@ -617,7 +617,7 @@ static void rna_def_action_fcurves(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_ui_description(func, "Add an F-Curve to the action"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_string(func, "data_path", NULL, 0, "Data Path", "F-Curve data path to use"); - RNA_def_property_flag(parm, PROP_REQUIRED); + RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Array index", 0, INT_MAX); RNA_def_string(func, "action_group", NULL, 0, "Action Group", "Acton group to add this F-Curve into"); @@ -630,9 +630,8 @@ static void rna_def_action_fcurves(BlenderRNA *brna, PropertyRNA *cprop) "of all F-Curves in the action."); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_string(func, "data_path", NULL, 0, "Data Path", "F-Curve data path"); - RNA_def_property_flag(parm, PROP_REQUIRED); + RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Array index", 0, INT_MAX); - parm = RNA_def_pointer(func, "fcurve", "FCurve", "", "The found F-Curve, or None if it doesn't exist"); RNA_def_function_return(func, parm); @@ -641,8 +640,8 @@ static void rna_def_action_fcurves(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_ui_description(func, "Remove action group"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "fcurve", "FCurve", "", "F-Curve to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); - RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); + RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); + RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); } static void rna_def_action_pose_markers(BlenderRNA *brna, PropertyRNA *cprop) @@ -661,8 +660,7 @@ static void rna_def_action_pose_markers(BlenderRNA *brna, PropertyRNA *cprop) func = RNA_def_function(srna, "new", "rna_Action_pose_markers_new"); RNA_def_function_ui_description(func, "Add a pose marker to the action"); parm = RNA_def_string(func, "name", "Marker", 0, NULL, "New name for the marker (not unique)"); - RNA_def_property_flag(parm, PROP_REQUIRED); - + RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created marker"); RNA_def_function_return(func, parm); @@ -670,8 +668,8 @@ static void rna_def_action_pose_markers(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_ui_description(func, "Remove a timeline marker"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); - RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); + RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); + RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "TimelineMarker"); |