diff options
6 files changed, 8 insertions, 10 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 13cd991a73b..0baf611b293 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -735,7 +735,8 @@ void BKE_scene_init(Scene *sce) pset->draw_step = 2; pset->fade_frames = 2; pset->selectmode = SCE_SELECT_PATH; - for (a = 0; a < PE_TOT_BRUSH; a++) { + + for (a = 0; a < ARRAY_SIZE(pset->brush); a++) { pset->brush[a].strength = 0.5f; pset->brush[a].size = 50; pset->brush[a].step = 10; diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c index 97fdee748d5..5ec81f62bd0 100644 --- a/source/blender/blenloader/intern/versioning_250.c +++ b/source/blender/blenloader/intern/versioning_250.c @@ -1785,7 +1785,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) ParticleEditSettings *pset = &sce->toolsettings->particle; int a; - for (a = 0; a < PE_TOT_BRUSH; a++) + for (a = 0; a < ARRAY_SIZE(pset->brush); a++) pset->brush[a].strength /= 100.0f; } diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index 8d48bc043ca..75acd620c86 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -1243,7 +1243,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) if (!MAIN_VERSION_ATLEAST(main, 277, 1)) { for (Scene *scene = main->scene.first; scene; scene = scene->id.next) { ParticleEditSettings *pset = &scene->toolsettings->particle; - for (int a = 0; a < PE_TOT_BRUSH; a++) { + for (int a = 0; a < ARRAY_SIZE(pset->brush); a++) { if (pset->brush[a].strength > 1.0f) { pset->brush[a].strength *= 0.01f; } @@ -1593,7 +1593,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) if (scene->toolsettings != NULL) { ToolSettings *ts = scene->toolsettings; ParticleEditSettings *pset = &ts->particle; - for (int a = 0; a < PE_TOT_BRUSH; a++) { + for (int a = 0; a < ARRAY_SIZE(pset->brush); a++) { if (pset->brush[a].count == 0) { pset->brush[a].count = 10; } diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c index 23ec1cd3231..523581203d5 100644 --- a/source/blender/blenloader/intern/versioning_defaults.c +++ b/source/blender/blenloader/intern/versioning_defaults.c @@ -170,7 +170,7 @@ void BLO_update_defaults_startup_blend(Main *bmain) ts->gpencil_ima_align = GP_PROJECT_VIEWSPACE; ParticleEditSettings *pset = &ts->particle; - for (int a = 0; a < PE_TOT_BRUSH; a++) { + for (int a = 0; a < ARRAY_SIZE(pset->brush); a++) { pset->brush[a].strength = 0.5f; pset->brush[a].count = 10; } diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c index 90dd968131a..a7a3ff6e323 100644 --- a/source/blender/blenloader/intern/versioning_legacy.c +++ b/source/blender/blenloader/intern/versioning_legacy.c @@ -3148,7 +3148,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) pset->totaddkey = 5; pset->brushtype = PE_BRUSH_NONE; - for (a = 0; a < PE_TOT_BRUSH; a++) { + for (a = 0; a < ARRAY_SIZE(pset->brush); a++) { pset->brush[a].strength = 50; pset->brush[a].size = 50; pset->brush[a].step = 10; diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 0f15ac0ff7f..1ce94fb226f 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -1070,7 +1070,7 @@ typedef struct ParticleEditSettings { short totaddkey; short brushtype; - ParticleBrushData brush[7]; /* 7 = PE_TOT_BRUSH */ + ParticleBrushData brush[7]; void *paintcursor; /* runtime */ float emitterdist, rt; @@ -2236,9 +2236,6 @@ typedef enum eGPencil_Placement_Flags { #define PE_BRUSH_SMOOTH 5 #define PE_BRUSH_WEIGHT 6 -/* this must equal ParticleEditSettings.brush array size */ -#define PE_TOT_BRUSH 6 - /* ParticleBrushData.flag */ #define PE_BRUSH_DATA_PUFF_VOLUME 1 |