[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19382] branches/blender2.5/blender/source /blender/makesrna: RNA:

Brecht Van Lommel brecht at blender.org
Mon Mar 23 14:24:50 CET 2009


Revision: 19382
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19382
Author:   blendix
Date:     2009-03-23 14:24:48 +0100 (Mon, 23 Mar 2009)

Log Message:
-----------
RNA:
* Allow pointers to be editable, did SpaceTextEditor.text as a test.
* Changed PROP_NOT_EDITABLE to PROP_EDITABLE, and added
  RNA_def_property_clear_flag.
* Removed rna_dependency.c test code.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/makesrna/RNA_define.h
    branches/blender2.5/blender/source/blender/makesrna/RNA_types.h
    branches/blender2.5/blender/source/blender/makesrna/intern/CMakeLists.txt
    branches/blender2.5/blender/source/blender/makesrna/intern/Makefile
    branches/blender2.5/blender/source/blender/makesrna/intern/SConscript
    branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_ID.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_action.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_actuator.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_animation.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_armature.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_brush.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_color.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_constraint.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_context.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_controller.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_curve.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_define.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_fluidsim.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_image.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal_types.h
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_key.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_lamp.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_lattice.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_main.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_mesh.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_meta.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_modifier.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_nodetree.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_object.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_packedfile.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_particle.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_pose.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_property.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_rna.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_sensor.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_sequence.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_space.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_text.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_vfont.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_wm.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_world.c

Removed Paths:
-------------
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_dependency.c

Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_define.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/RNA_define.h	2009-03-23 11:10:07 UTC (rev 19381)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_define.h	2009-03-23 13:24:48 UTC (rev 19382)
@@ -119,6 +119,7 @@
 void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname);
 
 void RNA_def_property_flag(PropertyRNA *prop, int flag);
+void RNA_def_property_clear_flag(PropertyRNA *prop, int flag);
 void RNA_def_property_array(PropertyRNA *prop, int arraylength);
 void RNA_def_property_range(PropertyRNA *prop, double min, double max);
 

Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_types.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/RNA_types.h	2009-03-23 11:10:07 UTC (rev 19381)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_types.h	2009-03-23 13:24:48 UTC (rev 19382)
@@ -79,29 +79,14 @@
 	/* editable means the property is editable in the user
 	 * interface, properties are editable by default except
 	 * for pointers and collections. */
-	PROP_NOT_EDITABLE = 1,
+	PROP_EDITABLE = 1,
 
 	/* animateable means the property can be driven by some
 	 * other input, be it animation curves, expressions, ..
 	 * properties are animateable by default except for pointers
 	 * and collections */
-	PROP_NOT_ANIMATEABLE = 2,
+	PROP_ANIMATEABLE = 2,
 
-#if 0
-	/* for pointers and collections, means that the struct
-	 * depends on the data pointed to for evaluation, such
-	 * that a change in the data pointed to will affect the
-	 * evaluated result of this struct. */
-	PROP_EVALUATE_DEPENDENCY = 8,
-	PROP_INVERSE_EVALUATE_DEPENDENCY = 16,
-
-	/* for pointers and collections, means that the struct
-	 * requires the data pointed to for rendering in the,
-	 * be it the render engine or viewport */
-	PROP_RENDER_DEPENDENCY = 32,
-	PROP_INVERSE_RENDER_DEPENDENCY = 64,
-#endif
-
 	/* internal flags */
 	PROP_BUILTIN = 128,
 	PROP_EXPORT = 256,

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/CMakeLists.txt
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/CMakeLists.txt	2009-03-23 11:10:07 UTC (rev 19381)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/CMakeLists.txt	2009-03-23 13:24:48 UTC (rev 19382)
@@ -98,7 +98,7 @@
 )
 
 # Build bf_rna
-SET(SRC rna_access.c rna_dependency.c ${GENSRC})
+SET(SRC rna_access.c ${GENSRC})
 BLENDERLIB(bf_rna "${SRC}" "${INC}")
 
 MESSAGE(STATUS "Configuring makesrna")

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/Makefile
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/Makefile	2009-03-23 11:10:07 UTC (rev 19381)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/Makefile	2009-03-23 13:24:48 UTC (rev 19382)
@@ -26,7 +26,7 @@
 DIR = $(OCGDIR)/blender/makesrna
 
 ALLRNA = $(wildcard rna_*.c)
