diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-06-27 05:10:39 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-06-27 05:10:39 +0400 |
commit | d839a9ae9ccbf17375e28cc92aa75a0cb4cf6b11 (patch) | |
tree | 3ee663e436f751f799dcd3542788f10be4cb121d /source/blender/makesrna/intern/rna_armature.c | |
parent | 524b8614373df3e1eb212939f048a79b75450c28 (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/rna_armature.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_armature.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index 0f437f8f1a8..caa970eff57 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -443,6 +443,30 @@ void rna_EditBone_tail_selected_set(PointerRNA *ptr, int value) else data->flag &= ~BONE_TIPSEL; } +static void rna_Armature_bones_next(CollectionPropertyIterator *iter) +{ + ListBaseIterator *internal= iter->internal; + Bone *bone= (Bone*)internal->link; + + if(bone->childbase.first) + internal->link= (Link*)bone->childbase.first; + else if(bone->next) + internal->link= (Link*)bone->next; + else { + internal->link= NULL; + + do { + bone= bone->parent; + if(bone && bone->next) { + internal->link= (Link*)bone->next; + break; + } + } while(bone); + } + + iter->valid= (internal->link != NULL); +} + #else static void rna_def_bone_common(StructRNA *srna, int editbone) @@ -660,6 +684,7 @@ void rna_def_armature(BlenderRNA *brna) /* Collections */ prop= RNA_def_property(srna, "bones", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "bonebase", NULL); + RNA_def_property_collection_funcs(prop, 0, "rna_Armature_bones_next", 0, 0, 0, 0, 0, 0, 0); RNA_def_property_struct_type(prop, "Bone"); RNA_def_property_ui_text(prop, "Bones", ""); |