4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * Contributor(s): Blender Foundation (2008).
22 * ***** END GPL LICENSE BLOCK *****
31 #include "MEM_guardedalloc.h"
33 #include "DNA_genfile.h"
34 #include "DNA_sdna_types.h"
36 #include "RNA_access.h"
37 #include "RNA_define.h"
38 #include "RNA_types.h"
40 #include "rna_internal.h"
42 /* Global used during defining */
46 /* Duplicated code since we can't link in blenkernel or blenlib */
48 #define MIN2(x,y) ((x)<(y)? (x): (y))
49 #define MAX2(x,y) ((x)>(y)? (x): (y))
51 void rna_addtail(ListBase *listbase, void *vlink)
56 link->prev = listbase->last;
58 if (listbase->last) ((Link *)listbase->last)->next = link;
59 if (listbase->first == 0) listbase->first = link;
60 listbase->last = link;
63 void rna_freelistN(ListBase *listbase)
67 for(link=listbase->first; link; link=next) {
72 listbase->first= listbase->last= NULL;
75 /* DNA utility function for looking up members */
77 typedef struct DNAStructMember {
83 static int rna_member_cmp(const char *name, const char *oname)
87 /* compare without pointer or array part */
94 if(name[a]=='[' && oname[a]==0) return 1;
96 if(name[a] != oname[a]) return 0;
99 if(name[a]==0 && oname[a] == '.') return 2;
100 if(name[a]==0 && oname[a] == '-' && oname[a+1] == '>') return 3;
102 return (name[a] == oname[a]);
105 static int rna_find_sdna_member(SDNA *sdna, const char *structname, const char *membername, DNAStructMember *smember)
109 int a, structnr, totmember, cmp;
111 structnr= DNA_struct_find_nr(sdna, structname);
115 sp= sdna->structs[structnr];
119 for(a=0; a<totmember; a++, sp+=2) {
120 dnaname= sdna->names[sp[1]];
122 cmp= rna_member_cmp(dnaname, membername);
125 smember->type= sdna->types[sp[0]];
126 smember->name= dnaname;
127 smember->arraylength= DNA_elem_array_size(smember->name, strlen(smember->name));
131 membername= strstr(membername, ".") + strlen(".");
132 return rna_find_sdna_member(sdna, sdna->types[sp[0]], membername, smember);
135 membername= strstr(membername, "->") + strlen("->");
136 return rna_find_sdna_member(sdna, sdna->types[sp[0]], membername, smember);
143 /* Blender Data Definition */
145 BlenderRNA *RNA_create()
149 brna= MEM_callocN(sizeof(BlenderRNA), "BlenderRNA");
151 DefRNA.sdna= DNA_sdna_from_data(DNAstr, DNAlen, 0);
152 DefRNA.structs.first= DefRNA.structs.last= NULL;
158 void RNA_define_free(BlenderRNA *brna)
163 for(alloc=DefRNA.allocs.first; alloc; alloc=alloc->next)
164 MEM_freeN(alloc->mem);
165 rna_freelistN(&DefRNA.allocs);
167 for(srna=DefRNA.structs.first; srna; srna=srna->next)
168 rna_freelistN(&srna->properties);
170 rna_freelistN(&DefRNA.structs);
173 DNA_sdna_free(DefRNA.sdna);
180 void RNA_free(BlenderRNA *brna)
184 RNA_define_free(brna);
186 for(srna=brna->structs.first; srna; srna=srna->next)
187 rna_freelistN(&srna->properties);
189 rna_freelistN(&brna->structs);
194 /* Struct Definition */
196 StructRNA *RNA_def_struct(BlenderRNA *brna, const char *cname, const char *name)
201 ds= MEM_callocN(sizeof(StructDefRNA), "StructDefRNA");
202 rna_addtail(&DefRNA.structs, ds);
204 srna= MEM_callocN(sizeof(StructRNA), "StructRNA");
210 rna_addtail(&brna->structs, srna);
212 RNA_def_struct_sdna(srna, srna->cname);
214 rna_def_builtin_properties(srna);
219 void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
221 StructDefRNA *ds= DefRNA.structs.last;
223 if(!DNA_struct_find_nr(DefRNA.sdna, structname)) {
225 fprintf(stderr, "RNA_def_struct_sdna: %s not found.\n", structname);
231 ds->dnaname= structname;
234 void RNA_def_struct_name_property(struct StructRNA *srna, struct PropertyRNA *prop)
236 if(prop->type != PROP_STRING) {
237 fprintf(stderr, "RNA_def_struct_name_property: %s.%s, must be a string property.\n", srna->cname, prop->cname);
241 srna->nameproperty= prop;
244 void RNA_def_struct_flag(StructRNA *srna, int flag)
249 /* Property Definition */
251 PropertyRNA *RNA_def_property(StructRNA *srna, const char *cname, int type, int subtype)
257 ds= DefRNA.structs.last;
258 dp= MEM_callocN(sizeof(PropertyDefRNA), "PropertyDefRNA");
259 rna_addtail(&ds->properties, dp);
263 prop= MEM_callocN(sizeof(BooleanPropertyRNA), "BooleanPropertyRNA");
266 IntPropertyRNA *iprop;
267 iprop= MEM_callocN(sizeof(IntPropertyRNA), "IntPropertyRNA");
268 prop= &iprop->property;
270 iprop->hardmin= (subtype == PROP_UNSIGNED)? 0: INT_MIN;
271 iprop->hardmax= INT_MAX;
273 iprop->softmin= (subtype == PROP_UNSIGNED)? 0: -10000; /* rather arbitrary .. */
274 iprop->softmax= 10000;
278 FloatPropertyRNA *fprop;
279 fprop= MEM_callocN(sizeof(FloatPropertyRNA), "FloatPropertyRNA");
280 prop= &fprop->property;
282 fprop->hardmin= (subtype == PROP_UNSIGNED)? 0.0f: -FLT_MAX;
283 fprop->hardmax= FLT_MAX;
285 fprop->softmin= (subtype == PROP_UNSIGNED)? 0.0f: -10000.0f; /* rather arbitrary .. */
286 fprop->softmax= 10000.0f;
290 StringPropertyRNA *sprop;
291 sprop= MEM_callocN(sizeof(StringPropertyRNA), "StringPropertyRNA");
292 prop= &sprop->property;
294 sprop->defaultvalue= "";
299 prop= MEM_callocN(sizeof(EnumPropertyRNA), "EnumPropertyRNA");
302 prop= MEM_callocN(sizeof(PointerPropertyRNA), "PointerPropertyRNA");
304 case PROP_COLLECTION:
305 prop= MEM_callocN(sizeof(CollectionPropertyRNA), "CollectionPropertyRNA");
308 fprintf(stderr, "RNA_def_property: %s.%s, invalid property type.\n", ds->srna->cname, cname);
318 prop->subtype= subtype;
320 prop->description= "";
322 if(type == PROP_COLLECTION)
323 prop->flag= PROP_NOT_EDITABLE|PROP_NOT_DRIVEABLE;
324 else if(type == PROP_POINTER)
325 prop->flag= PROP_NOT_DRIVEABLE;
330 RNA_def_property_boolean_sdna(prop, srna->cname, cname, 0);
335 RNA_def_property_int_sdna(prop, srna->cname, cname);
341 RNA_def_property_float_sdna(prop, srna->cname, cname);
347 RNA_def_property_string_sdna(prop, srna->cname, cname);
353 RNA_def_property_enum_sdna(prop, srna->cname, cname);
358 RNA_def_property_pointer_sdna(prop, srna->cname, cname);
361 case PROP_COLLECTION:
363 RNA_def_property_collection_sdna(prop, srna->cname, cname, NULL);
368 rna_addtail(&srna->properties, prop);
373 void RNA_def_property_flag(PropertyRNA *prop, int flag)
375 StructDefRNA *ds= DefRNA.structs.last;
380 if(prop->type != PROP_POINTER && prop->type != PROP_COLLECTION) {
381 if(flag & (PROP_EVALUATE_DEPENDENCY|PROP_INVERSE_EVALUATE_DEPENDENCY|PROP_RENDER_DEPENDENCY|PROP_INVERSE_RENDER_DEPENDENCY)) {
382 fprintf(stderr, "RNA_def_property_flag: %s.%s, only pointer and collection types can create dependencies.\n", ds->srna->cname, prop->cname);
389 void RNA_def_property_array(PropertyRNA *prop, int arraylength)
391 StructDefRNA *ds= DefRNA.structs.last;
397 prop->arraylength= arraylength;
400 fprintf(stderr, "RNA_def_property_array: %s.%s, only boolean/int/float can be array.\n", ds->srna->cname, prop->cname);
406 void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
409 prop->description= description;
412 void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, double precision)
414 StructDefRNA *ds= DefRNA.structs.last;
418 IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
419 iprop->softmin= (int)min;
420 iprop->softmax= (int)max;
421 iprop->step= (int)step;
425 FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
426 fprop->softmin= (float)min;
427 fprop->softmax= (float)max;
428 fprop->step= (float)step;
429 fprop->precision= (float)precision;
433 fprintf(stderr, "RNA_def_property_ui_range: %s.%s, invalid type for ui range.\n", ds->srna->cname, prop->cname);
439 void RNA_def_property_range(PropertyRNA *prop, double min, double max)
441 StructDefRNA *ds= DefRNA.structs.last;
445 IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
446 iprop->hardmin= (int)min;
447 iprop->hardmax= (int)max;
448 iprop->softmin= MAX2((int)min, iprop->hardmin);
449 iprop->softmax= MIN2((int)max, iprop->hardmax);
453 FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
454 fprop->hardmin= (float)min;
455 fprop->hardmax= (float)max;
456 fprop->softmin= MAX2((float)min, fprop->hardmin);
457 fprop->softmax= MIN2((float)max, fprop->hardmax);
461 fprintf(stderr, "RNA_def_property_range: %s.%s, invalid type for range.\n", ds->srna->cname, prop->cname);
467 void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
469 StructDefRNA *ds= DefRNA.structs.last;
473 PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
474 pprop->structtype = (StructRNA*)type;
477 case PROP_COLLECTION: {
478 CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
479 cprop->structtype = (StructRNA*)type;
483 fprintf(stderr, "RNA_def_property_struct_type: %s.%s, invalid type for struct type.\n", ds->srna->cname, prop->cname);
489 void RNA_def_property_enum_items(PropertyRNA *prop, const PropertyEnumItem *item)
491 StructDefRNA *ds= DefRNA.structs.last;
496 EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
499 for(i=0; item[i].cname; i++)
505 fprintf(stderr, "RNA_def_property_struct_type: %s.%s, invalid type for struct type.\n", ds->srna->cname, prop->cname);
511 void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength)
513 StructDefRNA *ds= DefRNA.structs.last;
517 StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
518 sprop->maxlength= maxlength;
522 fprintf(stderr, "RNA_def_property_string_maxlength: %s.%s, type is not string.\n", ds->srna->cname, prop->cname);
528 void RNA_def_property_boolean_default(PropertyRNA *prop, int value)
530 StructDefRNA *ds= DefRNA.structs.last;
534 BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop;
535 bprop->defaultvalue= value;
539 fprintf(stderr, "RNA_def_property_boolean_default: %s.%s, type is not boolean.\n", ds->srna->cname, prop->cname);
545 void RNA_def_property_boolean_array_default(PropertyRNA *prop, const int *array)
547 StructDefRNA *ds= DefRNA.structs.last;
551 BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop;
552 bprop->defaultarray= array;
556 fprintf(stderr, "RNA_def_property_boolean_default: %s.%s, type is not boolean.\n", ds->srna->cname, prop->cname);
562 void RNA_def_property_int_default(PropertyRNA *prop, int value)
564 StructDefRNA *ds= DefRNA.structs.last;
568 IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
569 iprop->defaultvalue= value;
573 fprintf(stderr, "RNA_def_property_int_default: %s.%s, type is not int.\n", ds->srna->cname, prop->cname);
579 void RNA_def_property_int_array_default(PropertyRNA *prop, const int *array)
581 StructDefRNA *ds= DefRNA.structs.last;
585 IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
586 iprop->defaultarray= array;
590 fprintf(stderr, "RNA_def_property_int_default: %s.%s, type is not int.\n", ds->srna->cname, prop->cname);
596 void RNA_def_property_float_default(PropertyRNA *prop, float value)
598 StructDefRNA *ds= DefRNA.structs.last;
602 FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
603 fprop->defaultvalue= value;
607 fprintf(stderr, "RNA_def_property_float_default: %s.%s, type is not float.\n", ds->srna->cname, prop->cname);
613 void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array)
615 StructDefRNA *ds= DefRNA.structs.last;
619 FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
620 fprop->defaultarray= array;
624 fprintf(stderr, "RNA_def_property_float_default: %s.%s, type is not float.\n", ds->srna->cname, prop->cname);
630 void RNA_def_property_string_default(PropertyRNA *prop, const char *value)
632 StructDefRNA *ds= DefRNA.structs.last;
636 StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
637 sprop->defaultvalue= value;
641 fprintf(stderr, "RNA_def_property_string_default: %s.%s, type is not string.\n", ds->srna->cname, prop->cname);
647 void RNA_def_property_enum_default(PropertyRNA *prop, int value)
649 StructDefRNA *ds= DefRNA.structs.last;
653 EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
654 eprop->defaultvalue= value;
658 fprintf(stderr, "RNA_def_property_enum_default: %s.%s, type is not enum.\n", ds->srna->cname, prop->cname);
666 static PropertyDefRNA *rna_def_property_sdna(PropertyRNA *prop, const char *structname, const char *propname)
668 DNAStructMember smember;
669 StructDefRNA *ds= DefRNA.structs.last;
670 PropertyDefRNA *dp= ds->properties.last;
673 structname= ds->dnaname;
675 propname= prop->cname;
677 if(!rna_find_sdna_member(DefRNA.sdna, structname, propname, &smember)) {
679 fprintf(stderr, "rna_def_property_sdna: %s.%s not found.\n", structname, propname);
685 if(smember.arraylength > 1)
686 prop->arraylength= smember.arraylength;
688 prop->arraylength= 0;
690 dp->dnastructname= structname;
691 dp->dnaname= propname;
692 dp->dnatype= smember.type;
693 dp->dnaarraylength= smember.arraylength;
698 void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int bit)
702 if((dp=rna_def_property_sdna(prop, structname, propname)))
706 void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
709 IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
711 if((dp= rna_def_property_sdna(prop, structname, propname))) {
712 /* SDNA doesn't pass us unsigned unfortunately .. */
713 if(strcmp(dp->dnatype, "char") == 0) {
714 iprop->hardmin= iprop->softmin= CHAR_MIN;
715 iprop->hardmax= iprop->softmax= CHAR_MAX;
717 else if(strcmp(dp->dnatype, "short") == 0) {
718 iprop->hardmin= iprop->softmin= SHRT_MIN;
719 iprop->hardmax= iprop->softmax= SHRT_MAX;
721 else if(strcmp(dp->dnatype, "int") == 0) {
722 iprop->hardmin= INT_MIN;
723 iprop->hardmax= INT_MAX;
725 iprop->softmin= -10000; /* rather arbitrary .. */
726 iprop->softmax= 10000;
729 if(prop->subtype == PROP_UNSIGNED)
730 iprop->hardmin= iprop->softmin= 0;
734 void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
736 rna_def_property_sdna(prop, structname, propname);
739 void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
743 if((dp=rna_def_property_sdna(prop, structname, propname))) {
744 if(prop->arraylength) {
745 prop->arraylength= 0;
747 fprintf(stderr, "RNA_def_property_enum_sdna: %s.%s, array not supported for enum type.\n", structname, propname);
754 void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
757 StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
759 if((dp=rna_def_property_sdna(prop, structname, propname))) {
760 if(prop->arraylength) {
761 sprop->maxlength= prop->arraylength;
762 prop->arraylength= 0;
767 void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
771 if((dp=rna_def_property_sdna(prop, structname, propname))) {
772 if(prop->arraylength) {
773 prop->arraylength= 0;
775 fprintf(stderr, "RNA_def_property_pointer_sdna: %s.%s, array not supported for pointer type.\n", structname, propname);
782 void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
785 CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
787 if((dp=rna_def_property_sdna(prop, structname, propname))) {
788 if(prop->arraylength) {
789 prop->arraylength= 0;
792 fprintf(stderr, "RNA_def_property_collection_sdna: %s.%s, array not supported for collection type.\n", structname, propname);
797 if(strcmp(dp->dnatype, "ListBase") == 0) {
798 cprop->next= (PropCollectionNextFunc)"rna_iterator_listbase_next";
799 cprop->get= (PropCollectionGetFunc)"rna_iterator_listbase_get";
803 if(dp && lengthpropname) {
804 DNAStructMember smember;
805 StructDefRNA *ds= DefRNA.structs.last;
808 structname= ds->dnaname;
810 if(!rna_find_sdna_member(DefRNA.sdna, structname, lengthpropname, &smember)) {
812 fprintf(stderr, "RNA_def_property_collection_sdna: %s.%s not found.\n", structname, lengthpropname);
817 dp->dnalengthstructname= structname;
818 dp->dnalengthname= lengthpropname;
820 cprop->next= (PropCollectionNextFunc)"rna_iterator_array_next";
821 cprop->get= (PropCollectionGetFunc)"rna_iterator_array_get";
822 cprop->end= (PropCollectionEndFunc)"rna_iterator_array_end";
829 void RNA_def_property_notify_func(PropertyRNA *prop, const char *notify)
831 if(notify) prop->notify= (PropNotifyFunc)notify;
834 void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
836 StructDefRNA *ds= DefRNA.structs.last;
840 BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop;
842 if(prop->arraylength) {
843 if(get) bprop->getarray= (PropBooleanArrayGetFunc)get;
844 if(set) bprop->setarray= (PropBooleanArraySetFunc)set;
847 if(get) bprop->get= (PropBooleanGetFunc)get;
848 if(set) bprop->set= (PropBooleanSetFunc)set;
853 fprintf(stderr, "RNA_def_property_boolean_funcs: %s.%s, type is not boolean.\n", ds->srna->cname, prop->cname);
859 void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set)
861 StructDefRNA *ds= DefRNA.structs.last;
865 IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
867 if(prop->arraylength) {
868 if(get) iprop->getarray= (PropIntArrayGetFunc)get;
869 if(set) iprop->setarray= (PropIntArraySetFunc)set;
872 if(get) iprop->get= (PropIntGetFunc)get;
873 if(set) iprop->set= (PropIntSetFunc)set;
878 fprintf(stderr, "RNA_def_property_int_funcs: %s.%s, type is not int.\n", ds->srna->cname, prop->cname);
884 void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set)
886 StructDefRNA *ds= DefRNA.structs.last;
890 FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
892 if(prop->arraylength) {
893 if(get) fprop->getarray= (PropFloatArrayGetFunc)get;
894 if(set) fprop->setarray= (PropFloatArraySetFunc)set;
897 if(get) fprop->get= (PropFloatGetFunc)get;
898 if(set) fprop->set= (PropFloatSetFunc)set;
903 fprintf(stderr, "RNA_def_property_float_funcs: %s.%s, type is not float.\n", ds->srna->cname, prop->cname);
909 void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set)
911 StructDefRNA *ds= DefRNA.structs.last;
915 EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
917 if(get) eprop->get= (PropEnumGetFunc)get;
918 if(set) eprop->set= (PropEnumSetFunc)set;
922 fprintf(stderr, "RNA_def_property_enum_funcs: %s.%s, type is not enum.\n", ds->srna->cname, prop->cname);
928 void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
930 StructDefRNA *ds= DefRNA.structs.last;
934 StringPropertyRNA *sprop= (StringPropertyRNA*)prop;
936 if(get) sprop->get= (PropStringGetFunc)get;
937 if(length) sprop->length= (PropStringLengthFunc)length;
938 if(set) sprop->set= (PropStringSetFunc)set;
942 fprintf(stderr, "RNA_def_property_string_funcs: %s.%s, type is not string.\n", ds->srna->cname, prop->cname);
948 void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *type, const char *set)
950 StructDefRNA *ds= DefRNA.structs.last;
954 PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
956 if(get) pprop->get= (PropPointerGetFunc)get;
957 if(type) pprop->type= (PropPointerTypeFunc)type;
958 if(set) pprop->set= (PropPointerSetFunc)set;
962 fprintf(stderr, "RNA_def_property_pointer_funcs: %s.%s, type is not pointer.\n", ds->srna->cname, prop->cname);
968 void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *type, const char *length, const char *lookupint, const char *lookupstring)
970 StructDefRNA *ds= DefRNA.structs.last;
973 case PROP_COLLECTION: {
974 CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
976 if(begin) cprop->begin= (PropCollectionBeginFunc)begin;
977 if(next) cprop->next= (PropCollectionNextFunc)next;
978 if(end) cprop->end= (PropCollectionEndFunc)end;
979 if(get) cprop->get= (PropCollectionGetFunc)get;
980 if(type) cprop->type= (PropCollectionTypeFunc)type;
981 if(length) cprop->length= (PropCollectionLengthFunc)length;
982 if(lookupint) cprop->lookupint= (PropCollectionLookupIntFunc)lookupint;
983 if(lookupstring) cprop->lookupstring= (PropCollectionLookupStringFunc)lookupstring;
987 fprintf(stderr, "RNA_def_property_collection_funcs: %s.%s, type is not collection.\n", ds->srna->cname, prop->cname);