GPencil: "Add Suzanne" migration to new structure #108503
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Blocks
#108469 GPv3: Add 'Suzanne' option in Object > Add menu
blender/blender
Reference: blender/blender#108503
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ChengduLittleA/blender:gp3-monkey"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This patch moves the "Add Suzanne" option to the new data structure.
Some comments about the static data layout and how the drawings are created.
@ -285,2 +285,4 @@
}
extern std::array<float3, 270> monkey_data0_pos;
Instead of 28 x 3 arrays, there should only be 2 x 3 arrays. For the "Fills" and for the "Lines" you just need one array per attribute. Then there should be a curve offsets array that has all the offsets. E.g. {0, 270, 270 + 33, 270 + 33 + 18, etc. }.
@ -287,0 +420,4 @@
object.actcol = color_Black;
Layer &layer_lines = grease_pencil.add_layer(grease_pencil.root_group.wrap(), "Lines");
Layer &layer_color = grease_pencil.add_layer(grease_pencil.root_group.wrap(), "Color");
This layer should be called "Fills".
layer_color
->layer_fills
@ -287,0 +423,4 @@
Layer &layer_color = grease_pencil.add_layer(grease_pencil.root_group.wrap(), "Color");
grease_pencil.active_layer = &layer_lines;
grease_pencil.add_empty_drawings(28);
I think there is a misconception of what a drawing is. Think of a drawing like a
bGPDFrame
. We don't need 28 keyframes, we just need 2. One for the "Fills" layer and one for the "Lines" layer.All of the fills go into the first drawing and all of the lines go into the second drawing.
Getting closer!
@ -287,0 +296,4 @@
static const ColorTemplate gp_monkey_pct_black = {
N_("Black"),
{0.0f, 0.0f, 0.0f, 1.0f},
{0.0f, 0.0f, 0.0f, 0.0f},
I would add
false,
here for clarity.@ -287,0 +392,4 @@
grease_pencil.add_empty_drawings(2);
GreasePencilDrawing *drawing = reinterpret_cast<GreasePencilDrawing *>(
drawing
->drawing_fills
@ -287,0 +402,4 @@
monkey_fill_influence,
matrix);
drawing = reinterpret_cast<GreasePencilDrawing *>(
drawing
->drawing_lines
@ -287,0 +414,4 @@
GreasePencilFrame frame_lines{0, 0, BEZT_KEYTYPE_KEYFRAME};
GreasePencilFrame frame_color{1, 0, BEZT_KEYTYPE_KEYFRAME};
frame_color
->frame_fills
And
frame_lines
needs to index thedrawing_lines
which is1
.@ -24,6 +24,7 @@ namespace blender::ed::greasepencil {
void create_blank(Main &bmain, Object &object, int frame_numer);
void create_stroke(Main &bmain, Object &object, float4x4 matrix, int frame_numer);
void create_suzanne(Main &bmain, Object &object, float4x4 matrix, const int frame_numer);
Typo from me 😅
frame_number
@ -0,0 +1,664 @@
/* SPDX-License-Identifier: GPL-2.0-or-later
No need for a new file, this can all be in
grease_pencil_add.cc
show_stroke
inColorTemplate
. 24ddc1f25eSmall formatting tweak, and that's it!
@ -285,0 +1049,4 @@
GreasePencilDrawing *drawing_lines = reinterpret_cast<GreasePencilDrawing *>(
grease_pencil.drawings_for_write()[1]);
drawing_lines->geometry.wrap() = create_drawing_data(monkey_line_pos,
monkey_line_rad,
Looks like the formatting for this file didn't work.