diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_property.h | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/property.c | 16 |
2 files changed, 15 insertions, 4 deletions
diff --git a/source/blender/blenkernel/BKE_property.h b/source/blender/blenkernel/BKE_property.h index f1587790c4a..6af1deda727 100644 --- a/source/blender/blenkernel/BKE_property.h +++ b/source/blender/blenkernel/BKE_property.h @@ -41,7 +41,8 @@ struct bProperty *copy_property(struct bProperty *prop); void copy_properties(struct ListBase *lbn, struct ListBase *lbo); void init_property(struct bProperty *prop); struct bProperty *new_property(int type); -struct bProperty *get_property(struct Object *ob, char *name); +struct bProperty *get_ob_property(struct Object *ob, char *name); +void set_ob_property(struct Object *ob, struct bProperty *propc); int compare_property(struct bProperty *prop, char *str); void set_property(struct bProperty *prop, char *str); void add_property(struct bProperty *prop, char *str); diff --git a/source/blender/blenkernel/intern/property.c b/source/blender/blenkernel/intern/property.c index f55bdd15279..d2eb058a9a0 100644 --- a/source/blender/blenkernel/intern/property.c +++ b/source/blender/blenkernel/intern/property.c @@ -83,8 +83,7 @@ bProperty *copy_property(bProperty *prop) void copy_properties(ListBase *lbn, ListBase *lbo) { bProperty *prop, *propn; - - lbn->first= lbn->last= 0; + free_properties( lbn ); /* incase we are copying to an object with props */ prop= lbo->first; while(prop) { propn= copy_property(prop); @@ -139,7 +138,7 @@ bProperty *new_property(int type) return prop; } -bProperty *get_property(Object *ob, char *name) +bProperty *get_ob_property(Object *ob, char *name) { bProperty *prop; @@ -151,6 +150,17 @@ bProperty *get_property(Object *ob, char *name) return NULL; } +void set_ob_property(Object *ob, bProperty *propc) +{ + bProperty *prop; + prop= get_ob_property(ob, propc->name); + if(prop) { + free_property(prop); + BLI_remlink(&ob->prop, prop); + } + BLI_addtail(&ob->prop, copy_property(propc)); +} + /* negative: prop is smaller * positive: prop is larger */ |