Commit Graph

10 Commits

Author SHA1 Message Date
Antonio Vazquez 256b59b76f Fix T80191: GPencil - Improve Mesh conversion
There were some problems when converted several objects at the same time, especially with the material conversion. The problems were more visible when bake an animation with several objects at the same time.

* Now the layer name include the object name.
* Reorganize how the materials are generated including object name.
* Fix color not converted to sRGB.
* Avoid triangles when generate the stroke. This fix a draw manager issue and also add more geometry to use later.
* Code cleanup.
2020-09-10 20:12:42 +02:00
Sebastian Parborg 2115232a16 Cleanup: Clang-Tidy readability-inconsistent-declaration-parameter-name fix
No functional changes
2020-09-04 21:04:16 +02:00
Jacques Lucke 91694b9b58 Code Style: use "#pragma once" in source directory
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
2020-08-07 09:50:34 +02:00
Campbell Barton 70d7805fa9 Cleanup: pass const matrices
Also order return matrices last.
2020-08-02 18:02:20 +10:00
Antonio Vazquez 47b6c33258 GPencil: New BKE function for setting random vertex color
This function is very handy for debug purposes.
2020-07-22 11:16:45 +02:00
Sebastian Parborg 0bfec04cd5 Fix T72621: Transform object origin support for grease-pencil
Added support for transforming only origins with greasepencil objects.

The new functions is based on BKE_gpencil_transform. That is why there is FIXME statements in there.

Reviewed By: Campbell, Antonio

Differential Revision: http://developer.blender.org/D8303
2020-07-21 12:13:03 +02:00
Antonio Vazquez ae4098e234 GPencil: Fix unreported error baking mesh animation
When the mesh is linked, the materials can not be available or be the same assigned to mesh. Now, if the mesh is linked, a simple two materials conversion is used.

To get the full list of materials, the mesh must not be linked.

Also checked some indexes to be sure never get a wrong value and that materials are not created again and again.
2020-07-15 17:26:27 +02:00
Antonio Vazquez bc7a4b126a GPencil: Convert and Bake mesh animation to grease pencil strokes
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
2020-06-16 15:28:46 +02:00
Antonio Vazquez a5ffc6309e GPencil: Split Curve geometry functions to new file
This prepare the code for future curve editors
2020-05-06 18:14:05 +02:00
Antonio Vazquez 6e39445f80 GPencil: Cleanup - Split BKE_gpencil.h geometry functions into BKE_gpencil_geom.h
This split prepare the code for future geometry functions.
2020-03-19 11:38:22 +01:00