Age | Commit message (Collapse) | Author |
|
Select strokes or points randomly (similar to meshes).
Reviewed By: pepeland
Differential Revision: https://developer.blender.org/D12157
|
|
|
|
|
|
Sometimes is required to reset the thickness or the opacity of the strokes. Actually this was done using a modifier, but this operators solves this.
Reviewed By: mendio, filedescriptor
Maniphest Tasks: T87427
Differential Revision: https://developer.blender.org/D11453
|
|
Move reproject_type into an extern, to avoid declaring multiple times.
|
|
This operator is a common request of animators to convert the transformation (inluding modifiers) of one grease pencil object, into a new object, generating strokes.
Reviewed By: pepeland
Maniphest Tasks: T87424
Differential Revision: https://developer.blender.org/D11014
|
|
Now the operators work like other areas of Blender using the list of selected objects.
Also, the name has been changed to:
```Layers:
- Copy Layer to Selected
- Copy All Layers to Selected
Materials:
- Copy Material to Selected
- Copy All Materials to Selected```
Reviewed By: mendio, pablovazquez, pepeland
Differential Revision: https://developer.blender.org/D11216
|
|
Now it's possible to append materials of one grease pencil object into another one. The operator allows active material or all materials.
Also, the Layer Copy To Object has been renamed to Layer Append to Object to keep consistency and now allows to append all layers at once.
|
|
Now the list of masks can be ordered as is done in Layers.
This can be used to organize list and in the future refquired for new masking options.
|
|
Following with the changes included to interpolate strokes of different number of points, a full review has been done in the interpolation tools.
* Interpolate now is a tool and not an operator. It was not logic to have this tool as a button.
* Interpolate tool parameters have been moved to topbar.
* Interpolate popover has been removed from topbar and interpolate `Sequence` operator has been moved to grease pencil menu.
* Interpolate Sequence now include a Redo panel.
* Interpolate tool now allows to select the strokes by pairs. This allows to interpolate any stroke with any stroke and not as before that it was only possible by drawing order. If no stroke is selected, the interpolation is done as before.
* Now is possible interpolate again if a previous keyframe exist. Before, it was impossible to interpolate two times in same frame and this made impossible to do the interpolation by groups of frames.
* New automatic option to `Flip strokes` if the stroke and end are not in the right position. Also the flip can be set manually for corner cases.
* Cleanup of menus related to interpolate.
* Fixed some bugs and removed parameters from scene because now all are tool or operator contained.
* Some code cleanup and function renames.
This commit also includes the some codebase to future implementation of the concept `Vertex Active` that now does not exist in grease pencil.
|
|
|
|
|
|
ED_gpencil_stroke_material_editable
|
|
When using grease pencil for drawing Storyboards, it's very common to require a transform of the layers. This transform can be done using the offset modifier, but in some cases, the scene requires a lot of modifiers and makes the file hard to work.
This new feature adds a transforms Location, Rotation and Scale at Layer level, and allows to transform the layer without using a modifier, keeping the scene more clean.
{F9480695}
This feature was suggested by @pepeland after receiving feedback from several artists.
Also, done some code cleanup and rename some functions to get a better naming.
Maniphest Tasks: T83660
Differential Revision: https://developer.blender.org/D9761
|
|
This operators reset the vertex color information of the strokes.
If nothing is selected, all strokes are reset. If any is selected, only selected strokes are reset.
Also added a new menu Paint in Vertex Color mode.
Differential Revision: https://developer.blender.org/D9647
|
|
This option joins any stroke with an end near the actual stroke. Now it is not limited to the last stroke, any stroke in the same layer for the actual frame can be joined. The join can join two strokes drawing a third stroke.
If the end and the start of the result stroke are very small, the stroke is changed to be cyclic automatically.
There is a limit distance to join the stroke, if the distance is greater than this value, the strokes are not joined. Actually, a constant, threshold distance is used, but we could expose
as a parameter in the UI in the future.
The tool can be used with freehand drawing or with primitives.
Note: Great part of the patch is just a refactor of the old code to make it accessible and to keep code organized.
Reviewed By: mendio
Maniphest Tasks: T82377
Differential Revision: https://developer.blender.org/D9440
|
|
Differential Revision: https://developer.blender.org/D8660
This patch is the result of the GSoC 2020 "Editing Grease Pencil Strokes
Using Curves" project. It adds a submode to greasepencil edit mode that
allows for the transformation of greasepencil strokes using bezier
curves. More information about the project can be found
here: https://wiki.blender.org/wiki/User:Filedescriptor/GSoC_2020.
|
|
This patch adds a new operator to convert a black and white image into
grease pencil strokes.
If the image is not B/W, an internal conversion is done.
This is the first operator using Potrace, but we expect to add more features in next Blender versions.
Reviewed By: HooglyBoogly
Maniphest Tasks: T79877
Differential Revision: https://developer.blender.org/D8951
|
|
|
|
Now the operators are split to define different default values. This is also required for the future Bezier primitive tools.
This allows to show in the Topbar the number of subdivisions. Before this value was totally hidden and it was number of Edges. The wheelmouse can be used to override the value while running, but does not change the default value.
{F8766270}
All operators share same code.
Also, fixed some bad practices done with Toolbar in python.
Reviewed By: mendio, pepeland
Differential Revision: https://developer.blender.org/D8506
|
|
|
|
This replaces header include guards with `#pragma once`.
A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`),
because they are used in other places.
This patch has been generated by P1561 followed by `make format`.
Differential Revision: https://developer.blender.org/D8466
|
|
This operator cleanup any frame that is equal to the previous one. This is very handy when convert a mesh animation to Gpencil and the mesh is static for several frames.
Differential Revision: https://developer.blender.org/D8149
|
|
|
|
This patch adds two options:
- Convert a mesh to grease pencil strokes.
- Bake the mesh animation into grease pencil strokes.
Both are related and must be included in the same patch.
Related to tasks: T77629 and T77630
Notice: The conversion is done for mesh edges and it's not considering any visibility clipping. All edges are exported, no matters if it's visible or not.
Example of Convert a Mesh to Grease Pencil strokes:
{F8606028}
This conversion was inspired by the technique used by @luamono in this tweet: https://twitter.com/luamono/status/1239983662176841730
Example of Bake Animation (the video is a little outdate, but the basic functionality is the same, only small changes in UI):
{F8606032}
Reviewed By: mendio, pepeland
Maniphest Tasks: T77629, T77630
Differential Revision: https://developer.blender.org/D7983
|
|
|
|
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
|
|
Now it's possible to select the material in context menu and new menu to select material.
The patch and workflow has been tested in greasepencil-object branch.
* New Material selector in Draw mode Context menu:
{F8499259}
* Pressing `U`key in Draw mode display material menu.
{F8503224}
Reviewed By: mendio, pepeland
Differential Revision: https://developer.blender.org/D7554
|
|
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.
|
|
|
|
Contributed by luzpaz.
Differential Revision: https://developer.blender.org/D7133
|
|
The color was used in old version when palettes were used, but now all are materials
|
|
|
|
The old name was related to the old palettes.
|
|
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.
|
|
This allows to have annotation panels and grease pencil object panel at the same time.
Differential Revision: https://developer.blender.org/D6467
|
|
T70927
Maniphest Tasks: T70927
Differential Revision: https://developer.blender.org/D6097
|
|
The selection was not working because the evaluated frame was only working for active frame, so when the evaluation was changed to use eval data instead of original data, the data was not available and the loop did not use it.
Related to T70116
|
|
selected stroke material
The operator set as active object material the material used in the selected stroke.
Access to the operator were added in the stroke menu and context stroke menu.
Reviewers: antoniov, pepeland
Tags: #bf_blender, #grease_pencil
Differential Revision: https://developer.blender.org/D5692
|
|
Now the selection is using the position after evaluating the modifiers and makes possible to select a stroke point that has been moved from the original location.
Related to T66294
|
|
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
|
|
This mode simplify the stroke doing a resampling of the points and generate new geometry at the distance defined.
Sample function developed by @NicksBest
New Resample Stroke operator
This operator recreates the stroke geometry with a predefined length between points.
The operator uses the same code used in Simplify modifier.
Reviewers: @mendio
|
|
Merge points when the distance is less than a predefined value.
The method to interpolate the position created a wrong merge. Now, always the secondary point is merged with the first one (merge at first), except the last point.
|
|
If the macro was used in a loop where the stroke was removed, the macro failed.
|
|
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.
|
|
GPencil: Cleanup inverse mat code
This calculation is done in the macro, so don't need do it again in loop.
|
|
|
|
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
|