Age | Commit message (Collapse) | Author |
|
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
|
|
While it might be handy to have type-less functionality which is
similar to how C++ math is implemented it can not be easily achieved
with just preprocessor in a way which does not have side-effects on
wrong usage.
There macros where often used on a non-trivial expression, and there
was at least one usage where it was causing an actual side effect/bug
on Windows (see change around square_f(sh[index++]) in studiolight.c).
For such cases it is handy to have a function which is guaranteed to
have zero side-effects. The motivation behind actually removing the
macros is that there is already a way to do similar calculation. Also,
not having such macros is a way to guarantee that its usage is not
changed in a way which have side-effects and that it's not used as an
inspiration for cases where it should not be used.
Differential Revision: https://developer.blender.org/D7051
|
|
- 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.
|
|
Note that `BKE_library.h`/`library.c` were renamed to
`BKE_lib_id.h`/`lib_id.c` to avoid having a too generic name here.
Part of T72604.
|
|
This is not 100% a bug but a design change. The old method used the object origin as pivot point for Scale a nd Rotation, so when you moved the stroke in edit mode, the whole array ittems where offset because the pivot point distance changed.
Now, before applying scale and rotation, the stroke is moved to object origin to keep the offset when scale or rotate, so these transformations are done in stroke local space.
|
|
Old Name New Name
========= =========
init_def_material BKE_materials_init
BKE_material_gpencil_default_free BKE_materials_exit
test_object_materials BKE_object_materials_test
test_all_objects_materials BKE_objects_materials_test_all
give_matarar BKE_object_material_array
give_totcolp BKE_object_material_num
give_current_material_p BKE_object_material_get_p
give_current_material BKE_object_material_get
assign_material BKE_object_material_assign
assign_matarar BKE_object_material_array_assign
give_matarar_id BKE_id_material_array
give_totcolp_id BKE_id_material_num
assign_material_id BKE_id_material_assign
clear_matcopybuf BKE_material_copybuf_clear
free_matcopybuf BKE_material_copybuf_free
copy_matcopybuf BKE_material_copybuf_copy
paste_matcopybuf BKE_material_copybuf_paste
BKE_material_init_gpencil_settings BKE_gpencil_material_attr_init
BKE_material_add_gpencil BKE_gpencil_material_add
BKE_material_gpencil_get BKE_gpencil_material
BKE_material_gpencil_default_get BKE_gpencil_material_default
BKE_material_gpencil_settings_get BKE_gpencil_material_settings
|
|
This had already been removed for all source files,
recent patches re-introduced them.
|
|
A collection of smaller changes that are required in the /blender/source files. A lot of them are also due to variable renaming.
Reviewed By: sergey
Maniphest Tasks: T59995
Differential Revision: https://developer.blender.org/D3855
|
|
When the frame was zero, the frame number was clamped by error to 1.
|
|
|
|
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
|
|
Before, the modifiers were evaluated in Draw Engine and this required to calculate a factor to increase the VBO size.
Now, the modifiers are evaluated in Depsgraph and the Draw Engine receives the evaluated stroke with the final number of vertices. As the number of vertices is the final value already, if Draw Manager increases the number with the modifiers only increases the memory with empty space because never would be used. This commit removes this double calculation, reducing the memory usage and removes a loop to calculate the size by modifier too.
Also, the function getDuplicationFactor() has been removed because is not required anymore.
|
|
|
|
|
|
|
|
It makes sense when adding points to a straight line, e.g. for creating thickness variation in later modifiers.
|
|
When the result isn't used, prefer post increment/decrement
(already used nearly everywhere in Blender).
|
|
This new option applies the opacity using the strength of the stroke instead to use the alpha channel of the material.
Tested in greasepencil-object branch
{F7712796}
The vertex group filter has been removed because this filter is not logic in Material mode and must be valid only in Strength mode.
{F7713147}
Reviewers: pepeland, mendio
Reviewed By: mendio
Differential Revision: https://developer.blender.org/D5650
|
|
This bug was introduced when adding the support for default materials.
|
|
|
|
|
|
|
|
This is a continuation of rB39f005eae8eed8b939579aff8c9a05a4f50e5e38
Now all the fields where we check for object type in RNA (like
rna_Curve_object_poll) will have a safe guard for when this isn't the
case. For example when loading files that has missing object libraries
and all missing objects are replaced with empties (placeholders).
Reviewed By: Brecht
Differential Revision: http://developer.blender.org/D5425
|
|
This commit adds a new filter by material using the name and not only the index.
Reviewers: antoniov, pepeland
Differential Revision: https://developer.blender.org/D5544
|
|
Prior to this commit: If the Grease Pencil Thickness modifier is set to Normalize and a Vertex Group is selected, the thickness of all strokes are effected when changing the Thickness parameter. Points on strokes are only normalised (= pressure set to 1.0) if they are part of the Vertex Group; the strokes themselves may still change thickness.
With this patch: If Normalize is selected with a Vertex Group, Blender now pre-checks each stroke to determine whether it has vertices within or outside the Vertex Group. If all the points on the stroke belong to the Vertex Group, it normalises the whole stroke to a uniform thickness. If some or none of the points of the stroke belong to the Vertex Group, the stroke is now left as is.
Reviewed By: @antoniov
Differential Revision: https://developer.blender.org/D5483 with minor edit.
|
|
Before, the length variable was reused for Sample and Merge Simplify. Now, the Merge has its own distance property and variable in the modifier struct.
|
|
This option uses the same logic of the merge by distance but as an option of modifier to allow dynamic merge.
This option will be very useful for LANPR generated strokes.
|
|
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
|
|
|
|
This commit adds the frame to deformStroke Callback as a preparation for new modifiers that will need this variable.
Actually, the existing modifiers are not using the frame.
|
|
There were several problems in the old random calculation:
* Different result in the viewport and render.
* Noise "pop" in some frames.
* Random number was calculated every time the file was opened, so get different results.
Now, instead to calculate the random numbers when n number of frames changed, the random values are calculated using a unique seed by stroke.
Also, a new Seed parameter has been added and this adds more control in the noise generated. This value can be animated and get more variations.
Differential Revision: http://developer.blender.org/D5393
|
|
The value of the step was calculated using a variable that was removed when the render frame change.
Now, the step is calculated using the modulus of the current frame and recalculate noise only if the remainder that results from performing integer division is equal to 0.
To calculate current frame, the first used frame is calculated to adjust real frame range.
This approach is more stable in viewport and render.
|
|
When apply the modifier a new material is created, but it was assigned wrongly. The problem was the index was base 0 already, so subtract 1, got a wrong value.
|
|
|
|
areas of Blender
The value of the Hue must be between 0 and 1, but the value was between 0 and 2.
|
|
|
|
Still pending when the original object is rotated or scaled.
|
|
Prepare for enabling ReflowComments.
|
|
|
|
|
|
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
|
|
No functional change, this adds LIB definition and args to cmake files.
Without this it's difficult to migrate away from 'BLENDER_SORTED_LIBS'
since there are many platforms/configurations that could break when
changing linking order.
Manually add and enable WITHOUT_SORTED_LIBS to try building
without sorted libs (currently fails since all variables are empty).
This check will eventually be removed.
See T46725.
|
|
- The ambiguous term 'handle' was used where 'ensure'
is typically used (get or add when missing).
- Rename `current` to `active`, all `current` functions which were
also ensuring.
- Clarify what is being operated on, using `BKE_gpencil_object_*` for
objects, `BKE_gpencil_brush_*` for brushes.
|
|
As the random seed was calculated in the copy data, the render could be a little different. Now, the data is saved in the original data.
|
|
@sergey wrote: "The reason it was failing is because md points to an original armature, which doesn't have runtime data needed for deformation. That data is to come from evaluated armature."
Thanks to @sergey for his help.
|
|
|
|
Mostly functions wrapping args, not confirming to our style guide.
|
|
These modifiers were not included in previous commit.
|
|
This change displays the stroke in the deformed position, but the edition is done in rest position.
This is no the final solution, but at least we have some visual feedback in edit mode.
The real solution is to create a full system to manage derived strokes in Edit mode, but this needs a lot of work and we haven't resources now to do it.
|
|
We already have different storages for cddata of verts, edges etc.,
'simply' do the same for the mask flags we use all around Blender code
to request some data, or limit some operation to some layers, etc.
Reason we need this is that some cddata types (like Normals) are
actually shared between verts/polys/loops, and we don’t want to generate
clnors everytime we request vnors!
As a side note, this also does final fix to T59338, which was the
trigger for this patch (need to request computed loop normals for
another mesh than evaluated one).
Reviewers: brecht, campbellbarton, sergey
Differential Revision: https://developer.blender.org/D4407
|