Falk David filedescriptor
  • Grease Pencil developer at Blender.

  • Joined on 2017-01-04
Falk David merged pull request blender/blender#127612 2024-09-16 14:12:50 +02:00
GPv3: Layers menu in topbar
Falk David approved blender/blender#127612 2024-09-16 14:12:04 +02:00
GPv3: Layers menu in topbar

Seems to work well, thank you!

Falk David commented on pull request blender/blender#126581 2024-09-16 12:52:29 +02:00
GPv3: Add Bake Grease Pencil Animation operator

This should maybe use fcurves_all() nowadays? Will let the animation team comment on this.

Falk David suggested changes for blender/blender#126581 2024-09-16 12:46:08 +02:00
GPv3: Add Bake Grease Pencil Animation operator

Nice! Code overall looks good, just commented about a few cleanup things.

Falk David commented on pull request blender/blender#126581 2024-09-16 12:46:07 +02:00
GPv3: Add Bake Grease Pencil Animation operator

I'd probably put this further down below ED_operatortypes_grease_pencil_trace.

Falk David commented on pull request blender/blender#126581 2024-09-16 12:46:06 +02:00
GPv3: Add Bake Grease Pencil Animation operator

Missing newline above.

Falk David commented on pull request blender/blender#126581 2024-09-16 12:46:04 +02:00
GPv3: Add Bake Grease Pencil Animation operator

Nowadays, I'd probably write this like so:

Falk David commented on pull request blender/blender#126581 2024-09-16 12:46:02 +02:00
GPv3: Add Bake Grease Pencil Animation operator

Same as above.

Falk David commented on pull request blender/blender#126581 2024-09-16 12:46:01 +02:00
GPv3: Add Bake Grease Pencil Animation operator

Maybe instead of key we could just use: if ((frame_start - frame) % step != 0 && frame != frame_end) { ?

Falk David commented on pull request blender/blender#126581 2024-09-16 12:46:00 +02:00
GPv3: Add Bake Grease Pencil Animation operator

This should use Drawing &target_drawing = *target.insert_frame(...). I'm trying to refactor existing code and make .add_frame a private API (because it causes side-effects that the caller needs to deal with).

Falk David commented on pull request blender/blender#126581 2024-09-16 12:45:59 +02:00
GPv3: Add Bake Grease Pencil Animation operator

Return the Set<int> by value like above.

Falk David commented on pull request blender/blender#126581 2024-09-16 12:45:58 +02:00
GPv3: Add Bake Grease Pencil Animation operator

Use PropertyRNA *prop_frame_start = ...;

Falk David commented on pull request blender/blender#126581 2024-09-16 12:45:57 +02:00
GPv3: Add Bake Grease Pencil Animation operator

I think it might be nice to use fmt here (to avoid the memory managment).

Falk David commented on pull request blender/blender#126581 2024-09-16 12:45:55 +02:00
GPv3: Add Bake Grease Pencil Animation operator

Vector<Object *> bake_targets = get_bake_targets(*C, depsgraph, scene);

Falk David commented on pull request blender/blender#126581 2024-09-16 12:45:54 +02:00
GPv3: Add Bake Grease Pencil Animation operator

Use std::optional<Set<int>> keyframes and keyframes = get_selected_object_keyframes(...) to write to the optional.

Falk David commented on pull request blender/blender#126581 2024-09-16 12:45:53 +02:00
GPv3: Add Bake Grease Pencil Animation operator

Note: frame_at will return a GreasePencilFrame that is visible at scene.r.cfra. So for example if there is a keyframe at frame 10 and a keyframe at frame 20, the frame starting at frame 10 would also be returned if you query e.g. frame 15.

Falk David commented on pull request blender/blender#126581 2024-09-16 12:45:53 +02:00
GPv3: Add Bake Grease Pencil Animation operator

It's probably best to move this check outside the loop to avoid the branching for every point:

Falk David commented on pull request blender/blender#126581 2024-09-16 12:45:51 +02:00
GPv3: Add Bake Grease Pencil Animation operator

This should use multi-threading with a high grain size:

Falk David commented on pull request blender/blender#126581 2024-09-16 12:45:50 +02:00
GPv3: Add Bake Grease Pencil Animation operator

Instead of passing the vector as a mutable reference, just create it within the function and return the vector by value.