Page MenuHome

TexturePaint: Force Workbench Texture Color Mode
ClosedPublic

Authored by Jeroen Bakker (jbakker) on Jul 5 2019, 12:50 PM.

Details

Summary

Big 5-to-12 change; think I have solved all code paths.

When in texture paint mode and in solid mode the object that is being
texture painted will be rendered by the workbench engine with textures.
All other objects would render the same. For other cases the texture paint
draw engine will still draw the texture.

The texture mode draw engine now only drawn the masks. The opacity
sliders influences the texture mask.

This change has been implemented conserably. In the future we need to
look into making this better, like adding support that every object
can be colored differently. Currently when rendering in the workbench
we can have up to 3 different color types active (what the user selected,
the fallback in case no materials have been configured and this one,
forcing textures)

Diff Detail

Repository
rB Blender

Event Timeline

Behavior of all this looks good to me, will leave review of implementation to @Clément Foucault (fclem).

source/blender/draw/modes/paint_texture_mode.c
311–312

Remove comment

I'm happy with the behavior and the code seems good overall.

I can accept it as it is. But if you can clean the codestyle a bit that would be perfect.

source/blender/draw/engines/workbench/workbench_deferred.c
946

I don't really like having this function and using it as test to continue drawing. I think it should be a case inside workbench_deferred_solid_cache_populate to avoid some code duplication and increase readability.

997

Remove draw variable and use return true here.

source/blender/draw/engines/workbench/workbench_forward.c
546

Safe issue here.

source/blender/makesdna/DNA_view3d_types.h
439

I'm not really a fan of this, but I can let that pass.

This revision is now accepted and ready to land.Jul 5 2019, 2:48 PM
Jeroen Bakker (jbakker) marked 2 inline comments as done.Jul 5 2019, 3:43 PM