Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_animation.c
| Show First 20 Lines • Show All 687 Lines • ▼ Show 20 Lines | static void rna_def_keyingset_info(BlenderRNA *brna) | ||||
| /* Function Callbacks ------------- */ | /* Function Callbacks ------------- */ | ||||
| /* poll */ | /* poll */ | ||||
| func = RNA_def_function(srna, "poll", NULL); | func = RNA_def_function(srna, "poll", NULL); | ||||
| RNA_def_function_ui_description(func, "Test if Keying Set can be used or not"); | RNA_def_function_ui_description(func, "Test if Keying Set can be used or not"); | ||||
| RNA_def_function_flag(func, FUNC_REGISTER); | RNA_def_function_flag(func, FUNC_REGISTER); | ||||
| RNA_def_function_return(func, RNA_def_boolean(func, "ok", 1, "", "")); | RNA_def_function_return(func, RNA_def_boolean(func, "ok", 1, "", "")); | ||||
| parm = RNA_def_pointer(func, "context", "Context", "", ""); | parm = RNA_def_pointer(func, "context", "Context", "", ""); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| /* iterator */ | /* iterator */ | ||||
| func = RNA_def_function(srna, "iterator", NULL); | func = RNA_def_function(srna, "iterator", NULL); | ||||
| RNA_def_function_ui_description(func, "Call generate() on the structs which have properties to be keyframed"); | RNA_def_function_ui_description(func, "Call generate() on the structs which have properties to be keyframed"); | ||||
| RNA_def_function_flag(func, FUNC_REGISTER); | RNA_def_function_flag(func, FUNC_REGISTER); | ||||
| parm = RNA_def_pointer(func, "context", "Context", "", ""); | parm = RNA_def_pointer(func, "context", "Context", "", ""); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| parm = RNA_def_pointer(func, "ks", "KeyingSet", "", ""); | parm = RNA_def_pointer(func, "ks", "KeyingSet", "", ""); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| /* generate */ | /* generate */ | ||||
| func = RNA_def_function(srna, "generate", NULL); | func = RNA_def_function(srna, "generate", NULL); | ||||
| RNA_def_function_ui_description(func, "Add Paths to the Keying Set to keyframe the properties of the given data"); | RNA_def_function_ui_description(func, "Add Paths to the Keying Set to keyframe the properties of the given data"); | ||||
| RNA_def_function_flag(func, FUNC_REGISTER); | RNA_def_function_flag(func, FUNC_REGISTER); | ||||
| parm = RNA_def_pointer(func, "context", "Context", "", ""); | parm = RNA_def_pointer(func, "context", "Context", "", ""); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| parm = RNA_def_pointer(func, "ks", "KeyingSet", "", ""); | parm = RNA_def_pointer(func, "ks", "KeyingSet", "", ""); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| parm = RNA_def_pointer(func, "data", "AnyType", "", ""); | parm = RNA_def_pointer(func, "data", "AnyType", "", ""); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED | PROP_RNAPTR | PROP_NEVER_NULL); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); | ||||
| } | } | ||||
| static void rna_def_keyingset_path(BlenderRNA *brna) | static void rna_def_keyingset_path(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| srna = RNA_def_struct(brna, "KeyingSetPath", NULL); | srna = RNA_def_struct(brna, "KeyingSetPath", NULL); | ||||
| ▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| func = RNA_def_function(srna, "add", "rna_KeyingSet_paths_add"); | func = RNA_def_function(srna, "add", "rna_KeyingSet_paths_add"); | ||||
| RNA_def_function_ui_description(func, "Add a new path for the Keying Set"); | RNA_def_function_ui_description(func, "Add a new path for the Keying Set"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| /* return arg */ | /* return arg */ | ||||
| parm = RNA_def_pointer(func, "ksp", "KeyingSetPath", "New Path", "Path created and added to the Keying Set"); | parm = RNA_def_pointer(func, "ksp", "KeyingSetPath", "New Path", "Path created and added to the Keying Set"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| /* ID-block for target */ | /* ID-block for target */ | ||||
| parm = RNA_def_pointer(func, "target_id", "ID", "Target ID", "ID data-block for the destination"); | parm = RNA_def_pointer(func, "target_id", "ID", "Target ID", "ID data-block for the destination"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| /* rna-path */ | /* rna-path */ | ||||
| /* XXX hopefully this is long enough */ | /* XXX hopefully this is long enough */ | ||||
| parm = RNA_def_string(func, "data_path", NULL, 256, "Data-Path", "RNA-Path to destination property"); | parm = RNA_def_string(func, "data_path", NULL, 256, "Data-Path", "RNA-Path to destination property"); | ||||
| RNA_def_property_flag(parm, PROP_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| /* index (defaults to -1 for entire array) */ | /* index (defaults to -1 for entire array) */ | ||||
| RNA_def_int(func, "index", -1, -1, INT_MAX, "Index", | RNA_def_int(func, "index", -1, -1, INT_MAX, "Index", | ||||
| "The index of the destination property (i.e. axis of Location/Rotation/etc.), " | "The index of the destination property (i.e. axis of Location/Rotation/etc.), " | ||||
| "or -1 for the entire array", 0, INT_MAX); | "or -1 for the entire array", 0, INT_MAX); | ||||
| /* grouping */ | /* grouping */ | ||||
| RNA_def_enum(func, "group_method", rna_enum_keyingset_path_grouping_items, KSP_GROUP_KSNAME, | RNA_def_enum(func, "group_method", rna_enum_keyingset_path_grouping_items, KSP_GROUP_KSNAME, | ||||
| "Grouping Method", "Method used to define which Group-name to use"); | "Grouping Method", "Method used to define which Group-name to use"); | ||||
| RNA_def_string(func, "group_name", NULL, 64, "Group Name", | RNA_def_string(func, "group_name", NULL, 64, "Group Name", | ||||
| "Name of Action Group to assign destination to (only if grouping mode is to use this name)"); | "Name of Action Group to assign destination to (only if grouping mode is to use this name)"); | ||||
| /* Remove Path */ | /* Remove Path */ | ||||
| func = RNA_def_function(srna, "remove", "rna_KeyingSet_paths_remove"); | func = RNA_def_function(srna, "remove", "rna_KeyingSet_paths_remove"); | ||||
| RNA_def_function_ui_description(func, "Remove the given path from the Keying Set"); | RNA_def_function_ui_description(func, "Remove the given path from the Keying Set"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| /* path to remove */ | /* path to remove */ | ||||
| parm = RNA_def_pointer(func, "path", "KeyingSetPath", "Path", ""); | parm = RNA_def_pointer(func, "path", "KeyingSetPath", "Path", ""); | ||||
| 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); | ||||
| /* Remove All Paths */ | /* Remove All Paths */ | ||||
| func = RNA_def_function(srna, "clear", "rna_KeyingSet_paths_clear"); | func = RNA_def_function(srna, "clear", "rna_KeyingSet_paths_clear"); | ||||
| RNA_def_function_ui_description(func, "Remove all the paths from the Keying Set"); | RNA_def_function_ui_description(func, "Remove all the paths from the Keying Set"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); | ||||
| ▲ Show 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | static void rna_api_animdata_nla_tracks(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| /* return type */ | /* return type */ | ||||
| parm = RNA_def_pointer(func, "track", "NlaTrack", "", "New NLA Track"); | parm = RNA_def_pointer(func, "track", "NlaTrack", "", "New NLA Track"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "remove", "rna_NlaTrack_remove"); | func = RNA_def_function(srna, "remove", "rna_NlaTrack_remove"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_CONTEXT); | RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_CONTEXT); | ||||
| RNA_def_function_ui_description(func, "Remove a NLA Track"); | RNA_def_function_ui_description(func, "Remove a NLA Track"); | ||||
| parm = RNA_def_pointer(func, "track", "NlaTrack", "", "NLA Track to remove"); | parm = RNA_def_pointer(func, "track", "NlaTrack", "", "NLA Track 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); | ||||
| prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_struct_type(prop, "NlaTrack"); | RNA_def_property_struct_type(prop, "NlaTrack"); | ||||
| RNA_def_property_pointer_funcs(prop, "rna_NlaTrack_active_get", "rna_NlaTrack_active_set", NULL, NULL); | RNA_def_property_pointer_funcs(prop, "rna_NlaTrack_active_get", "rna_NlaTrack_active_set", NULL, NULL); | ||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | RNA_def_property_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_ui_text(prop, "Active Constraint", "Active Object constraint"); | RNA_def_property_ui_text(prop, "Active Constraint", "Active Object constraint"); | ||||
| /* XXX: should (but doesn't) update the active track in the NLA window */ | /* XXX: should (but doesn't) update the active track in the NLA window */ | ||||
| RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_SELECTED, NULL); | RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_SELECTED, NULL); | ||||
| Show All 22 Lines | static void rna_api_animdata_drivers(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| /* AnimData.drivers.find(...) */ | /* AnimData.drivers.find(...) */ | ||||
| func = RNA_def_function(srna, "find", "rna_Driver_find"); | func = RNA_def_function(srna, "find", "rna_Driver_find"); | ||||
| RNA_def_function_ui_description(func, "Find a driver F-Curve. Note that this function performs a linear scan " | RNA_def_function_ui_description(func, "Find a driver F-Curve. Note that this function performs a linear scan " | ||||
| "of all driver F-Curves."); | "of all driver F-Curves."); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_REPORTS); | ||||
| parm = RNA_def_string(func, "data_path", NULL, 0, "Data Path", "F-Curve data path"); | 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); | RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Array index", 0, INT_MAX); | ||||
| /* return type */ | /* return type */ | ||||
| parm = RNA_def_pointer(func, "fcurve", "FCurve", "", "The found F-Curve, or None if it doesn't exist"); | parm = RNA_def_pointer(func, "fcurve", "FCurve", "", "The found F-Curve, or None if it doesn't exist"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| } | } | ||||
| void rna_def_animdata_common(StructRNA *srna) | void rna_def_animdata_common(StructRNA *srna) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 90 Lines • Show Last 20 Lines | |||||