Fix T49738: Hair Add Brush doesn't work
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 17 Oct 2016 10:37:50 +0000 (12:37 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 17 Oct 2016 10:38:54 +0000 (12:38 +0200)
the issue was caused by wrong default value for brush particle count
which was clamped on display from 0 to 1. This is technically a regression
but how to port this to 2.78a?

source/blender/blenloader/intern/versioning_270.c
source/blender/blenloader/intern/versioning_defaults.c

index 0d4ff00b7750bb41e08c5227c68e0640d01540d5..a2a10f5ccd8c0e4fdc3f404258844f590779db00 100644 (file)
@@ -1425,4 +1425,18 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
                        }
                }
        }
+
+       {
+               for (Scene *scene = main->scene.first; scene != NULL; scene = scene->id.next) {
+                       if (scene->toolsettings != NULL) {
+                               ToolSettings *ts = scene->toolsettings;
+                               ParticleEditSettings *pset = &ts->particle;
+                               for (int a = 0; a < PE_TOT_BRUSH; a++) {
+                                       if (pset->brush[a].count == 0) {
+                                               pset->brush[a].count = 10;
+                                       }
+                               }
+                       }
+               }
+       }
 }
index ec817b9b26180d1397c3336a4a1712075a0625de..99d9e140481f2a101ad051748cd16ed588d644fd 100644 (file)
@@ -147,6 +147,7 @@ void BLO_update_defaults_startup_blend(Main *bmain)
                        ParticleEditSettings *pset = &ts->particle;
                        for (int a = 0; a < PE_TOT_BRUSH; a++) {
                                pset->brush[a].strength = 0.5f;
+                               pset->brush[a].count = 10;
                        }
                        pset->brush[PE_BRUSH_CUT].strength = 1.0f;
                }