-DEFRNA = $(filter-out %rna_define.c, $(filter-out %rna_dependency.c, $(filter-out %rna_access.c, $(ALLRNA))))
+DEFRNA = $(filter-out %rna_define.c, $(filter-out %rna_access.c, $(ALLRNA)))
 
 GENSRCS = $(patsubst rna_%.c, rna_%_gen.c, $(DEFRNA))
 GENTARGET = $(patsubst %.c, $(DIR)/$(DEBUG_DIR)%.c, $(GENSRCS))
@@ -34,7 +34,7 @@
 MAKESRCS = $(DEFRNA) makesrna.c rna_define.c
 MAKEOBJS = $(patsubst %.c, $(DIR)/$(DEBUG_DIR)%.o, $(MAKESRCS))
 
-CSRCS = $(GENSRCS) rna_access.c rna_dependency.c
+CSRCS = $(GENSRCS) rna_access.c
 
 include nan_compile.mk
 

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/SConscript
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/SConscript	2009-03-23 11:10:07 UTC (rev 19381)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/SConscript	2009-03-23 13:24:48 UTC (rev 19382)
@@ -12,7 +12,6 @@
 # making rna_access.c part of both makesrna and blender seems to
 # give conflict, how to solve?
 source_files.remove('rna_access.c')
-source_files.remove('rna_dependency.c')
 
 generated_files = source_files[:]
 generated_files.remove('rna_define.c')
@@ -87,7 +86,7 @@
         rna.Command (generated_files, '', root_build_dir+os.sep+"makesrna.exe "  + build_dir)
 
 
-obj = ['intern/rna_access.c', 'intern/rna_dependency.c']
+obj = ['intern/rna_access.c']
 for generated_file in generated_files:
 	obj += ['intern/' + generated_file]
 

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c	2009-03-23 11:10:07 UTC (rev 19381)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c	2009-03-23 13:24:48 UTC (rev 19382)
@@ -261,9 +261,9 @@
 				PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
 				rna_print_data_get(f, dp);
 				if(dp->dnapointerlevel == 0)
-					fprintf(f, "	return rna_pointer_inherit_refine(ptr, &RNA_%s, &data->%s);\n", (char*)pprop->structtype, dp->dnaname);
+					fprintf(f, "	return rna_pointer_inherit_refine(ptr, &RNA_%s, &data->%s);\n", (char*)pprop->type, dp->dnaname);
 				else
-					fprintf(f, "	return rna_pointer_inherit_refine(ptr, &RNA_%s, data->%s);\n", (char*)pprop->structtype, dp->dnaname);
+					fprintf(f, "	return rna_pointer_inherit_refine(ptr, &RNA_%s, data->%s);\n", (char*)pprop->type, dp->dnaname);
 			}
 			fprintf(f, "}\n\n");
 			break;
@@ -277,7 +277,7 @@
 				if(strcmp(manualfunc, "rna_iterator_listbase_get") == 0 ||
 				   strcmp(manualfunc, "rna_iterator_array_get") == 0 ||
 				   strcmp(manualfunc, "rna_iterator_array_dereference_get") == 0)
-					fprintf(f, "	return rna_pointer_inherit_refine(&iter->parent, &RNA_%s, %s(iter));\n", (cprop->structtype)? (char*)cprop->structtype: "UnknownType", manualfunc);
+					fprintf(f, "	return rna_pointer_inherit_refine(&iter->parent, &RNA_%s, %s(iter));\n", (cprop->type)? (char*)cprop->type: "UnknownType", manualfunc);
 				else
 					fprintf(f, "	return %s(iter);\n", manualfunc);
 			}
@@ -384,12 +384,14 @@
 	char *func;
 	int i;
 
-	if(prop->flag & (PROP_IDPROPERTY|PROP_NOT_EDITABLE))
+	if(!(prop->flag & PROP_EDITABLE))
 		return NULL;
