diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-10 03:51:34 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-10 03:51:34 +0300 |
commit | 5f69c0ec09d1f9f19e46c880f9d59016b11c547b (patch) | |
tree | bff409e46c2260d7a7de8e8a2492b106efb17984 /source | |
parent | 4c122988320d866b16a06ea4404d278bc8d13715 (diff) |
string lookup for scene.object_bases, also removed some unused DNA vars.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesdna/DNA_action_types.h | 6 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_image_types.h | 5 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_lattice_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 17 |
4 files changed, 24 insertions, 6 deletions
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index 6f6e4978cfc..c2e20448bcf 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -193,9 +193,9 @@ typedef struct bPoseChannel { short agrp_index; /* index of action-group this bone belongs to (0 = default/no group) */ // XXX depreceated.... old animation system (armature only viz) ---- - int pathlen; /* for drawing paths, the amount of frames */ - int pathsf; /* for drawing paths, the start frame number */ - int pathef; /* for drawing paths, the end frame number */ +// int pathlen; /* for drawing paths, the amount of frames */ +// int pathsf; /* for drawing paths, the start frame number */ +// int pathef; /* for drawing paths, the end frame number */ // XXX end of depreceated code ------------------------------------- struct Bone *bone; /* set on read file or rebuild pose */ diff --git a/source/blender/makesdna/DNA_image_types.h b/source/blender/makesdna/DNA_image_types.h index d1aa3c00ac4..b58bd259983 100644 --- a/source/blender/makesdna/DNA_image_types.h +++ b/source/blender/makesdna/DNA_image_types.h @@ -51,8 +51,9 @@ typedef struct ImageUser { short flag, ok; short multi_index, layer, pass; /* listbase indices, for menu browsing or retrieve buffer */ - short menunr; /* localized menu entry, for handling browse event */ - + /* short menunr; */ /* localized menu entry, for handling browse event */ + short pad; + struct Scene *scene; /* to retrieve render result */ } ImageUser; diff --git a/source/blender/makesdna/DNA_lattice_types.h b/source/blender/makesdna/DNA_lattice_types.h index 94fc9fefb66..3d05acfbe0d 100644 --- a/source/blender/makesdna/DNA_lattice_types.h +++ b/source/blender/makesdna/DNA_lattice_types.h @@ -49,7 +49,7 @@ typedef struct Lattice { short pntsu, pntsv, pntsw, flag; short opntsu, opntsv, opntsw, pad2; - char typeu, typev, typew, type; + char typeu, typev, typew, pad3; int pad; float fu, fv, fw, du, dv, dw; diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index bc778ff3256..c4a79c178a9 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -150,6 +150,8 @@ EnumPropertyItem image_type_items[] = { #include "DNA_object_types.h" #include "DNA_mesh_types.h" +#include "RNA_access.h" + #include "MEM_guardedalloc.h" #include "BKE_context.h" @@ -180,6 +182,20 @@ EnumPropertyItem image_type_items[] = { #include "RE_pipeline.h" +static PointerRNA rna_Scene_object_bases_lookup_string(PointerRNA *ptr, const char *key) +{ + Scene *scene= (Scene*)ptr->data; + Base *base; + + for(base= scene->base.first; base; base= base->next) { + if(strncmp(base->object->id.name+2, key, sizeof(base->object->id.name)-2)==0) { + return rna_pointer_inherit_refine(ptr, &RNA_ObjectBase, base); + } + } + + return PointerRNA_NULL; +} + static PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter) { ListBaseIterator *internal= iter->internal; @@ -3107,6 +3123,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "base", NULL); RNA_def_property_struct_type(prop, "ObjectBase"); RNA_def_property_ui_text(prop, "Bases", ""); + RNA_def_property_collection_funcs(prop, 0, 0, 0, 0, 0, 0, "rna_Scene_object_bases_lookup_string"); rna_def_scene_bases(brna, prop); prop= RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE); |