diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-01-17 16:54:56 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-01-17 16:54:56 +0300 |
commit | 932131be53cfe8c5068d9cc7b938544df63de0c3 (patch) | |
tree | b26e846f5b1c8402537a6ef2195ecb8d02e67937 /source/blender/makesrna | |
parent | 023765eb48f277168ea4e937f153b3333361d534 (diff) |
RNA: made naming of animateable flags for properties more clear.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/RNA_access.h | 4 | ||||
-rw-r--r-- | source/blender/makesrna/RNA_types.h | 15 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 14 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_define.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 6 |
5 files changed, 24 insertions, 17 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index e601dc68beb..c86544d397f 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -327,12 +327,12 @@ void RNA_property_enum_items(PointerRNA *ptr, PropertyRNA *prop, const EnumPrope int RNA_property_enum_value(PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *value); int RNA_property_enum_identifier(PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier); - const char *RNA_property_ui_name(PointerRNA *ptr, PropertyRNA *prop); const char *RNA_property_ui_description(PointerRNA *ptr, PropertyRNA *prop); int RNA_property_editable(PointerRNA *ptr, PropertyRNA *prop); -int RNA_property_evaluated(PointerRNA *ptr, PropertyRNA *prop); +int RNA_property_animateable(PointerRNA *ptr, PropertyRNA *prop); +int RNA_property_animated(PointerRNA *ptr, PropertyRNA *prop); void RNA_property_update(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop); diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 51f177b74cf..95e5e4112ed 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -72,18 +72,15 @@ typedef enum PropertySubType { typedef enum PropertyFlag { /* editable means the property is editable in the user - * interface, evaluated means that the property is set - * as part of an evaluation. these can change at runtime - * the property flag contains the default. editable is - * enabled by default except for collections. */ + * interface, properties are editable by default except + * for pointers and collections. */ PROP_NOT_EDITABLE = 1, - PROP_EVALUATED = 2, - /* driveable means the property can be driven by some + /* animateable means the property can be driven by some * other input, be it animation curves, expressions, .. - * in other words making the property evaluated. - * enable by default except for pointers and collections. */ - PROP_NOT_DRIVEABLE = 4, + * properties are animateable by default except for pointers + * and collections */ + PROP_NOT_ANIMATEABLE = 2, #if 0 /* for pointers and collections, means that the struct diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index aa8bd3ed766..979e4d3d7b4 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -511,18 +511,28 @@ int RNA_property_editable(PointerRNA *ptr, PropertyRNA *prop) return !(flag & PROP_NOT_EDITABLE); } -int RNA_property_evaluated(PointerRNA *ptr, PropertyRNA *prop) +int RNA_property_animateable(PointerRNA *ptr, PropertyRNA *prop) { int flag; rna_idproperty_check(&prop, ptr); + if(prop->flag & PROP_NOT_ANIMATEABLE) + return 0; + if(prop->editable) flag= prop->editable(ptr); else flag= prop->flag; - return (flag & PROP_EVALUATED); + return !(flag & PROP_NOT_EDITABLE); +} + +int RNA_property_animated(PointerRNA *ptr, PropertyRNA *prop) +{ + /* would need to ask animation system */ + + return 0; } void RNA_property_update(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop) diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 6af2453dde5..e2d88a79956 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -668,7 +668,7 @@ PropertyRNA *RNA_def_property(StructRNA *srna, const char *identifier, int type, prop->description= ""; if(type == PROP_COLLECTION || type == PROP_POINTER) - prop->flag= PROP_NOT_EDITABLE|PROP_NOT_DRIVEABLE; + prop->flag= PROP_NOT_EDITABLE|PROP_NOT_ANIMATEABLE; if(DefRNA.preprocess) { switch(type) { diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 8ac4b851892..ff2ba8ed0b5 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -169,21 +169,21 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode."); prop= RNA_def_property(srna, "current_frame", PROP_INT, PROP_NONE); - RNA_def_property_flag(prop, PROP_NOT_DRIVEABLE); + RNA_def_property_flag(prop, PROP_NOT_ANIMATEABLE); RNA_def_property_int_sdna(prop, NULL, "r.cfra"); RNA_def_property_range(prop, MINFRAME, MAXFRAME); RNA_def_property_ui_text(prop, "Current Frame", ""); RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_frame_update"); prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_NONE); - RNA_def_property_flag(prop, PROP_NOT_DRIVEABLE); + RNA_def_property_flag(prop, PROP_NOT_ANIMATEABLE); RNA_def_property_int_sdna(prop, NULL, "r.sfra"); RNA_def_property_int_funcs(prop, NULL, "rna_Scene_start_frame_set", NULL); RNA_def_property_ui_text(prop, "Start Frame", ""); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "end_frame", PROP_INT, PROP_NONE); - RNA_def_property_flag(prop, PROP_NOT_DRIVEABLE); + RNA_def_property_flag(prop, PROP_NOT_ANIMATEABLE); RNA_def_property_int_sdna(prop, NULL, "r.efra"); RNA_def_property_int_funcs(prop, NULL, "rna_Scene_end_frame_set", NULL); RNA_def_property_ui_text(prop, "End Frame", ""); |