Commit Graph

3 Commits

Author SHA1 Message Date
YimingWu
9d509de52a Grease Pencil: Convert from mesh to Grease Pencil
Convert mesh objects to grease pencil, optionally preserve mesh faces as
filled shapes, and convert crease edges into strokes. Following options
are available:

- Whether to convert faces to filled strokes.
- Stroke thickness.
- Stroke offset (Using normal direction to lift strokes out of mesh
  surfaces).

Note that "Crease Angle" option from legacy grease pencil is not ported
to this implementation. This option is deemed more suitable for using
geometry nodes to achieve.

Resolves #126480

Pull Request: https://projects.blender.org/blender/blender/pulls/131854
2025-01-14 08:28:52 +01:00
YimingWu
6191bc4f22 Object: Conversion of Font/Legacy curves to Curves and Grease Pencil
This patch implements Font to Curves, Legacy curves to Grease Pencil and
Font to Grease Pencil conversions.

Note that Font to Grease Pencil is done by converting Font to Curves
then converting Curves to Grease Pencil. Currently we do not have
direct conversion APIs.

Part of #131595 and #130518

Pull Request: https://projects.blender.org/blender/blender/pulls/131612
2024-12-18 15:38:55 +01:00
YimingWu
38fa0e71ee Tests: Add object conversion tests
Adding object conversion tests to verify the refactored object type
conversion code works as intended.

The object conversion operator `exec()` function is restructured by
PR #130668 to clean up code path for better readability, since it's a
relatively big change, this test is put up to verify that:

- For supported object type pairs, converted objects would have the
  expected target object type.
- For unsupported/unimplemented type pairs, the test expect the
  converted object to have the same type as the source object.
- Verify that the code behaviour stays exactly the same as prior
  to the change in #130668, including code logic that are later subject
  to change and redesign, in which case this test file/script would need
  to be updated accrodingly.

This test added such files:

- `tests/data/modelling/object_conversion.blend`: Sets up differnt types
  of input objects and their expected converted object combinations.
- `tests/python/object_conversion.py`: Does mesh equal checks for
  objects that are converted to mesh against expected objects in the
  blend file, and does object type checks for other target types.

Note:

This test currently does not do topology-level equal check except for
when target object type is `MESH`. Equal check hasn't been implemented
for other object types yet, but ideally in the future we should use
topology check on top of type check for other object types as well.

See https://projects.blender.org/blender/blender/pulls/130668

Pull Request: https://projects.blender.org/blender/blender/pulls/130738
2024-12-02 16:30:41 +01:00