Curves: add Curve Parameter Falloff to comb brush #104589

Merged
Jacques Lucke merged 10 commits from JacquesLucke/blender:curve-parameter-falloff into main 2023-02-15 10:42:40 +01:00
Member

This adds a new Curve Falloff popover to the comb brush tool settings. The curve control allows changing the brush weight along the curve to e.g. affect the tip more than the root. This is a relative way to get something like stiffness for short hair.

image

This functionality could potentially be added to some other brushes, but the comb brush is the most important one, so that is added first.

I did add the buttons add the buttons to choose a curve map preset. However, I did not add the preset dropdown, because that just adds some unnecessary complexity in the code now and is redundant.

This adds a new `Curve Falloff` popover to the comb brush tool settings. The curve control allows changing the brush weight along the curve to e.g. affect the tip more than the root. This is a relative way to get something like stiffness for short hair. ![image](/attachments/4e1a3bfb-5c92-477a-a70f-db1024b562dd) This functionality could potentially be added to some other brushes, but the comb brush is the most important one, so that is added first. I did add the buttons add the buttons to choose a curve map preset. However, I did not add the preset dropdown, because that just adds some unnecessary complexity in the code now and is redundant.
Jacques Lucke added 1 commit 2023-02-10 19:49:36 +01:00
Jacques Lucke added 1 commit 2023-02-10 19:51:28 +01:00
Jacques Lucke requested review from Simon Thommes 2023-02-10 19:55:52 +01:00
Jacques Lucke requested review from Hans Goudey 2023-02-10 19:55:52 +01:00
Simon Thommes requested changes 2023-02-11 13:29:48 +01:00
Simon Thommes left a comment
Member

Thanks for the patch, this is going to be a great step up for now, I think!

  • Falloff should now probably be renamed to Brush Falloff to make the distinction clear.
  • Not sure how easily achievable this is, due to the fact that it would have to be mirrored, but I think it would be great if this setting could also provide the same presets that the brush falloff does
  • In terms of default curve I am not sure. Would be good to wait for more people to try this out. I could potentially imagine even the Smooth curve as an even more extreme falloff. Trying a shape like that out with no particular use-case feels quite good and seems to help a lot to not rely on surface collision too much.
  • I'm wondering also what other brushes could benefit from this. The only one where I feel it could be useful right now is the pinch brush. But maybe it's fine to have this feature exclusive to the comb.
  • I noticed that this falloff seems to use the control point index, rather than the length based fraction of the curve, right? I think that will usually probably be fine, but as we have brushes that can mess with the segment length (e.g. smooth) this can lead to some undesirable results. I guess this was a decision for performance reasons?
Thanks for the patch, this is going to be a great step up for now, I think! - `Falloff` should now probably be renamed to `Brush Falloff` to make the distinction clear. - Not sure how easily achievable this is, due to the fact that it would have to be mirrored, but I think it would be great if this setting could also provide the same presets that the brush falloff does - In terms of default curve I am not sure. Would be good to wait for more people to try this out. I could potentially imagine even the `Smooth` curve as an even more extreme falloff. Trying a shape like that out with no particular use-case feels quite good and seems to help a lot to not rely on surface collision too much. - I'm wondering also what other brushes could benefit from this. The only one where I feel it could be useful right now is the pinch brush. But maybe it's fine to have this feature exclusive to the comb. - I noticed that this falloff seems to use the control point index, rather than the length based fraction of the curve, right? I think that will usually probably be fine, but as we have brushes that can mess with the segment length (e.g. smooth) this can lead to some undesirable results. I guess this was a decision for performance reasons?
Jacques Lucke added 1 commit 2023-02-13 14:49:11 +01:00
Member

Speaking of performance, it would be nice if this was behind a boolean option so it can be explicitly turned off. That should be the default too, IMO.

UI-wise, this could go in the same "Falloff" popover, using a popover for every curve template isn't very scalable IMO.

Speaking of performance, it would be nice if this was behind a boolean option so it can be explicitly turned off. That should be the default too, IMO. UI-wise, this could go in the same "Falloff" popover, using a popover for every curve template isn't very scalable IMO.
Member

This indeed feels much better, even just a linear falloff is a big improvement! :)
I could see this being useful for smooth, pinch and puff as well.

This indeed feels much better, even just a linear falloff is a big improvement! :) I could see this being useful for `smooth`, `pinch` and `puff` as well.
Author
Member

Not sure how easily achievable this is, due to the fact that it would have to be mirrored, but I think it would be great if this setting could also provide the same presets that the brush falloff does

Yes, that could be added.

I noticed that this falloff seems to use the control point index, rather than the length based fraction of the curve, right? I think that will usually probably be fine, but as we have brushes that can mess with the segment length (e.g. smooth) this can lead to some undesirable results. I guess this was a decision for performance reasons?

You guessed right.


I don't have a strong opinion for where this setting should go exactly, what the default should be and which brushes should have it. If you three can come to a compromise, that would be great.

