Feature #120318: Add sculpt mask access in node tool #120378
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#120378
Loading…
Reference in New Issue
No description provided.
Delete Branch "Prikshit-singh/blender:Feature/Sculpt_mask_node_tool"
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?
Before:
After:
tooltip:
After implementing now it works something like this:
Thanks. Note that this is not a fix, but a new feature. The PR title should be changed.
Fix #120318: Add sculpt mask access in node toolto Feature #120318: Add sculpt mask access in node toolDone
Thanks for working on this. It's not really what the design task describes though. There should be a new "Boolean/Float" enum property that changes the input socket type and the type of the stored attribute. The inversion should be done by the node itself for mesh sculpt mode mask storage, without input from the user.
Thanks, Now I understood, will work on that.
@HooglyBoogly I made some changes and the node looks and works something like this , your thoughts :
Looks better, nice! The behavior in sculpt mode when the node is set to "Boolean" seems wrong though, I'm not sure what happened there.
Thanks could you give me a clue how it should look like , also while defining the enums in DNA what should be the names of the boolean and float enum
That would be easier if you update the code and description of this PR.
I think the enum value can be defined in the node file actually, like
enum class PatternMode {
. That should make the naming clearer too.ok
Getting there!
@ -51,0 +66,4 @@
case GeometryComponent::Type::PointCloud:
return *attributes.lookup_or_default<float>(".selection", domain, true);
case GeometryComponent::Type::Mesh:
return *attributes.lookup_or_default<float>(".sculpt_mask", domain, true);
This needs to be inverted (
1.0 - value
) since we store the inverse of selection. That can be done by inserting a field operation after the field input innode_geo_exec
. Also the default values should be floats. And the default value should be 0 for.sculpt_mask
.I made all the necessary changes but still not able to understand this part ?
Could you clarify what you don't understand?
I don't understand where do i get the
value
from and what is the use of field operation here , to be specific why do we use field operation i didnt understand the use of it.Adding a
FieldOperation
here is like inserting an invisible node into the node graph before the set selection node. The value would be the input socket to that node. For an example, you could look atmax_zero_fn
andcount_field
innode_geo_duplicate_elements.cc
ok
@ -55,9 +80,16 @@ static void node_geo_exec(GeoNodeExecParams params)
}
if (params.user_data()->call_data->operator_data->mode == OB_MODE_OBJECT) {
params.set_output("Selection", true);
params.set_output("Float", false);
false
->1.0f
Done
@ -83,0 +66,4 @@
if (Mesh *mesh = geometry.get_mesh_for_write()) {
if (params.user_data()->call_data->operator_data->mode == OB_MODE_SCULPT) {
Field<bool> inverted = invert_boolean_field(selection);
bke::try_capture_field_on_geometry(
Writing to a float attribute with the boolean field isn't correct.
".sculpt_mask"
should be written as a float attributehow can i convert boolean field into float attribute
Check out uses of
BKE_type_conversions.hh
in geometry nodes.@HooglyBoogly any changes required to the latest PR
Checkout
From your project repository, check out a new branch and test the changes.