This brush simulates deforming clay with your fingers, accumulating
material during the stroke. It has a plane that tilts during the stroke
in the front part of the brush to achieve this effect.
Could we have any comment explaining what this function is doing, and the whys?
Suggestion: const float tilt_mix = local_co > 0.0f ? 0.0f : 1.0f;
Same here. This function is the core function of the brush and is severely under commented.
Please follow code style for comments (Starts with a capital letter, ends with a period)
Code wise Just some small stuff. I do have to agree that the working of (sculpt) brushes isn't well documented and we should spend time adding documentation.
Note that commenting code is not adding subtitles in comment blocks like in this patch. That is useful but still very limited.
Things to be aware of when writing comments:
- Code is typically written once, but read many times. So the time someone needs to spend on looking what exactly happens should be optimized
- Start how the brush works from a functional (user) way and refer to important variables/functions in the code.
- Document variables/attributes and parameters
- like the clay_add variable, is unclear to which brush it belongs to as it has a very generic name and is not categorized like other settings. You could add info to which brush it belongs, why the value exists (eg. The rotation that is added to the sculpt plane to simulate clay addition) It is better to document where it is defined.
I can imagine that describing the attributes would give a good starting point how a brush works.
Is there a reason why we don't store the rad in clay_add field?
don't use int when they are float
think this is a bad name.
All artifacts are now fixed and the brush input samples number does not longer affect the brush behavior. It now has a second input sample buffer to stabilize the pressure and the radius variation, as well as configured input curves.
(remember to mention this in https://wiki.blender.org/wiki/Reference/Release_Notes/2.83 ideally with image or video, and enough information so @Aaron Carlisle (Blendify) can help adding this to the 2.83 manual).