diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-11-09 15:59:12 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-11-09 16:01:55 +0300 |
commit | 6c10ec74d5ec3d6fbbc1531463c117332b91ebed (patch) | |
tree | b0e3226945dab9efab86b938eb18bfb2ebe993c1 /source/blender/makesrna/intern/rna_ID.c | |
parent | 88d621a68f943f105e2ddf81542b54ac261397e2 (diff) |
Fix crash when renaming metaballs
This handles both renaming via outliner and rna.
Metaballs as we all know have their geometry based on the metaballs that
share the same name with them.
Changing the name of a metaball without tagging its geometry to change
is asking for trouble.
Diffstat (limited to 'source/blender/makesrna/intern/rna_ID.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_ID.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index ab4bdc4e064..20383d4dc23 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -153,6 +153,13 @@ void rna_ID_name_set(PointerRNA *ptr, const char *value) BLI_strncpy_utf8(id->name + 2, value, sizeof(id->name) - 2); BLI_assert(BKE_id_is_in_global_main(id)); BLI_libblock_ensure_unique_name(G_MAIN, id->name); + + if (GS(id->name) == ID_OB) { + Object *ob = (Object *)id; + if (ob->type == OB_MBALL) { + DEG_id_tag_update(&ob->id, DEG_TAG_GEOMETRY); + } + } } static int rna_ID_name_editable(PointerRNA *ptr, const char **UNUSED(r_info)) |