Commit: 1c0bc19e3f55eff4bc2df4c2affb64272c5f5cb7
Author: Bastien Montagne
Date:   Thu Nov 29 16:23:27 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB1c0bc19e3f55eff4bc2df4c2affb64272c5f5cb7

Fix T57796: bad 'draw emitter' conversion, importing shared particle systems 
from 2.79b to 2.80

Not sure what those #ifdef's were supposed to do exactly... But one
thing is for sure, clearing that flag in particlesettings after first
encounter would prevent transferring it properly to other objects that
would use same particlesettings.

===================================================================

M       source/blender/blenloader/intern/versioning_280.c

===================================================================

diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index 5d1d4a9ad2f..906dc96be01 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -723,24 +723,12 @@ void do_versions_after_linking_280(Main *bmain)
 
        if (!MAIN_VERSION_ATLEAST(bmain, 280, 4)) {
                for (Object *object = bmain->object.first; object; object = 
object->id.next) {
-#ifndef VERSION_280_SUBVERSION_4
-                       /* If any object already has an initialized value for
-                        * duplicator_visibility_flag it means we've already 
doversioned it.
-                        * TODO(all) remove the VERSION_280_SUBVERSION_4 code 
once the subversion was bumped. */
-                       if (object->duplicator_visibility_flag != 0) {
-                               break;
-                       }
-#endif
                        if (object->particlesystem.first) {
                                object->duplicator_visibility_flag = 
OB_DUPLI_FLAG_VIEWPORT;
                                for (ParticleSystem *psys = 
object->particlesystem.first; psys; psys = psys->next) {
                                        if (psys->part->draw & 
PART_DRAW_EMITTER) {
                                                
object->duplicator_visibility_flag |= OB_DUPLI_FLAG_RENDER;
-#ifndef VERSION_280_SUBVERSION_4
-                                               psys->part->draw &= 
~PART_DRAW_EMITTER;
-#else
                                                break;
-#endif
                                        }
                                }
                        }
@@ -751,6 +739,11 @@ void do_versions_after_linking_280(Main *bmain)
                                object->duplicator_visibility_flag = 
OB_DUPLI_FLAG_VIEWPORT | OB_DUPLI_FLAG_RENDER;
                        }
                }
+
+               /* Cleanup deprecated flag from particlesettings data-blocks. */
+               for (ParticleSettings *part = bmain->particle.first; part; part 
= part->id.next) {
+                       part->draw &= ~PART_DRAW_EMITTER;
+               }
        }
 
        /* SpaceTime & SpaceLogic removal/replacing */

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to