Age | Commit message (Collapse) | Author |
|
MSVC used to warn about const mismatch for arguments passed by value.
Remove these as newer versions of MSVC no longer show this warning.
|
|
Renamed or removed parameters which no longer exist.
|
|
- Added space below non doc-string comments to make it clear
these aren't comments for the symbols directly below them.
- Use doxy sections for some headers.
- Minor improvements to doc-strings.
Ref T92709
|
|
Avoid API misuse that caused leaks in T90791 &
2788b0261cb7d33a2f6f2978ff4f55bb4987edae.
|
|
|
|
The BKE_gpencil_stroke_add_points API function worked well for
creating the primitives in the add object menu, but it expected a
specific data format that doesn't make sense in a dynamic context.
As evidence of that we can see the way source data was duplicated
in the line art file just to use this API function.
This commit solves that problem in two ways:
- Clean up the line art function (this should make it faster too).
- Move/rename the function so its intended use is more clear.
Differential Revision: https://developer.blender.org/D11909
|
|
Renamed to BKE_gpencil_visible_stroke_advanced_iter
Also created a simple version of the iterator to be used without multiframe and onion skin.
|
|
Now, the mask layers are copied and later a cleanup is done in order to verify all mask layer exist in destination object. If the layer mask does not exist, it's removed from the list.
This is related to T89234.
|
|
Better to have a function that can be reused to duplicate the settings that need to be copied.
|
|
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
|
|
- Rename:
`BKE_gpencil_object_material_get_index_name`, to
`BKE_gpencil_object_material_index_get_by_name`
Matching `BKE_gpencil_layer_get_by_name`.
- Move logic to ensure named materials into a new function:
`BKE_gpencil_object_material_ensure_by_name`
|
|
This adds the LineArt grease pencil modifier.
It takes objects or collections as input and generates various grease
pencil lines from these objects with the help of the active scene
camera. For example it can generate contour lines, intersection lines
and crease lines to name a few.
This is really useful as artists can then use 3D meshes to automatically
generate grease pencil lines for characters, enviroments or other
visualization purposes.
These lines can then be baked and edited as regular grease pencil lines.
Reviewed By: Sebastian Parborg, Antonio Vazquez, Matias Mendiola
Differential Revision: http://developer.blender.org/D8758
|
|
This makes the code more readable.
|
|
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.
|
|
This commit is a refactor of the fill tool to solve several problems we had since the first version of the tool.
Changes:
* The filling speed has been improved for each step of the process with the optimization of each algorithm/function.
* New `AutoFit` option to fill areas outside of the viewport. When enable, the total size of the frame is calculated to fit the filling area.
* New support multiframe filling. Now it is possible to fill multiple similar frames in one go.
* New `Stroke Extension` option to create temporary closing strokes. These strokes can be displayed and adjusted dynamically using wheel mouse or PageUp/Down keys.
* Parameter `Resolution` now is named `Precision` and has been moved to topbar.
* `Resolution` now has decimals and can be lower than 1 to allow quick filling in storyboarding workflows. Maximum value has been set as 5.
* Parameter `Simplify` has been moved to Advanced panel.
* Improved fill outline detection. In some cases, the outline penetrated the area to be filled with unexpected results.
* Fixes some corner case bugs with infinite loops.
As a result of this refactor, also these new functionalities has been added.
* New support for multiframe in `Draw` mode. Any drawing in active frame is duplicated to all selected frame.
* New multiframe display mode. Keyframes before or after of the active frame are displayed using onion colors. This can be disable using Onion overlay options.
|
|
Now it's possible to copy only part of the data. This will be used in future operators.
|
|
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
|
|
|
|
|
|
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.
|
|
Those were only shallow wrappers around `BKE_id_copy`, barely used (even
fully unused in some cases), and we want to get rid of those ID-specific
helpers for the common ID management tasks. Also prevents weird custom
behaviors (like `BKE_object_copy`, who was the only basic ID copy
function to reset user count of the new copy to zero).
Part of 71219.
|
|
|
|
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
|
|
|
|
This is required in other places and need to be shared.
|
|
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
|
|
The reason was the datablock is changed but it was not tagged for depsgraph refresh.
In some cases it could be possible to tag several times the same datablock, but as this is not the case all the times and the number of tags is always very small, it doesn't worth a complex code to keep a memory list of the datablocks to tag.
|
|
This was removed by error during the refactor done in 2.83.
Differential Revision: https://developer.blender.org/D7909
Reviewers: @fclem
|
|
|
|
BKE_gpencil_geom.h
This split prepare the code for future geometry functions.
|
|
`ANIM_animdata_update()` did not sort grease pencil frames. A
pre-existing comment stated this wouldn't be necessary as
`posttrans_gpd_clean()` already does this. However, this is only
applicable when the change is performed via the transform system. The
mirror operator doesn't call `posttrans_gpd_clean()`, invalidating the
assumption in the comment.
I moved the sorting code into `BKE_gpencil_layer_frames_sort()`, which
is now called from both `ANIM_animdata_update()` and
`posttrans_gpd_clean()`.
|
|
|
|
|
|
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
|
|
Instead of using anonymous booleans flags, also allows to keep the same
behavior in all cases, without needing special handling from calling
code for our beloved oddballs object proxies...
|
|
|
|
Now when change the setting the strokes are recalculated.
To do this, it was necessary to move the UV recalc to BKE module in order to share with Draw Engine. If the recalc it was done in draw engine, the factor was only calculated for evaluated version and there was a problem when draw a new sytroke.
Now, the RNA parameter recalc the original datablock instead of tag for be calculated in Draw Engine.
|
|
This patch includes a modifiers that developed for NPR rendering.
- MultiStroke modifier that generates multiple strokes around the original ones.
Differential Revision: https://developer.blender.org/D5795
|
|
|
|
This is useful to disable all layers tint in one step and it will be used for future operators.
|
|
The Dopesheet was unlocked all layers because it was using the same logic used in UI panel, but this was wrong.
|
|
When select a layer in Dopesheet, the autolock layer was not working.
Now the Dopesheet code calls the function for autolock. Also some code cleanup to move the logic to new function.
|
|
This commit adds support to convert curves to Grease Pencil strokes and create the materials too.
Also, there is a new python API. This API is required by the modified SVG import addon to create strokes( see T67065).
All curves selected in one operation are converted in the same Grease Pencil object.
|
|
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
|
|
|
|
Follow conversion already used in most places.
|
|
Before, the evaluation of modifers were done in draw manager. The reason of the old design was grease pencil was designed before depsgraph was in place.
This commit moves this logic to depsgraph to follow general design and reduce Draw Manager complexity. Also, this is required in order to use modifiers in Edit modes.
Really, there is nothing really new in the creation of derived data, only the logic has been moved to depsgraph, but the main logic is the same. In order to get a reference to the original stroke and points, a pointer is added to Runtime data as part of the evaluated data. These pointers allow to know and use the original data.
As the modifiers now are evaluated in Depsgraph, the evaluated stroke is usable in Edit modes, so now it's possible to work with the evaluated version instead to use a "ghost" of the final image over the original geometry as work today.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D5470
|
|
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.
|
|
This function will be used for new operators.
|