[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18550] branches/blender2.5/blender/source /blender/makesrna: RNA: made naming of animateable flags for properties more clear.
Brecht Van Lommel
brecht at blender.org
Sat Jan 17 14:54:58 CET 2009
Revision: 18550
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18550
Author: blendix
Date: 2009-01-17 14:54:56 +0100 (Sat, 17 Jan 2009)
Log Message:
-----------
RNA: made naming of animateable flags for properties more clear.
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
branches/blender2.5/blender/source/blender/makesrna/RNA_types.h
branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_define.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c
Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/RNA_access.h 2009-01-17 05:36:58 UTC (rev 18549)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_access.h 2009-01-17 13:54:56 UTC (rev 18550)
@@ -327,12 +327,12 @@
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);
Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_types.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/RNA_types.h 2009-01-17 05:36:58 UTC (rev 18549)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_types.h 2009-01-17 13:54:56 UTC (rev 18550)
@@ -72,18 +72,15 @@
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
Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c 2009-01-17 05:36:58 UTC (rev 18549)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c 2009-01-17 13:54:56 UTC (rev 18550)
@@ -511,20 +511,30 @@
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)
{
rna_idproperty_check(&prop, ptr);
Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_define.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_define.c 2009-01-17 05:36:58 UTC (rev 18549)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_define.c 2009-01-17 13:54:56 UTC (rev 18550)
@@ -668,7 +668,7 @@
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) {
Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c 2009-01-17 05:36:58 UTC (rev 18549)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c 2009-01-17 13:54:56 UTC (rev 18550)
@@ -169,21 +169,21 @@
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", "");
More information about the Bf-blender-cvs
mailing list