Initial Grease Pencil 3.0 stage #106848

Merged
Falk David merged 224 commits from filedescriptor/blender:grease-pencil-v3 into main 2023-05-30 11:14:22 +02:00
2 changed files with 9 additions and 13 deletions
Showing only changes of commit 79d27606a7 - Show all commits

View File

@ -403,13 +403,6 @@ class Layer : public TreeNode, ::GreasePencilLayer {
return sorted_keys_cache_.data().as_span();
}
void load_from_storage(GreasePencilLayer &node)
{
for (int i = 0; i < node.frames_storage.size; i++) {
this->frames_.add(node.frames_storage.keys[i], node.frames_storage.values[i]);
}
}
/**
* Return the index of the drawing at frame \a frame or -1 if there is no drawing.
*/

View File

@ -42,7 +42,7 @@ struct BlendWriter;
typedef enum GreasePencilDrawingType {
GREASE_PENCIL_DRAWING = 0,
GREASE_PENCIL_DRAWING_REFERENCE = 1,
} GreasePencilLayerType;
} GreasePencilDrawingType;
typedef struct GreasePencilDrawingOrReference {
/**
@ -67,19 +67,22 @@ typedef struct GreasePencilDrawing {
* The stroke data for this drawing.
*/
CurvesGeometry geometry;
filedescriptor marked this conversation as resolved Outdated

Move below runtime data pointer.

Move below runtime data pointer.
/**
* Runtime data on the drawing.
*/
GreasePencilDrawingRuntimeHandle *runtime;
#ifdef __cplusplus
/**
* The triangles for all the fills in the geometry.
*/
blender::Span<blender::uint3> triangles() const;
void tag_positions_changed();
bool has_stroke_buffer();
blender::Span<blender::bke::StrokePoint> stroke_buffer();
#endif
/**
* Runtime data on the drawing.
* A buffer for a single stroke while drawing.
*/
GreasePencilDrawingRuntimeHandle *runtime;
blender::Span<blender::bke::StrokePoint> stroke_buffer();
bool has_stroke_buffer();
#endif

I wonder if this user count could be runtime data? Or if not, maybe it's worth mentioning why it isn't in a comment.

I wonder if this user count could be runtime data? Or if not, maybe it's worth mentioning why it isn't in a comment.

I thought about this, but I don't think it can be runtime data. Since there will be keyframe instances, we need to make the user count is saved.

I thought about this, but I don't think it can be runtime data. Since there will be keyframe instances, we need to make the user count is saved.

The connection between keyframe instances and saving the user count isn't super clear to me. Maybe a comment about what the user count is used for here would help?

The connection between keyframe instances and saving the user count isn't super clear to me. Maybe a comment about what the user count is used for here would help?

Maybe it's still better to have this as runtime data. If there is ever a bug where this doesn't get counted correctly, at least a file read could fix it. It should be possible to read this as zero, and increment it for every user?

This is easy to change afterwards though.

Maybe it's still better to have this as runtime data. If there is ever a bug where this doesn't get counted correctly, at least a file read could fix it. It should be possible to read this as zero, and increment it for every user? This is easy to change afterwards though.

I see, re-creating the user count when reading could work indeed.

I see, re-creating the user count when reading could work indeed.
} GreasePencilDrawing;
typedef struct GreasePencilDrawingReference {