Sculpt persistent mesh state management #77738

Open
opened 2020-06-10 21:48:03 +02:00 by Pablo Dobarro · 2 comments
Member

The Layer Brush has a "Set Persistent Base" operator that stores a copy of the mesh coordinates and normals using the sculpt API. This is needed for that brush to be usable, but it has some problems:

  • The coordinates and normals copy is freed with the PBVH. This means that any operation that needs a PBVH rebuild will delete the persistent state. These rebuilds happen in situations where the topology does not change so that data will be still valid, like switching objects, but may also happen in random situations like tweaking brush settings, undo or saving the file (which seems like a bug).
  • There is no info in the UI if a persistent base is available

Furthermore, this same concept is needed in other tools to fix some important limitations:

  • The cloth brush could use a persistent base to always create the constraints from the same state. This way the brush will behave more like a regular cloth simulation instead of accumulating the deformation effect on each stroke. This is needed to create some effects with the cloth brush and filter
  • The Pose Brush with affect loose part options could use a persistent base state with the model in T pose to calculate the fake neighbor information. With the current implementation, if you move an arm close to the body you won't be able to separate it again as it will calculate fake neighbors between the body and the arm.

As this is a concept similar to shape keys which will probably be similar to sculpt layers, there are still a lot of design decisions to be made to have a final solution for this:

  • It is not clear what shape keys, layers and persistent base should do in the sculpting system as all of them are a similar implementation of the same concept. It needs to be decided which system (or systems) are we going to use. Without this, it is hard to start working on a more clear design and UI proposal. If we decide to have a unified system to manage mesh states, it will need to be carefully designed as it needs to support a lot of different use cases (all the ones mentioned, for layering details in high poly meshes, for they Keymesh project to partially reset deformed models to the default pose...)
  • There is no support for shape keys or layers in grids data. We also don't know if they need to be stored per level or only in the higher level and use propagation
  • This should also support vertex colors and vertex colors in multires as it will be required for some tools

Proposal

As having a workaround for this could improve a lot some of the tools, the sculpt API could implement a ##SCULPT_vertex_get_persistent_co## function. The function will use the same implementation as the current layer brush, so it will return the data stored in the persistent base if available. This will mean than tools like the cloth brush and the pose brush will have a "persistent" and "set persistent base" properties and operators available. Once a more polished management system is in place, it should only be necessary to change the implementation of that function to return the data from the current persistent base wherever it is stored.

The Layer Brush has a "Set Persistent Base" operator that stores a copy of the mesh coordinates and normals using the sculpt API. This is needed for that brush to be usable, but it has some problems: - The coordinates and normals copy is freed with the PBVH. This means that any operation that needs a PBVH rebuild will delete the persistent state. These rebuilds happen in situations where the topology does not change so that data will be still valid, like switching objects, but may also happen in random situations like tweaking brush settings, undo or saving the file (which seems like a bug). - There is no info in the UI if a persistent base is available Furthermore, this same concept is needed in other tools to fix some important limitations: - The cloth brush could use a persistent base to always create the constraints from the same state. This way the brush will behave more like a regular cloth simulation instead of accumulating the deformation effect on each stroke. This is needed to create some effects with the cloth brush and filter - The Pose Brush with affect loose part options could use a persistent base state with the model in T pose to calculate the fake neighbor information. With the current implementation, if you move an arm close to the body you won't be able to separate it again as it will calculate fake neighbors between the body and the arm. As this is a concept similar to shape keys which will probably be similar to sculpt layers, there are still a lot of design decisions to be made to have a final solution for this: - It is not clear what shape keys, layers and persistent base should do in the sculpting system as all of them are a similar implementation of the same concept. It needs to be decided which system (or systems) are we going to use. Without this, it is hard to start working on a more clear design and UI proposal. If we decide to have a unified system to manage mesh states, it will need to be carefully designed as it needs to support a lot of different use cases (all the ones mentioned, for layering details in high poly meshes, for they Keymesh project to partially reset deformed models to the default pose...) - There is no support for shape keys or layers in grids data. We also don't know if they need to be stored per level or only in the higher level and use propagation - This should also support vertex colors and vertex colors in multires as it will be required for some tools **Proposal** As having a workaround for this could improve a lot some of the tools, the sculpt API could implement a ##SCULPT_vertex_get_persistent_co## function. The function will use the same implementation as the current layer brush, so it will return the data stored in the persistent base if available. This will mean than tools like the cloth brush and the pose brush will have a "persistent" and "set persistent base" properties and operators available. Once a more polished management system is in place, it should only be necessary to change the implementation of that function to return the data from the current persistent base wherever it is stored.

This issue was referenced by a3e6b7c2ce

This issue was referenced by a3e6b7c2ce06b937c0444d8761f8351c9f9e2f59

To me it seems persistent base as used by the layer brush should be a temporary state in sculpt mode, that you can create or discard as easily as a mask. Maybe sculpt layers can eventually replace it, if it's convenient enough to create and sculpt on a temporary layer that you then merge into the layer below.

I wouldn't go in the direction of using persistent base for something like a T pose or undeformed mesh shape. For that I think shape keys or sculpt layers are the correct solution.

To me it seems persistent base as used by the layer brush should be a temporary state in sculpt mode, that you can create or discard as easily as a mask. Maybe sculpt layers can eventually replace it, if it's convenient enough to create and sculpt on a temporary layer that you then merge into the layer below. I wouldn't go in the direction of using persistent base for something like a T pose or undeformed mesh shape. For that I think shape keys or sculpt layers are the correct solution.
Julien Kaspar added this to the Sculpt, Paint & Texture project 2023-02-08 10:26:20 +01:00
Philipp Oeser removed the
Interest
Sculpt, Paint & Texture
label 2023-02-10 09:12:29 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#77738
No description provided.