# 2022-4-13 Sculpt/Texture/Paint Module Meeting
## Attendees
- Brecht van Lommel (Developer)
- Daniel Bystedt (Artist)
- Julien Kaspar (Artist)
## Agenda
Design discussion for Paint Mode based on [open questions](https://hackmd.io/@JHyBAjeSQFyYQD5sicVWNA/BJn76wEm9)
- Discuss open topics and paint mode design
- Clearly define clear questions, known issues and proposed solutions
- Create a dev-talk thread from the outcome
## Announcements
## Notes
- Custom modes
- Focus on Paint Mode functionality first
- Texture Layers might make it really necessary to have a focused Paint Mode
- Mixing that with sculpt mode might be difficult
- Color attrbute painting might just as well stay also in sculpt mode. UI/UX just needs more attention still
- Masking
- Using selection based masks in sculpt mode
- It's possible. Just confusing on a design
- For texture painting: Selection based masking & stencil based masking covers most use cases
- Focus should be on supporting that at the least
- The choice which features to include is mostly
- What if we build on top of sculpt mode masking & face sets
- We are missing face selection masking and stencil based masking then
- Both are not natively supported in sculpt mode right now
- Reusing old face selection masking or implementing soemthing new is both taking up time.
- Face sets were previously suggested as a way of getting face masking (for shapr edges while painting) but face sets are not ideal for that purpose
- They are not as regularly changes as masks
- They obscure the color information of the surface
- So instead we'd need to add functionality to the sculpt mode masking
- Proposal to add face selection to sculpt mode:
- There would be an additional toggle (or two) for including the edit mode selection as a mask in sculpt mode (in extension also paint mode)
- The visualization of these 2 masks need to blend together well -> Make the sculpt mode masking and edit mode selection masking look similar
- Issues:
- Can the user edit only the sculpt mode mask or also the selection mask?
- If both can be edited then how do we know which mask is which? How will it be synched with edit mode?
- Synching sculpt mode masks with edit mode selection will likely be difficult since it's easy to lose information
- if only sculpt mode mask can be edited then how do we communicate in the I which mask is which (2 different types of masks at the same time ...)
- Proposal to add selection modes for masking:
- Make the sculpt mode mask not stored per vertex but per face corner
- Then add selection modes in the header similar to edit mode vert/edge/face selection
- With this the user can change the behaviour if the masking toolset is masking vertices (smooth transitions) or faces (sharp transitions)
- A third option for pixel based masking can also be availible there
- Based on what data is being painted different selection modes will be shown
- On vertex color data -> Only vertex masks
- On Face corner data -> vertex and face masks
- On textures -> all three
- Keeping edit mode selection untouched for the sake of keeping workflows separate?
- What if you don't want your edit mode selection synched with masking on sculpt/paint mode?
- We agreed that it would definitely be useful to have them synched. The issue is just more how that can be acheived
- Even just having an operator to create a mask from edit mode selection would be useful
- Edit Mode will likely always have some specific selection oeprators that are too useful to exclude from the workflow
- There could also be an option to sync edit mode selection with sculpt/paint mode masks
- Always having it synched would then always be better
- There are probably no cases where the selection or masks are accidetally destroyed
- Or if there are there should be an option to save elaborate masks as an attribute for later use
- Current takeaway
- Add masking modes in sculpt/paint mode for per face masking
- Synch masking with edit mode selection
- There would likely have to be a threshold when a masked vertex is selected in edit mode
- Inverting behaviour and visualizing of masking?
- For painting color information and for the case of synching/transfering edit mode selection to mask
- It's important then to flip the behaviour of masking
- The parts that are masked with masking tools are selected -> the areas you can paint/sculpt
- Should sharp transitions between faces and masking be handles separately?
- Maybe sharp transitionas are defined in the geometry in a more permanent way?
- That way we don't need per face masking in paint mode?
- From the arists perspective the sharp transitions between colors are not permanent but should be able to freely repainted them any time anywhere
- In that case the it shuldn't be handles separately -> Use masks in sculpt/paint mode
- There are 2 separete use cases for masking: Mask for current painting and isolating work areas
- Masking toolset could be used for both
- In that case it's necessary to quickly regain the masks to create work areas
- Face sets / id maps are useful here
- Saving masks as attributes or layer masks in material as well
- Then provide operators to convert attribute into mask
- Pixel mask vs geoemtry mask (vert/face)
- How do we convert pixel mask with geoemtry mask?
- Have them synched. Or an option to synch them
- This would lead to losing information?
- Where is the texture stored? The texture layers? Or set per object like stencil mask?
- Takeaway: For now, choose stencil texture per object instead of waiting for texture-layers
- Try to synch them. This needs testing.
- Face Sets vs ID maps
- Face Sets do not repalce the need for ID maps
- Per pixel id colors are very important
- In id maps it's important to choose your own colors for exporing
- An issue to solve is anti-alisaed borders between id colors
- This can lead to gaps when using them as masks
- Internally, Blender could solve this issue by saving id maps as individual b/w maps and auto-nomralising them so there are no gaps between them
- This needs more technical design exploration but it would solve the issues
- No need for importing/exporing within Blender, so no need to store use id maps as standard texture file formats within Blender
- With this smarter internal use, we avoid users having to change id colors or rebake id maps to avoid gaps or bleeding between id colors
- Maybe even just using 4 color theorem
- This relieves work on the users side to fix issues
- Keeping id map and face sets in synch is too unlikely
- Instead add operators to convert face sets from current id map or the other way around
- Store id map for now in object just like stencil mask
- Add toggle to either use id map or face sets for face set related functionality in paint mode
- Still open question: How useful would it be to use an id map for face set functionality
- Toolset and accessibility was not a topic during this meeting. Needs to be discussed after
- Most tools have no shortcuts or are not efficient to select
- There's not occlusion support yet in sculpt mode (Only "Front faces only")
- Dynamic face set overlay
- Having face sets always visible is not ideal when painting colors
- We could enable the voerlay only when necessary
- When expanding and snapping to face sets -> Show face sets
- When using face set editing tools/brushes -> Show face sets (Maybe even force the overlay to be on, even if overlays are disabled?)
- When using atuomasking by face sets -> Show face sets as subtle contours
- Alternative could be to dynamically face any geometry that is automasked
- Would lead to slow performance though
- Turning on/off overlays is not as intuitive as a dynamic overlay
- Image Editor
- Stencil masking is currently broken
- In general the paint mode functionality should be fully supported in the image editor too
- Same for synching and visualizing masking, edit mode selection, face sets & id maps
- This will be its own project that comes afterwards though
- Full live baking of viewport shading is not as important
- Paint brush issue with square shape
- When changing the "tip roundness" shape to square, it doesn't use the full size of the brush radius
- Instead the square shape fits inside the circular radius
- Should be the other way around
- Maybe even visualize the radius shape as the correct square shape?
- The main issue behind this is that the brush can never use a full square texure
- This should get a to do task to keep track of the issue
- Baking UDIMs was brought up
- Should be discussed and addressed with rendering module?
## Links
Daniel shared some notes via a separate document:
https://docs.google.com/document/d/1qyTPDZ6EJMKc5hEdnOtrozBA8bFU2FESWEctjRzQTho/edit#heading=h.fgg6gpojhnma