Commit Graph

41 Commits

Author SHA1 Message Date
Antonioya
bc480c4989 GP: Rename modifier Time to Time Offset 2018-10-23 13:16:15 +02:00
Campbell Barton
5891f81f25 Cleanup: style, warning 2018-10-23 11:01:25 +11:00
Brecht Van Lommel
efa3389b83 Fix build after recent changes, filename must have right case. 2018-10-22 19:10:48 +02:00
Antonioya
e010d5e3b1 GP: New Time modifier
This modifier allows to offset the keyframe animated to get more variations in the animation when reuse the same datablock.
2018-10-22 18:30:26 +02:00
Antonioya
7e26991472 GP: Fix Thickness modifier error for strokes with few points 2018-09-29 18:07:54 +02:00
Antonioya
631ddc5acc GP: New parameters for instance modifier: Material and On Top
Now it's possible to define what material is used in the generated strokes and if the strokes are put in front of the original (default) or keep the original in front.

Before, the generated strokes have been always on top of the original because they were drawn later.
2018-09-29 16:54:16 +02:00
Sergey Sharybin
6398e6608f GPencil: Avoid tautology assignment
This is considered a warning which is usually promoted to
error in developers' environment.

Probably worth adding an assert or so, if possible?
2018-09-28 10:10:25 +02:00
Antonioya
d06d1937ef GP: Check weight data before using it 2018-09-26 13:12:49 +02:00
Antonioya
e3f3a8101a Fix T56917: GP noise modifier vertex group crash 2018-09-25 19:48:57 +02:00
Antonioya
e81f7f25ac GP: Verify weight data is correct before assigning 2018-09-19 17:26:09 +02:00
Antonioya
03bb7cd9ad GP: Fix crash when select vertex group in modifiers 2018-09-19 17:20:55 +02:00
Campbell Barton
f35e9f047a Merge branch 'master' into blender2.8 2018-09-19 12:14:36 +10:00
Campbell Barton
6abb37babc Cleanup: style 2018-09-02 16:49:45 +10:00
Antonioya
9a646b6a20 GP: New Armature modifier and tools to handle weights
This commit adds a new armature modifier for grease pencil. The deformations are done reusing the mesh deform routines.

There is also a new operator in weight paint mode to help the artist to generate weights base on armatures. This operator is required because 2D animation workflow is not equal to meshes when parent an object to armatures.

In the drawing engine has been added the option to handle the Fade object parameter used in armatures to see the strokes while move the bones.

When rename bones, all related data of grease pencil is renamed too. This not only affect new armature code, but also layers parented and hook modifiers.

Thanks @aligorith for his review and help.
2018-08-30 12:23:08 +02:00
Antonioya
0845b1c8c8 GP: Improve Subdivide and Simplify
Now the weights are managed in the operators.

The subdivide operator and modifier code have been replaced with a shared function.

Some cleanup also.
2018-08-30 11:11:47 +02:00
Antonioya
9a9b1e9884 GP: Revert replace custom function by standard API
Using custom api breaks material at object level
2018-08-28 08:18:09 +02:00
Campbell Barton
60b24f2415 Cleanup: indentation 2018-08-28 11:01:29 +10:00
Antonioya
9195b5b3b1 GP: Replace custom function by standard API
Replace BKE_gpencil_get_material_index by BKE_object_material_slot_find_index
2018-08-27 23:16:02 +02:00
Campbell Barton
34c97a1b00 Cleanup: rename 'vindex' to 'def_nr'
Name hinted 'vertex index', where it's the index of the vertex group.
2018-08-27 16:05:57 +10:00
Campbell Barton
21c75bc7c5 GP: replace custom API w/ BKE_deform API 2018-08-27 14:20:40 +10:00
Antonioya
1948681440 GP: Reduce weight paint data memory footprint
Before, the weight data array was created always, but now only is added when a weight value is assigned.

This change was suggested by algorithm, and both agreed it was good idea.
2018-08-26 16:40:06 +02:00
Campbell Barton
7eaf00bfb0 Cleanup: style 2018-08-22 10:10:12 +10:00
Antonioya
8e8d93eb86 GP: Redesign logic of drawing engine for object instance support
The initial design assumed that there was only one object for each unique name, but that was not the case when instances were created.

Now, instances are supported and speed has been greatly improved when repetitions are used.

