Age | Commit message (Collapse) | Author |
|
This caused an additional argument when exiting object modes
and many other low level functions which don't need to access context.
This simplifies fixing T77073.
|
|
Differential Revision: https://developer.blender.org/D7804
|
|
|
|
This error was introduced wit the change in commit https://developer.blender.org/rB6a850f3cc840
As the brushes were not created, all modes except Edit were broken.
Now, the brushes and palette are not created when load the file in versioning code, but when the mode is enabled.
Also, if the brush already exist, the parameters are not reset as it was done in the versioning code in order to keep user settings.
The same logic is used for the default palette.
|
|
Now the brushes have several new random settings and use curves to define the effect. The curves have been moved below the parameter to keep UI standards and extra curve panels have been removed.
{F8505387}
The new curves are:
* Hue.
* Saturation.
* Value.
New option to random at stroke level instead to random at point level for the following values:
* Thickness.
* Strength.
* UV.
* Hue.
* Saturation.
* Value.
Curves have been moved below the corresponding parameter and only are displayed in properties panel. Display the curves in the popover made it unusable.
{F8505392}
Also, the Pressure random has been renamed to Radius because the old name was not clear enough.
Reviewed By: mendio, pablovazquez
Differential Revision: https://developer.blender.org/D7577
|
|
More small tweaks to get the right "feeling" when drawing.
The defaults has been tested by @pepeland.
|
|
With the previous commit, the angle effect was too subtle. Now the effect is more visible,
|
|
The interpolated points recalculated the angle again and this added noise. The angle must not be calculated and must use the previous thickness.
|
|
When using the Stroke mode, the reprojection function add a small offset of 0.5 to +X and +Y. Now this effect is removed subtracting this value before doing the conversion.
|
|
When use the Stroke reproject mode, the precission of the conversion makes the line produce a very small noise effect.
Now, if the stroke mode is enabled, a small smooth is done using a factor depending of the input samples.
The values of the smooth effect were provided by @pepeland after several testing.
|
|
With the new sampling, the arc points were not using the angle of the brush and the line was with the same thickness in all orientations.
|
|
Part of T74432.
Mostly a careful batch rename but had to do few smaller fixes.
Also ran clang-format on affected files.
|
|
Follow up of b2ee1770d4c3 and 10c2254d412d, part of T74432.
Now the area and region naming conventions should be less confusing.
Mostly a careful batch rename but had to do few smaller fixes.
Also ran clang-format on affected files.
|
|
Also fixed T75162
|
|
|
|
BKE_gpencil_geom.h
This split prepare the code for future geometry functions.
|
|
|
|
Both the MS headers and blender headers define the HKEY
which gives all kind of inclusion order issues.
This diff renames all *KEY constants to EVT_*KEY to resolve
this conflict.
Reviewed By: brecht , dfelinto
Differential Revision: http://developer.blender.org/D7164
|
|
|
|
|
|
|
|
This commit is a full refactor of the grease pencil modules including Draw Engine, Modifiers, VFX, depsgraph update, improvements in operators and conversion of Sculpt and Weight paint tools to real brushes.
Also, a huge code cleanup has been done at all levels.
Thanks to @fclem for his work and yo @pepeland and @mendio for the testing and help in the development.
Differential Revision: https://developer.blender.org/D6293
|
|
The old convention was easy to confuse with ScrArea.
Part of https://developer.blender.org/T74432.
This is mostly a batch rename with some manual fixing. Only single word
variable names are changed, no prefixed/suffixed names.
Brecht van Lommel and Campbell Barton both gave me a green light for
this convention change.
Also ran clan clang format on affected files.
|
|
- Use 'BKE_object_defgroup' prefix for object functions.
- Rename 'defvert_verify_index' to 'defvert_ensure_index'
since this adds the group if it isn't found.
|
|
|
|
|
|
Removing meaningless distinction between NULL pointer and EVT_TABLET_NONE,
and initialize pressure and tilt to 1.0 and 0.0 respectively when no tablet
is used.
|
|
This will be replaced later, so it's not logic allocate now.
|
|
|
|
|
|
|
|
There were two problems:
1) When the buffer was reallocate, the pointer was corrupted.
2) Short variables were too small to hold long lines.
|
|
This patch replaces D5787. Now instead to replace the startup.blend file, all the changes are done in versioning and moved to shared module to be reused by Brush reset.
Reviewers: brecht, mendio
Reviewed By: brecht
Subscribers: pepeland, mendio
Differential Revision: https://developer.blender.org/D5913
|
|
As always uses 4 points, don't need to do calculations for that and also it was wrong with 3 points.
|
|
When using the samples, the interpolated points get abrupt steps because the system cannot receive all events in a short period of time.
This is more noticeable when the samples are set to 10 and the pen is moved very fast. The problem with post-processing smooth is that is applied to all stroke and this removes details.
The smart smooth is automatic and detect only the segments in the stroke where the system was unable to capture all movements and apply a smooth algorithm.
|
|
There was a mix of old and new constants. Now have one list of WM_CURSOR_*
cursor types, using GHOST standard cursors when available and otherwise falling
back to our custom cursors.
Ref D5197
|
|
When move very fast the pen using a tablet, the end of the strokes was very ugly if the sampling was enabled. The reason for that is the last point and the previous one was interpolated in distance, but not in pressure and strength.
This commit uses several processes to get better endings:
a) If the pressure at the end of the stroke is very low, this part of the stroke is removed. This is a common issue with some tablet that send events with very low pressure when the pen is raised from drawing surface.
b) The interpolated points created by sampling are interpolated in strength and pressure to get a smooth transition.
c) Active smooth also uses the strength. Before only pressure was used.
|
|
|
|
This option allows to apply a simplify when the stroke is completed. The simplify use the Adaptive option to keep the shape.
|
|
|
|
+ Simplify code, move into own function and run once rather than on every point
+ Improved snapping when a stroke is between increments
+ Added ISO grid option for lines specified by Angle under guide settings
+ Radial snapping mode uses Angle as an offset
Differential Revision: https://developer.blender.org/D5668
|
|
When a material slot is empty, the default material is used.
The default color used is Gray to get a good contrast in dense scenes with dark and white background.
Reviewers: brecht, dfelinto, mendio, pepeland
Differential Revision: https://developer.blender.org/D5625
|
|
Actually, the value for this parameter must be in the order of 0.00001 and this makes the UI uncomfortable.
Now, the value is divided by 1000 internally and the UI values are more logic.
Reviewers: mendio, pepeland
Differential Revision: https://developer.blender.org/D5528
|
|
Now the pressure is interpolated in active smooth and not only position as before.
|
|
Actually, the selection mode is not visible in Sculpt mode when mask is enabled, but still is used.
Also, the mode is shared between Edit mode and Sculpt mode and for meshes the selector is by mode.
This commit splits the select mode in different properties and show the selector in Sculpt mode to define the Select mode. Also, the Select Mask button has been removed and now the Select Mode buttons work equal to Meshes where the select buttons are the mask enable too.
Fixed some old code not valid detected during these changes.
Differential Revision: https://developer.blender.org/D5500
|
|
Avoids calculating the visible part of a region whenever
on-screen overlays are drawn.
|
|
There is a segment fault because the operator was in modal but the Ctrl+Z breaks the custom data. Now, the Ctrl+Z ends the operator.
|
|
|
|
This change ensures that operators which needs access to evaluated data
first makes sure there is a dependency graph.
Other accesses to the dependency graph made it more explicit about
whether they just need a valid dependency graph pointer or whether they
expect the graph to be already evaluated.
This replaces OPTYPE_USE_EVAL_DATA which is now removed.
Some general rules about usage of accessors:
- Drawing is expected to happen from a fully evaluated dependency graph.
There is now a function to access it, which will in the future control
that dependency graph is actually evaluated.
This check is not yet done because there are some things to be taken
care about first: for example, post-update hooks might leave scene in
a state where something is still tagged for update.
- All operators which needs to access evaluated state must use
CTX_data_ensure_evaluated_depsgraph().
This function replaces OPTYPE_USE_EVAL_DATA.
The call is generally to be done in the very beginning of the
operator, prior other logic (unless this is some comprehensive
operator which might or might not need access to an evaluated state).
This call is never to be used from a loop.
If some utility function requires evaluated state of dependency graph
the graph is to be passed as an explicit argument. This way it is
clear that no evaluation happens in a loop or something like this.
- All cases which needs to know dependency graph pointer, but which
doesn't want to actually evaluate it can use old-style function
CTX_data_depsgraph_pointer(), assuming that underlying code will
ensure dependency graph is evaluated prior to accessing it.
- The new functions are replacing OPTYPE_USE_EVAL_DATA, so now it is
explicit and local about where dependency graph is being ensured.
This commit also contains some fixes of wrong usage of evaluation
functions on original objects. Ideally should be split out, but in
reality with all the APIs being renamed is quite tricky.
Fixes T67454: Blender crash on rapid undo and select
Speculation here is that sometimes undo and selection operators are
sometimes handled in the same event loop iteration, which leaves
non-evaluated dependency graph.
Fixes T67973: Crash on Fix Deforms operator
Fixes T67902: Crash when undo a loop cut
Reviewers: brecht
Reviewed By: brecht
Subscribers: lichtwerk
Maniphest Tasks: T67454
Differential Revision: https://developer.blender.org/D5343
|
|
There was a fixed limit to the number of points available in a buffer stroke.
Now, the array is expanded as needed using a predefined number of points for each expansion, instead to add one by one. This is done to reduce the number of times the memory allocation is required.
As part of the fix, some variables have been renamed to reflect better their use.
|