diff options
author | Mai Lavelle <mai.lavelle@gmail.com> | 2018-02-07 06:55:15 +0300 |
---|---|---|
committer | Mai Lavelle <mai.lavelle@gmail.com> | 2018-02-15 11:26:59 +0300 |
commit | c98af0faaf0d2dc87e9c0007e6fab8f44c2ba608 (patch) | |
tree | 14e154ef5b8fc9e3047efb3f859fa47ba5520626 /source/blender/blenloader | |
parent | ca7f826c6f1812d38cd3a6985b5fc8de6e9de78c (diff) |
Add versioning code to make particles with default size visible again
Due to changes in draw code particles from old files that may have had a
default draw size of 0 will not be visible. Old draw code would check
for this and adjust the size, however the unit for draw size has changed
from pixels to BU, and it no longer makes sense to have such checks.
This patch is to ensure particles from such files remain visible.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 93c6a9cccba..46021a8b502 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -546,6 +546,18 @@ void do_versions_after_linking_280(Main *main) } } + if (!MAIN_VERSION_ATLEAST(main, 280, 3)) { + /* Due to several changes to particle RNA and draw code particles from older files may no longer + * be visible. Here we correct this by setting a default draw size for those files. */ + for (Object *object = main->object.first; object; object = object->id.next) { + for (ParticleSystem *psys = object->particlesystem.first; psys; psys=psys->next) { + if(psys->part->draw_size == 0.0f) { + psys->part->draw_size = 0.1f; + } + } + } + } + { for (WorkSpace *workspace = main->workspaces.first; workspace; workspace = workspace->id.next) { if (workspace->view_layer) { |