diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-09-03 18:53:54 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-09-03 18:53:54 +0400 |
commit | 0cf0f5a62225f9f9cc2ed9715274e94dc09ad8b0 (patch) | |
tree | f89e9ebe84dc32179532ab8fc269c46b8b6e8b8a /source/blender/makesrna/intern/makesrna.c | |
parent | 52cefa4bc1104231cf6c6ef5b12124df135e2914 (diff) |
rna api
- move: material.add_texture(tex, coords, mapto) --> material.texture_slots.add()
- added material.texture_slots.create(index), material.texture_slots.clear(index)
- texture slot functions also work for lamp and world now.
Other minor changes
- allow rna functions to set FUNC_NO_SELF and FUNC_USE_SELF_ID at once.
- [#23317] Changed some operators' RNA to accept lengths, a modification I made to this patch made it not work as intended, removed this edit so unit buttons appier in the UI for certain operators.
- Sphinx doc gen, 2 columns rather then 3, didnt quite fit in some cases.
Diffstat (limited to 'source/blender/makesrna/intern/makesrna.c')
-rw-r--r-- | source/blender/makesrna/intern/makesrna.c | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 9ebf625946c..8a68c460573 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -1413,10 +1413,12 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA fprintf(f, "\n{\n"); /* variable definitions */ - if((func->flag & FUNC_NO_SELF)==0) { - if(func->flag & FUNC_USE_SELF_ID) - fprintf(f, "\tstruct ID *_selfid;\n"); + + if(func->flag & FUNC_USE_SELF_ID) { + fprintf(f, "\tstruct ID *_selfid;\n"); + } + 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); } @@ -1455,10 +1457,11 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA fprintf(f, "\t\n"); /* assign self */ + if(func->flag & FUNC_USE_SELF_ID) { + fprintf(f, "\t_selfid= (struct ID*)_ptr->id.data;\n"); + } + if((func->flag & FUNC_NO_SELF)==0) { - if(func->flag & FUNC_USE_SELF_ID) - fprintf(f, "\t_selfid= (struct ID*)_ptr->id.data;\n"); - 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); } @@ -1521,10 +1524,13 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA first= 1; - if((func->flag & FUNC_NO_SELF)==0) { - if(func->flag & FUNC_USE_SELF_ID) - fprintf(f, "_selfid, "); + if(func->flag & FUNC_USE_SELF_ID) { + fprintf(f, "_selfid"); + first= 0; + } + if((func->flag & FUNC_NO_SELF)==0) { + if(!first) fprintf(f, ", "); fprintf(f, "_self"); first= 0; } @@ -1826,10 +1832,13 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA first= 1; /* self, context and reports parameters */ + if(func->flag & FUNC_USE_SELF_ID) { + fprintf(f, "struct ID *_selfid"); + first= 0; + } + if((func->flag & FUNC_NO_SELF)==0) { - if(func->flag & FUNC_USE_SELF_ID) - fprintf(f, "struct ID *_selfid, "); - + if(!first) fprintf(f, ", "); if(dsrna->dnaname) fprintf(f, "struct %s *_self", dsrna->dnaname); else fprintf(f, "struct %s *_self", srna->identifier); first= 0; |