diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-10-01 20:32:09 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-10-01 20:37:29 +0300 |
commit | 710e4847a0d2c6f18262b928faae9288bd41ad4e (patch) | |
tree | 675512d1a8154d103d82674fef4a505fa2707563 /source/blender/blenloader | |
parent | 9f4dca8963373889cd4efb096d3ae44a19312cd9 (diff) |
Cleanup: remove redundant id lookups in versioning code
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_defaults.c | 40 |
1 files changed, 7 insertions, 33 deletions
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c index 2e2b4bcd1dd..24c9a7c4147 100644 --- a/source/blender/blenloader/intern/versioning_defaults.c +++ b/source/blender/blenloader/intern/versioning_defaults.c @@ -486,54 +486,28 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template) Brush *brush; /* Pencil brush. */ - brush = BLI_findstring(&bmain->brushes, "Draw Pencil", offsetof(ID, name) + 2); - if (brush) { - /* Change brush name. */ - rename_id_for_versioning(bmain, ID_BR, "Draw Pencil", "Pencil"); - } + rename_id_for_versioning(bmain, ID_BR, "Draw Pencil", "Pencil"); /* Pen brush. */ - brush = BLI_findstring(&bmain->brushes, "Draw Pen", offsetof(ID, name) + 2); - if (brush) { - /* Change brush name. */ - rename_id_for_versioning(bmain, ID_BR, "Draw Pen", "Pen"); - } + rename_id_for_versioning(bmain, ID_BR, "Draw Pen", "Pen"); /* Pen Soft brush. */ - brush = BLI_findstring(&bmain->brushes, "Draw Soft", offsetof(ID, name) + 2); + brush = (Brush *)rename_id_for_versioning(bmain, ID_BR, "Draw Soft", "Pencil Soft"); if (brush) { brush->gpencil_settings->icon_id = GP_BRUSH_ICON_PEN; - /* Change brush name. */ - rename_id_for_versioning(bmain, ID_BR, "Draw Soft", "Pencil Soft"); } /* Ink Pen brush. */ - brush = BLI_findstring(&bmain->brushes, "Draw Ink", offsetof(ID, name) + 2); - if (brush) { - /* Change brush name. */ - rename_id_for_versioning(bmain, ID_BR, "Draw Ink", "Ink Pen"); - } + rename_id_for_versioning(bmain, ID_BR, "Draw Ink", "Ink Pen"); /* Ink Pen Rough brush. */ - brush = BLI_findstring(&bmain->brushes, "Draw Noise", offsetof(ID, name) + 2); - if (brush) { - /* Change brush name. */ - rename_id_for_versioning(bmain, ID_BR, "Draw Noise", "Ink Pen Rough"); - } + rename_id_for_versioning(bmain, ID_BR, "Draw Noise", "Ink Pen Rough"); /* Marker Bold brush. */ - brush = BLI_findstring(&bmain->brushes, "Draw Marker", offsetof(ID, name) + 2); - if (brush) { - /* Change brush name. */ - rename_id_for_versioning(bmain, ID_BR, "Draw Marker", "Marker Bold"); - } + rename_id_for_versioning(bmain, ID_BR, "Draw Marker", "Marker Bold"); /* Marker Chisel brush. */ - brush = BLI_findstring(&bmain->brushes, "Draw Block", offsetof(ID, name) + 2); - if (brush) { - /* Change brush name. */ - rename_id_for_versioning(bmain, ID_BR, "Draw Block", "Marker Chisel"); - } + rename_id_for_versioning(bmain, ID_BR, "Draw Block", "Marker Chisel"); /* Remove useless Fill Area.001 brush. */ brush = BLI_findstring(&bmain->brushes, "Fill Area.001", offsetof(ID, name) + 2); |