+	if(prop->flag & PROP_IDPROPERTY)
+		return NULL;
 
 	if(!manualfunc) {
 		if(!dp->dnastructname || !dp->dnaname) {
-			if(!(prop->flag & PROP_NOT_EDITABLE)) {
+			if(prop->flag & PROP_EDITABLE) {
 				fprintf(stderr, "rna_def_property_set_func: %s.%s has no valid dna info.\n", srna->identifier, prop->identifier);
 				DefRNA.error= 1;
 			}
@@ -732,8 +734,8 @@
 
 			pprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (char*)pprop->get);
 			pprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (char*)pprop->set);
-			if(!pprop->structtype && !pprop->get) {
-				fprintf(stderr, "rna_def_property_funcs: %s.%s, pointer must have either type function or fixed type.\n", srna->identifier, prop->identifier);
+			if(!pprop->type) {
+				fprintf(stderr, "rna_def_property_funcs: %s.%s, pointer must have a struct type.\n", srna->identifier, prop->identifier);
 				DefRNA.error= 1;
 			}
 			break;
@@ -764,8 +766,8 @@
 					DefRNA.error= 1;
 				}
 			}
-			if(!cprop->structtype && !cprop->get) {
-				fprintf(stderr, "rna_def_property_funcs: %s.%s, collection must have either type function or fixed type.\n", srna->identifier, prop->identifier);
+			if(!cprop->type) {
+				fprintf(stderr, "rna_def_property_funcs: %s.%s, collection must have a struct type.\n", srna->identifier, prop->identifier);
 				DefRNA.error= 1;
 			}
 			break;
@@ -924,8 +926,8 @@
 		case PROP_POINTER: {
 			PointerPropertyRNA *pprop= (PointerPropertyRNA*)dp->prop;
 
-			if(pprop->structtype)
-				fprintf(f, "\t%s %s(void);", (char*)pprop->structtype, prop->identifier);
+			if(pprop->type)
+				fprintf(f, "\t%s %s(void);", (char*)pprop->type, prop->identifier);
 			else
 				fprintf(f, "\t%s %s(void);", "UnknownType", prop->identifier);
 			break;
@@ -933,8 +935,8 @@
 		case PROP_COLLECTION: {
 			CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)dp->prop;
 
-			if(cprop->structtype)
-				fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", (char*)cprop->structtype, srna->identifier, prop->identifier);
+			if(cprop->type)
+				fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", (char*)cprop->type, srna->identifier, prop->identifier);
 			else
 				fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", "UnknownType", srna->identifier, prop->identifier);
 			break;
@@ -989,8 +991,8 @@
 		case PROP_POINTER: {
 			PointerPropertyRNA *pprop= (PointerPropertyRNA*)dp->prop;
 
-			if(pprop->structtype)
-				fprintf(f, "\tPOINTER_PROPERTY(%s, %s, %s)", (char*)pprop->structtype, srna->identifier, prop->identifier);
+			if(pprop->type)
+				fprintf(f, "\tPOINTER_PROPERTY(%s, %s, %s)", (char*)pprop->type, srna->identifier, prop->identifier);
 			else
 				fprintf(f, "\tPOINTER_PROPERTY(%s, %s, %s)", "UnknownType", srna->identifier, prop->identifier);
 			break;
@@ -998,8 +1000,8 @@
 		case PROP_COLLECTION: {
 			/*CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)dp->prop;
 
-			if(cprop->structtype)
-				fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", (char*)cprop->structtype, srna->identifier, prop->identifier);
+			if(cprop->type)
+				fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", (char*)cprop->type, srna->identifier, prop->identifier);
 			else
 				fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", "UnknownType", srna->identifier, prop->identifier);*/
 			break;
@@ -1038,14 +1040,14 @@
 				if(dp->prop->type == PROP_POINTER) {
 					PointerPropertyRNA *pprop= (PointerPropertyRNA*)dp->prop;
 
-					if(!pprop->structtype && !pprop->get)
-						pprop->structtype= (StructRNA*)rna_find_type(dp->dnatype);
+					if(!pprop->type && !pprop->get)
+						pprop->type= (StructRNA*)rna_find_type(dp->dnatype);
 				}
 				else if(dp->prop->type== PROP_COLLECTION) {
 					CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)dp->prop;
 
-					if(!cprop->structtype && !cprop->get && strcmp(dp->dnatype, "ListBase")==0)
-						cprop->structtype= (StructRNA*)rna_find_type(dp->dnatype);

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list