Workbench Next: Sculpt Support #109294
No reviewers
Labels
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
Interest: X11
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 project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#109294
Loading…
Reference in New Issue
No description provided.
Delete Branch "pragma37/blender:pull-workbench-next-sculpt"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add Sculpt support for the new Draw Manager and implement Sculpt rendering in Workbench Next.
Instead of using a callback approach, it's now possible to retrieve a vector of GPUBatches and their material index, so engines can use them as they see fit.
A few cosmetic changes but otherwise looks good to me.
@ -0,0 +136,4 @@
int attrs_len = 0;
/* NOTE: these are NOT #eCustomDataType, they are extended values, ASAN may warn about this. */
attrs[attrs_len++].type = (eCustomDataType)CD_PBVH_CO_TYPE;
Use functional cast for all
eCustomDataType
.Use functional cast for all
eCustomDataType
.@ -0,0 +171,4 @@
}
}
return sculpt_batches_get_ex(ob, features & SCULPT_BATCH_WIREFRAME, false, attrs, attrs_len);
The feature masking here is not obvious nor safe (
bool
could be different from 0/1). Prefer definingbool use_wire = features & SCULPT_BATCH_WIREFRAME != 0
and use assculpt_batches_get_ex
argument.I personally find
flags & mask
more readable than(flags & mask) != 0
.This idiom is used all over the place, including the original functions from
draw_mamager_data
.Not sure why this one triggers your spider sense. 🤔
Regarding safety, it's guaranteed by the standard to be
true
.AFAIK, the binary representation of a
true
boolean is not guaranteed in any case, but that's only relevant for serialization.In any case, all the compilers we support do "the right thing".
https://godbolt.org/z/xbv5e6hcd
Might have been some gidelines we had when code was mostly C. Disregard that then.
@ -0,0 +19,4 @@
SCULPT_BATCH_DEFAULT = 0,
SCULPT_BATCH_WIREFRAME = 1 << 0,
SCULPT_BATCH_MASK = 1 << 1,
SCULPT_BATCH_FSET = 1 << 2,
Avoid contraction. SCULPT_BATCH_FACE_SET.
About the debug code, I would maybe make it part of workbench-next or overlay-next (preferably) instead.
The mesh color part can only be done on the Workbench side, so I implemented only that.
It matches the intended current behavior (it actually doesn't work in the current Workbench),
but I find kind of weird that the bounding box color doesn't match the mesh color.
We may want to look into that when we do the Overlay Next part.
@ -0,0 +63,4 @@
}
batch.material_slot = drw_pbvh_material_index_get(batches);
/** NOTE: This doesn't match the index used in DRW_sculpt_debug_cb (debug_node_nr). */
These kind of comments are better left on the PR itself. They are not really useful once the initial code gets removed.