Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-06-27 05:10:39 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-06-27 05:10:39 +0400
commitd839a9ae9ccbf17375e28cc92aa75a0cb4cf6b11 (patch)
tree3ee663e436f751f799dcd3542788f10be4cb121d /source/blender/makesrna/intern/makesrna.c
parent524b8614373df3e1eb212939f048a79b75450c28 (diff)
RNA
* Added support for passing collections to/from RNA functions, this is done using a ListBase of CollectionPointerLink, which is a standard ListBase link + PointerRNA. * Added editable active uv/vcol layer to Mesh. * Armature.bones now includes all bones, not only the ones without parents. * Modifier UV layer fields now are allowed to be empty, previously this would set the name during modifier evaluation if there was none.
Diffstat (limited to 'source/blender/makesrna/intern/makesrna.c')
-rw-r--r--source/blender/makesrna/intern/makesrna.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index e7ca3fc5932..475db3955b6 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -248,8 +248,7 @@ static const char *rna_parameter_type_name(PropertyRNA *parm)
return rna_find_dna_type((const char *)pparm->type);
}
case PROP_COLLECTION: {
- CollectionPropertyRNA *cparm= (CollectionPropertyRNA*)parm;
- return rna_find_dna_type((const char *)cparm->type);
+ return "ListBase";
}
default:
return "<error, no type specified>";
@@ -1116,9 +1115,11 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA
funcname= rna_alloc_function_name(srna->identifier, func->identifier, "call");
+ /* function definition */
fprintf(f, "void %s(bContext *C, ReportList *reports, PointerRNA *_ptr, ParameterList *_parms)", funcname);
fprintf(f, "\n{\n");
+ /* variable definitions */
if((func->flag & FUNC_NO_SELF)==0) {
if(dsrna->dnaname) fprintf(f, "\tstruct %s *_self;\n", dsrna->dnaname);
else fprintf(f, "\tstruct %s *_self;\n", srna->identifier);
@@ -1135,6 +1136,7 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA
fprintf(f, ";\n");
fprintf(f, "\t\n");
+ /* assign self */
if((func->flag & FUNC_NO_SELF)==0) {
if(dsrna->dnaname) fprintf(f, "\t_self= (struct %s *)_ptr->data;\n", dsrna->dnaname);
else fprintf(f, "\t_self= (struct %s *)_ptr->data;\n", srna->identifier);
@@ -1405,6 +1407,7 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA
dsrna= rna_find_struct_def(srna);
func= dfunc->func;
+ /* return type */
for(dparm= dfunc->cont.properties.first; dparm; dparm= dparm->next) {
if(dparm->prop==func->ret) {
if(dparm->prop->arraylength)
@@ -1418,13 +1421,16 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA
}
}
+ /* void if nothing to return */
if(!dparm)
fprintf(f, "void ");
+ /* function name */
fprintf(f, "%s(", dfunc->call);
first= 1;
+ /* self, context and reports parameters */
if((func->flag & FUNC_NO_SELF)==0) {
if(dsrna->dnaname) fprintf(f, "struct %s *_self", dsrna->dnaname);
else fprintf(f, "struct %s *_self", srna->identifier);
@@ -1443,6 +1449,7 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA
fprintf(f, "ReportList *reports");
}
+ /* defined parameters */
for(dparm= dfunc->cont.properties.first; dparm; dparm= dparm->next) {
if(dparm->prop==func->ret)
continue;