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.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user