Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_fcurve.c
| Show First 20 Lines • Show All 1,023 Lines • ▼ Show 20 Lines | static void rna_def_fmodifier_envelope_control_points(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| RNA_def_struct_ui_text(srna, "Control Points", "Control points defining the shape of the envelope"); | RNA_def_struct_ui_text(srna, "Control Points", "Control points defining the shape of the envelope"); | ||||
| func = RNA_def_function(srna, "add", "rna_FModifierEnvelope_points_add"); | func = RNA_def_function(srna, "add", "rna_FModifierEnvelope_points_add"); | ||||
| RNA_def_function_ui_description(func, "Add a control point to a FModifierEnvelope"); | RNA_def_function_ui_description(func, "Add a control point to a FModifierEnvelope"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| parm = RNA_def_float(func, "frame", 0.0f, -FLT_MAX, FLT_MAX, "", | parm = RNA_def_float(func, "frame", 0.0f, -FLT_MAX, FLT_MAX, "", | ||||
| "Frame to add this control-point", -FLT_MAX, FLT_MAX); | "Frame to add this control-point", -FLT_MAX, FLT_MAX); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| parm = RNA_def_pointer(func, "point", "FModifierEnvelopeControlPoint", "", "Newly created control-point"); | parm = RNA_def_pointer(func, "point", "FModifierEnvelopeControlPoint", "", "Newly created control-point"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "remove", "rna_FModifierEnvelope_points_remove"); | func = RNA_def_function(srna, "remove", "rna_FModifierEnvelope_points_remove"); | ||||
| RNA_def_function_ui_description(func, "Remove a control-point from an FModifierEnvelope"); | RNA_def_function_ui_description(func, "Remove a control-point from an FModifierEnvelope"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| parm = RNA_def_pointer(func, "point", "FModifierEnvelopeControlPoint", "", "Control-point to remove"); | parm = RNA_def_pointer(func, "point", "FModifierEnvelopeControlPoint", "", "Control-point to remove"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); | ||||
| } | } | ||||
| static void rna_def_fmodifier_envelope(BlenderRNA *brna) | static void rna_def_fmodifier_envelope(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| ▲ Show 20 Lines • Show All 500 Lines • ▼ Show 20 Lines | /* PropertyRNA *prop; */ | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| /* remove variable */ | /* remove variable */ | ||||
| func = RNA_def_function(srna, "remove", "rna_Driver_remove_variable"); | func = RNA_def_function(srna, "remove", "rna_Driver_remove_variable"); | ||||
| RNA_def_function_ui_description(func, "Remove an existing variable from the driver"); | RNA_def_function_ui_description(func, "Remove an existing variable from the driver"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| /* target to remove */ | /* target to remove */ | ||||
| parm = RNA_def_pointer(func, "variable", "DriverVariable", "", "Variable to remove from the driver"); | parm = RNA_def_pointer(func, "variable", "DriverVariable", "", "Variable to remove from the driver"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); | ||||
| RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); | ||||
| } | } | ||||
| static void rna_def_channeldriver(BlenderRNA *brna) | static void rna_def_channeldriver(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| static EnumPropertyItem prop_type_items[] = { | static EnumPropertyItem prop_type_items[] = { | ||||
| ▲ Show 20 Lines • Show All 202 Lines • ▼ Show 20 Lines | static void rna_def_fcurve_modifiers(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| /* Constraint collection */ | /* Constraint collection */ | ||||
| func = RNA_def_function(srna, "new", "rna_FCurve_modifiers_new"); | func = RNA_def_function(srna, "new", "rna_FCurve_modifiers_new"); | ||||
| RNA_def_function_ui_description(func, "Add a constraint to this object"); | RNA_def_function_ui_description(func, "Add a constraint to this object"); | ||||
| /* return type */ | /* return type */ | ||||
| parm = RNA_def_pointer(func, "fmodifier", "FModifier", "", "New fmodifier"); | parm = RNA_def_pointer(func, "fmodifier", "FModifier", "", "New fmodifier"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| /* object to add */ | /* object to add */ | ||||
| parm = RNA_def_enum(func, "type", rna_enum_fmodifier_type_items, 1, "", "Constraint type to add"); | parm = RNA_def_enum(func, "type", rna_enum_fmodifier_type_items, 1, "", "Constraint type to add"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| func = RNA_def_function(srna, "remove", "rna_FCurve_modifiers_remove"); | func = RNA_def_function(srna, "remove", "rna_FCurve_modifiers_remove"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| RNA_def_function_ui_description(func, "Remove a modifier from this F-Curve"); | RNA_def_function_ui_description(func, "Remove a modifier from this F-Curve"); | ||||
| /* modifier to remove */ | /* modifier to remove */ | ||||
| parm = RNA_def_pointer(func, "modifier", "FModifier", "", "Removed modifier"); | parm = RNA_def_pointer(func, "modifier", "FModifier", "", "Removed modifier"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); | ||||
| RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); | ||||
| } | } | ||||
| /* fcurve.keyframe_points */ | /* fcurve.keyframe_points */ | ||||
| static void rna_def_fcurve_keyframe_points(BlenderRNA *brna, PropertyRNA *cprop) | static void rna_def_fcurve_keyframe_points(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| Show All 10 Lines | static void rna_def_fcurve_keyframe_points(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| srna = RNA_def_struct(brna, "FCurveKeyframePoints", NULL); | srna = RNA_def_struct(brna, "FCurveKeyframePoints", NULL); | ||||
| RNA_def_struct_sdna(srna, "FCurve"); | RNA_def_struct_sdna(srna, "FCurve"); | ||||
| RNA_def_struct_ui_text(srna, "Keyframe Points", "Collection of keyframe points"); | RNA_def_struct_ui_text(srna, "Keyframe Points", "Collection of keyframe points"); | ||||
| func = RNA_def_function(srna, "insert", "rna_FKeyframe_points_insert"); | func = RNA_def_function(srna, "insert", "rna_FKeyframe_points_insert"); | ||||
| RNA_def_function_ui_description(func, "Add a keyframe point to a F-Curve"); | RNA_def_function_ui_description(func, "Add a keyframe point to a F-Curve"); | ||||
| parm = RNA_def_float(func, "frame", 0.0f, -FLT_MAX, FLT_MAX, "", | parm = RNA_def_float(func, "frame", 0.0f, -FLT_MAX, FLT_MAX, "", | ||||
| "X Value of this keyframe point", -FLT_MAX, FLT_MAX); | "X Value of this keyframe point", -FLT_MAX, FLT_MAX); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| parm = RNA_def_float(func, "value", 0.0f, -FLT_MAX, FLT_MAX, "", | parm = RNA_def_float(func, "value", 0.0f, -FLT_MAX, FLT_MAX, "", | ||||
| "Y Value of this keyframe point", -FLT_MAX, FLT_MAX); | "Y Value of this keyframe point", -FLT_MAX, FLT_MAX); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| RNA_def_enum_flag(func, "options", keyframe_flag_items, 0, "", "Keyframe options"); | RNA_def_enum_flag(func, "options", keyframe_flag_items, 0, "", "Keyframe options"); | ||||
| RNA_def_enum(func, "keyframe_type", rna_enum_beztriple_keyframe_type_items, BEZT_KEYTYPE_KEYFRAME, "", | RNA_def_enum(func, "keyframe_type", rna_enum_beztriple_keyframe_type_items, BEZT_KEYTYPE_KEYFRAME, "", | ||||
| "Type of keyframe to insert"); | "Type of keyframe to insert"); | ||||
| parm = RNA_def_pointer(func, "keyframe", "Keyframe", "", "Newly created keyframe"); | parm = RNA_def_pointer(func, "keyframe", "Keyframe", "", "Newly created keyframe"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "add", "rna_FKeyframe_points_add"); | func = RNA_def_function(srna, "add", "rna_FKeyframe_points_add"); | ||||
| RNA_def_function_ui_description(func, "Add a keyframe point to a F-Curve"); | RNA_def_function_ui_description(func, "Add a keyframe point to a F-Curve"); | ||||
| RNA_def_int(func, "count", 1, 0, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX); | RNA_def_int(func, "count", 1, 0, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX); | ||||
| func = RNA_def_function(srna, "remove", "rna_FKeyframe_points_remove"); | func = RNA_def_function(srna, "remove", "rna_FKeyframe_points_remove"); | ||||
| RNA_def_function_ui_description(func, "Remove keyframe from an F-Curve"); | RNA_def_function_ui_description(func, "Remove keyframe from an F-Curve"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| parm = RNA_def_pointer(func, "keyframe", "Keyframe", "", "Keyframe to remove"); | parm = RNA_def_pointer(func, "keyframe", "Keyframe", "", "Keyframe to remove"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); | ||||
| RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); | RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); | ||||
| /* optional */ | /* optional */ | ||||
| RNA_def_boolean(func, "fast", 0, "Fast", "Fast keyframe removal to avoid recalculating the curve each time"); | RNA_def_boolean(func, "fast", 0, "Fast", "Fast keyframe removal to avoid recalculating the curve each time"); | ||||
| } | } | ||||
| static void rna_def_fcurve(BlenderRNA *brna) | static void rna_def_fcurve(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| ▲ Show 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | static void rna_def_fcurve(BlenderRNA *brna) | ||||
| rna_def_fcurve_modifiers(brna, prop); | rna_def_fcurve_modifiers(brna, prop); | ||||
| /* Functions */ | /* Functions */ | ||||
| /* -- evaluate -- */ | /* -- evaluate -- */ | ||||
| func = RNA_def_function(srna, "evaluate", "evaluate_fcurve"); /* calls the C/API direct */ | func = RNA_def_function(srna, "evaluate", "evaluate_fcurve"); /* calls the C/API direct */ | ||||
| RNA_def_function_ui_description(func, "Evaluate F-Curve"); | RNA_def_function_ui_description(func, "Evaluate F-Curve"); | ||||
| parm = RNA_def_float(func, "frame", 1.0f, -FLT_MAX, FLT_MAX, "Frame", | parm = RNA_def_float(func, "frame", 1.0f, -FLT_MAX, FLT_MAX, "Frame", | ||||
| "Evaluate F-Curve at given frame", -FLT_MAX, FLT_MAX); | "Evaluate F-Curve at given frame", -FLT_MAX, FLT_MAX); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| /* return value */ | /* return value */ | ||||
| parm = RNA_def_float(func, "value", 0, -FLT_MAX, FLT_MAX, "Value", "Value of F-Curve specific frame", -FLT_MAX, FLT_MAX); | parm = RNA_def_float(func, "value", 0, -FLT_MAX, FLT_MAX, "Value", "Value of F-Curve specific frame", -FLT_MAX, FLT_MAX); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| /* -- update / recalculate -- */ | /* -- update / recalculate -- */ | ||||
| func = RNA_def_function(srna, "update", "rna_FCurve_update_data_ex"); | func = RNA_def_function(srna, "update", "rna_FCurve_update_data_ex"); | ||||
| RNA_def_function_ui_description(func, "Ensure keyframes are sorted in chronological order and handles are set correctly"); | RNA_def_function_ui_description(func, "Ensure keyframes are sorted in chronological order and handles are set correctly"); | ||||
| /* -- time extents/range -- */ | /* -- time extents/range -- */ | ||||
| func = RNA_def_function(srna, "range", "rna_FCurve_range"); | func = RNA_def_function(srna, "range", "rna_FCurve_range"); | ||||
| RNA_def_function_ui_description(func, "Get the time extents for F-Curve"); | RNA_def_function_ui_description(func, "Get the time extents for F-Curve"); | ||||
| /* return value */ | /* return value */ | ||||
| parm = RNA_def_float_vector(func, "range", 2, NULL, -FLT_MAX, FLT_MAX, "Range", | parm = RNA_def_float_vector(func, "range", 2, NULL, -FLT_MAX, FLT_MAX, "Range", | ||||
| "Min/Max values", -FLT_MAX, FLT_MAX); | "Min/Max values", -FLT_MAX, FLT_MAX); | ||||
| RNA_def_property_flag(parm, PROP_THICK_WRAP); | RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0); | ||||
| RNA_def_function_output(func, parm); | RNA_def_function_output(func, parm); | ||||
| /* -- auto-flag validity (ensures valid handling for data type) -- */ | /* -- auto-flag validity (ensures valid handling for data type) -- */ | ||||
| func = RNA_def_function(srna, "update_autoflags", "update_autoflags_fcurve"); /* calls the C/API direct */ | func = RNA_def_function(srna, "update_autoflags", "update_autoflags_fcurve"); /* calls the C/API direct */ | ||||
| RNA_def_function_ui_description(func, "Update FCurve flags set automatically from affected property " | RNA_def_function_ui_description(func, "Update FCurve flags set automatically from affected property " | ||||
| "(currently, integer/discrete flags set when the property is not a float)"); | "(currently, integer/discrete flags set when the property is not a float)"); | ||||
| RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS); | ||||
| parm = RNA_def_pointer(func, "data", "AnyType", "Data", | parm = RNA_def_pointer(func, "data", "AnyType", "Data", | ||||
| "Data containing the property controlled by given FCurve"); | "Data containing the property controlled by given FCurve"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED | PROP_RNAPTR | PROP_NEVER_NULL); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); | ||||
| /* Functions */ | /* Functions */ | ||||
| RNA_api_fcurves(srna); | RNA_api_fcurves(srna); | ||||
| } | } | ||||
| /* *********************** */ | /* *********************** */ | ||||
| Show All 27 Lines | |||||