As a result of this change, the option to create objects has been removed in the Instances modifier. This option was strange and was also against Blender's design rules, since a modifier should never create objects. The old functionality of the modifier can be achieved with instances.

Also, several memory leakage problems that were not previously detected have been eliminated, and especially in the grid and in the drawing process

Onion Skin is not supported in multi-user datablocks.  Support this, makes incompatible with instances. We need find a solution in the long term, but now it's better keep disabled and make instances work. Anyway, the new instances makes unnecessary to use muli-user datablocks.
2018-08-15 20:27:59 +02:00
Campbell Barton
eb7b450c0c Cleanup: style 2018-08-10 08:14:22 +10:00
Charlie Jolly
2e10c658f4 GP: Add option to select color affected in modifiers
Now it's possible to define if the Tint, Hue and OPacity modifier affect the stroke color, fill color or both.
2018-08-09 13:43:21 +02:00
Antonioya
f284821bf7 GP: Undo incorrect modification in previous commit 2018-08-09 13:39:35 +02:00
Antonioya
05c0992c9b GP: Fix modifiers Tint, Opacity and Hue and create materials to Opacity
Thanks to Charlie Jolly (mistajolly@gmail.com) for his patch D3586 that added create materials to opacity modifier.

I had to do some more changes to get all running.
2018-08-08 20:40:11 +02:00
Antonioya
5c4fd52612 Fix T56220: Adding Grease Object crashes if link Material is set to Object 2018-08-08 16:56:56 +02:00
Antonioya
78a6fa1a72 Cleanup: Move some duplicate code to new function 2018-08-08 13:37:56 +02:00
Campbell Barton
cb58658f41 Cleanup: style 2018-08-08 10:59:50 +10:00
Antonioya
5f71093bb6 Cleanup: Fix stupid duplication 2018-08-07 22:26:54 +02:00
Antonioya
d2f709b179 Fix memory leak in previous commit 2018-08-07 22:22:03 +02:00
Antonioya
3884b86927 Fix T56266: Second try to fix material problems 2018-08-07 22:13:23 +02:00
Antonioya
8a035612ee Fix T56266: Grease Pencil Tint and Color modifier error when apply
The material created was not right when apply the modifiers.

These errors were related to the material modification from old palette system before the merge and for any reason this code was not changed in the right way.

Also changed the "Create Colors" to "Create Materials" to keep UI names aligned.
2018-08-07 20:10:20 +02:00
Bastien Montagne
9a8541d029 Minor fix unused var compiler warning. 2018-08-05 09:19:15 +02:00
Antonioya
ccf794dfc4 GP: Fix stupid mistake in mirror modifier
The object can be NULL. This was a line used in debug that it was not removed.

Also removed an old function not used.

Thanks to Charlie Jolly for catching this error.
2018-08-04 15:59:57 +02:00
Charlie Jolly
27ffd37c15 Fix GP mirror modifier axis 2018-08-04 09:49:15 +02:00
Antonioya
7288d4d8c4 Replace wrong aasign material flag to BKE_MAT_ASSIGN_USERPREF 2018-08-03 16:37:07 +02:00
Antonioya
f945303877 Cleanup: Fix weird comparisons 2018-07-31 12:44:01 +02:00
Campbell Barton
f06884b18a Cleanup: style, duplicate includes 2018-07-31 20:11:55 +10:00
Antonioya
66da2f537a New Grease Pencil object for 2D animation
This commit merge the full development done in greasepencil-object branch and include mainly the following features.

- New grease pencil object.
- New drawing engine.
- New grease pencil modes Draw/Sculpt/Edit and Weight Paint.
- New brushes for grease pencil.
- New modifiers for grease pencil.
- New shaders FX.
- New material system (replace old palettes and colors).
- Split of annotations (old grease pencil) and new grease pencil object.
- UI adapted to blender 2.8.

You can get more info here:

https://code.blender.org/2017/12/drawing-2d-animation-in-blender-2-8/
https://code.blender.org/2018/07/grease-pencil-status-update/

This is the result of nearly two years of development and I want thanks firstly the other members of the grease pencil team: Daniel M. Lara, Matias Mendiola and Joshua Leung for their support, ideas and to keep working in the project all the time, without them this project had been impossible.

Also, I want thanks other Blender developers for their help, advices and to be there always to help me, and specially to Clément Foucault, Dalai Felinto, Pablo Vázquez and Campbell Barton.
2018-07-31 10:50:43 +02:00