From 63225d7c8b3a45e8189476d537585b011993fb17 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 18 Apr 2018 12:14:28 +0200 Subject: Port particle instance modifier changes from Gooseberry branch The work is mainly from Lukas Toenne, with some modifications from myself. Includes following obvious changes: - Particle system selection is now name-based, with lookup menu. - Lots of new options to control varieties. Changes comparing to the Gooseberry branch: - Default values and versioning code ensures same behavior as the old modifier. - Custom data layers are coming from vertex color, the modifier does not create arbitrary layers now. The hope is to keep data more manageable, and maybe make it easier to select in the shader later on. This means, values are quantized to 256 values, but it should be enough to get varieties in practice. Reviewers: brecht, campbellbarton Reviewed By: brecht Subscribers: eyecandy Differential Revision: https://developer.blender.org/D3157 --- source/blender/blenloader/intern/versioning_270.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/blender/blenloader/intern') diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index e9de7919d25..86e6071180e 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -1813,6 +1813,18 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) } scene->r.ffcodecdata.ffmpeg_preset = preset; } + + if (!DNA_struct_elem_find(fd->filesdna, "ParticleInstanceModifierData", "float", "particle_amount")) { + for (Object *ob = main->object.first; ob; ob = ob->id.next) { + for (ModifierData *md = ob->modifiers.first; md; md = md->next) { + if (md->type == eModifierType_ParticleInstance) { + ParticleInstanceModifierData *pimd = (ParticleInstanceModifierData *)md; + pimd->space = eParticleInstanceSpace_World; + pimd->particle_amount = 1.0f; + } + } + } + } } } -- cgit v1.2.3