diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-27 12:29:22 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-27 12:29:22 +0300 |
commit | d4f12860aa0d54e4a2d095cd55a51bc607bc65c0 (patch) | |
tree | 1bae4617496de42390a6ddde6601d8b06afaf1cc /source | |
parent | 5dbda33462349a4ac78f08e8ed4ec7922ca7394f (diff) |
Python API: Tag for update on object.update_from_editmode()
This call modifies geometry but does not inform anyone about
changes.
After this change it's possible to load edit mesh, then request
evaluated dependency graph and do some interesting things with
the updated object.
This is part of T63244: object.to_mesh ignores object.update_from_editmode
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/intern/rna_object_api.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index b5f515277ca..f5c83df0f45 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -706,7 +706,13 @@ void rna_Object_me_eval_info( static bool rna_Object_update_from_editmode(Object *ob, Main *bmain) { /* fail gracefully if we aren't in edit-mode. */ - return ED_object_editmode_load(bmain, ob); + const bool result = ED_object_editmode_load(bmain, ob); + if (result) { + /* Loading edit mesh to mesh changes geometry, and scripts might expect it to be properly + * informed about changes. */ + DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); + } + return result; } #else /* RNA_RUNTIME */ |