diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-12-11 07:02:58 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-12-11 07:02:58 +0300 |
commit | 7fe3d1e7d718561e275f21acc7261207e67bf685 (patch) | |
tree | 606b83fd766e747f0b2c8d41ca2a1075a2d5634b /source/blender | |
parent | 8216e9f8a26473373a8edc4916690642534e60e0 (diff) |
Fix T57934: non-empty duplicators don't render
Convert non-empty duplicators to empties.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_object.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 12 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 7 |
3 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index ff069bcbe79..2ccee7a4a68 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -349,6 +349,8 @@ bool BKE_object_modifier_update_subframe( struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, bool update_mesh, int parent_recursion, float frame, int type); +void BKE_object_type_set_empty_for_versioning(struct Object *ob); + bool BKE_image_empty_visible_in_view3d(const struct Object *ob, const struct RegionView3D *rv3d); #ifdef __cplusplus diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index b5dfb5d8244..9c166d154a3 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -4048,6 +4048,18 @@ bool BKE_object_modifier_update_subframe( return false; } + +void BKE_object_type_set_empty_for_versioning(Object *ob) +{ + ob->type = OB_EMPTY; + ob->data = NULL; + if (ob->pose) { + BKE_pose_free_ex(ob->pose, false); + ob->pose = NULL; + } + ob->mode = OB_MODE_OBJECT; +} + bool BKE_image_empty_visible_in_view3d(const Object *ob, const RegionView3D *rv3d) { int visibility_flag = ob->empty_image_visibility_flag; diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 9e6f64586ae..d10d86de2bc 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -2509,6 +2509,13 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) for (Camera *ca = bmain->camera.first; ca; ca = ca->id.next) { ca->drawsize *= 2.0f; } + for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + if (ob->type != OB_EMPTY) { + if (UNLIKELY(ob->transflag & OB_DUPLICOLLECTION)) { + BKE_object_type_set_empty_for_versioning(ob); + } + } + } } { |