diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-01-05 10:34:14 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-01-05 10:34:14 +0400 |
commit | 890c97ca40024ae32edbc3c5af6db0ee257a942d (patch) | |
tree | 634b385fd292652bbc480631b98dfc69a4339c4a /source/blender/editors | |
parent | cda279b5250091a89ab5edb1717ca3cf54c42ca3 (diff) |
more edits to r43145,
- remove redundant check in new prop operator which is covered by operators poll func.
- use get_ob_property to get the object prop in BL_ConvertTextProperty() rather then looping for it.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/object/object_edit.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 6e1a4ba6cf2..4217e27fa7b 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1943,15 +1943,13 @@ static int game_property_new(bContext *C, wmOperator *op) char name[32]; int type= RNA_enum_get(op->ptr, "type"); - if(!ob) - return OPERATOR_CANCELLED; - prop= new_property(type); BLI_addtail(&ob->prop, prop); RNA_string_get(op->ptr, "name", name); - if(BLI_strnlen(name, 32) > 0) + if (name[0] != '\0') { BLI_strncpy(prop->name, name, sizeof(prop->name)); + } unique_property(NULL, prop, 0); // make_unique_prop_names(prop->name); |