> Not sure how easily achievable this is, due to the fact that it would have to be mirrored, but I think it would be great if this setting could also provide the same presets that the brush falloff does Yes, that could be added. > I noticed that this falloff seems to use the control point index, rather than the length based fraction of the curve, right? I think that will usually probably be fine, but as we have brushes that can mess with the segment length (e.g. smooth) this can lead to some undesirable results. I guess this was a decision for performance reasons? You guessed right. ---- I don't have a strong opinion for where this setting should go exactly, what the default should be and which brushes should have it. If you three can come to a compromise, that would be great.
Jacques Lucke added 5 commits 2023-02-14 19:05:45 +01:00
Jacques Lucke requested review from Simon Thommes 2023-02-14 19:10:07 +01:00
Jacques Lucke changed title from WIP: Curves: add Curve Parameter Falloff to comb brush to Curves: add Curve Parameter Falloff to comb brush 2023-02-14 19:10:32 +01:00
Simon Thommes approved these changes 2023-02-14 19:39:23 +01:00
Simon Thommes left a comment
Member

In my opinion this is good to go!

I know that Andy was not sure about the default setting. I'll add him as a reviewer, to me this can go either way. I personally think the way it is now is good.

In my opinion this is good to go! I know that Andy was not sure about the default setting. I'll add him as a reviewer, to me this can go either way. I personally think the way it is now is good.
Simon Thommes requested review from Technical-Artists 2023-02-14 19:41:47 +01:00
Simon Thommes requested review from Contributors 2023-02-14 19:41:47 +01:00
Simon Thommes requested review from Owners 2023-02-14 19:41:47 +01:00
Simon Thommes requested review from Developers 2023-02-14 19:41:47 +01:00
Simon Thommes reviewed 2023-02-14 19:58:58 +01:00
Simon Thommes left a comment
Member

I can't request Andy's review, but apparently instead requested review of the entire universe. So I'll just tag you here, @eyecandy

I can't request Andy's review, but apparently instead requested review of the entire universe. So I'll just tag you here, @eyecandy
Brecht Van Lommel removed review request for Developers 2023-02-14 20:17:25 +01:00
Brecht Van Lommel removed review request for Contributors 2023-02-14 20:17:27 +01:00
Brecht Van Lommel removed review request for Owners 2023-02-14 20:17:30 +01:00
Brecht Van Lommel removed review request for Technical-Artists 2023-02-14 20:17:33 +01:00
Hans Goudey approved these changes 2023-02-14 23:34:25 +01:00
Hans Goudey left a comment
Member

The code looks reasonable.

What I was referring to earlier when I mentioned presets was this here, which can avoid the curvemapping evaluation when one of the presets are selected (one of the default presets could be the default too).

image

Don't want to hold this up and require that, just mentioning it though, in case it seems reasonable to you too.

The code looks reasonable. What I was referring to earlier when I mentioned presets was this here, which can avoid the curvemapping evaluation when one of the presets are selected (one of the default presets could be the default too). ![image](/attachments/315d45bd-70be-4fc6-8e36-017579bf3027) Don't want to hold this up and require that, just mentioning it though, in case it seems reasonable to you too.
@ -147,2 +150,4 @@
self_->constraint_solver_.initialize(
*curves_orig_, curve_selection_, curves_id_orig_->flag & CV_SCULPT_COLLISION_ENABLED);
self_->curve_lengths_.reinitialize(curves_orig_->points_num());
Member

points_num -> curves_num, right?

`points_num` -> `curves_num`, right?
Brecht Van Lommel added this to the Nodes & Physics project 2023-02-15 09:54:42 +01:00
Member

looks good! I suggest to use a linear curve as the default since it could more intuitively convey the mapping of the curve (left is root, right is tip) this way.

Without any visual cues like that it's a big hard to grasp what it does (that's also why I'm not a big fan of the presets).

looks good! I suggest to use a linear curve as the default since it could more intuitively convey the mapping of the curve (left is root, right is tip) this way. Without any visual cues like that it's a big hard to grasp what it does (that's also why I'm not a big fan of the presets).
Jacques Lucke added 2 commits 2023-02-15 10:31:47 +01:00
Author
Member

What I was referring to earlier when I mentioned presets was this here, which can avoid the curvemapping evaluation when one of the presets are selected (one of the default presets could be the default too).

While I agree with the general idea of skipping the curve mapping evaluation, I don't think the right approach is to use a preset system that lives outside of the curve map. We could investigate building these presets into curve mappings though. The curve should probably still always be visible, but in many cases it could also be much smaller and doesn't have to be quadratic. For efficient evaluation we could still detect common cases and implement special evaluation functions for those.

At some point we probably also want to display a curve map in a socket, then the UI has to be simplified more as well.

> What I was referring to earlier when I mentioned presets was this here, which can avoid the curvemapping evaluation when one of the presets are selected (one of the default presets could be the default too). While I agree with the general idea of skipping the curve mapping evaluation, I don't think the right approach is to use a preset system that lives outside of the curve map. We could investigate building these presets into curve mappings though. The curve should probably still always be visible, but in many cases it could also be much smaller and doesn't have to be quadratic. For efficient evaluation we could still detect common cases and implement special evaluation functions for those. At some point we probably also want to display a curve map in a socket, then the UI has to be simplified more as well.
Jacques Lucke merged commit ddc6815b1a into main 2023-02-15 10:42:40 +01:00
Jacques Lucke deleted branch curve-parameter-falloff 2023-02-15 10:42:41 +01:00
Sign in to join this conversation.
No reviewers
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 Assignees
4 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#104589
No description provided.