diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-02-22 18:06:13 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-02-22 18:06:23 +0300 |
commit | 7372058649666c7b0425c2f4d1a688a65ad11e61 (patch) | |
tree | fe81d2b57503c5b50b90885be923ca9c4c2641ac /source/blender/blenloader | |
parent | e278b38b921d625a11544203808575a7180f75e8 (diff) |
Wireframe: Add object and random coloring option in wireframe mode
The option is separated from the solid mode color option.
Random color uses the same method as solid mode.
Selection state is indicated by a brighter color that is outside the
brightness range of the unselected state colors. The active state is
indicated by the outlines that is, now, still drawn in wireframe mode.
Coloring of the selection / active outline is not optimal because it
can look ugly in some cases of color combination. But the outline color
is using index range coloring so it's not trivial to change the color of
the outline per object. For now we use the same outline color used in solid
mode for consistency and also still add an emphasis on the selected objects.
The Single color option uses the theme color. Maybe it would be nice to
change the name of it in a latter commit to avoid confusion.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 07fae75974f..5234efdce03 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -2807,5 +2807,19 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) { /* Versioning code until next subversion bump goes here. */ + + /* Add wireframe color. */ + if (!DNA_struct_elem_find(fd->filesdna, "View3DShading", "char", "wire_color_type")) { + for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { + for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { + if (sl->spacetype == SPACE_VIEW3D) { + View3D *v3d = (View3D *)sl; + v3d->shading.wire_color_type = V3D_SHADING_SINGLE_COLOR; + } + } + } + } + } } } |