GPv3: Show Line Art options in object add menu #118833

Merged
Falk David merged 3 commits from ChengduLittleA/blender:llineart-menu into main 2024-02-28 16:21:01 +01:00
Member

Now Add->Grease Pencil menu will show Scene/Collection/Object line art
options.

Now Add->Grease Pencil menu will show Scene/Collection/Object line art options.
YimingWu added the
Interest
Line Art
Module
Grease Pencil
labels 2024-02-28 07:32:20 +01:00
YimingWu added 1 commit 2024-02-28 07:32:31 +01:00
ccf1f3518c GPv3: Show Line Art options in object add menu
Now Add->Grease Pencil menu will show Scene/Collection/Object line art
options.
YimingWu added this to the Grease Pencil project 2024-02-28 07:34:13 +01:00
Falk David requested changes 2024-02-28 13:56:17 +01:00
Dismissed
Falk David left a comment
Member

Added some comments

Added some comments
@ -1289,4 +1289,18 @@ void create_suzanne(Main &bmain, Object &object, const float4x4 &matrix, const i
drawing_fills.tag_topology_changed();
}
void create_blank_for_lineart(Main &bmain, Object &object, const int frame_number)
Member

Isn't this the same as create_blank ?

Isn't this the same as `create_blank` ?
Author
Member

Ah I thought it didn't create material. I'll remove this.

Ah I thought it didn't create material. I'll remove this.
ChengduLittleA marked this conversation as resolved
@ -1669,0 +1678,4 @@
const int stroke_depth_order = RNA_enum_get(op->ptr, "stroke_depth_order");
const float stroke_depth_offset = RNA_float_get(op->ptr, "stroke_depth_offset");
float radius = RNA_float_get(op->ptr, "radius");
Member

const float radius

`const float radius`
ChengduLittleA marked this conversation as resolved
@ -1669,0 +1679,4 @@
const float stroke_depth_offset = RNA_float_get(op->ptr, "stroke_depth_offset");
float radius = RNA_float_get(op->ptr, "radius");
float scale[3];
Member

const float3 scale(radius);

`const float3 scale(radius);`
ChengduLittleA marked this conversation as resolved
@ -1669,0 +1683,4 @@
copy_v3_fl(scale, radius);
float mat[4][4];
ED_object_new_primitive_matrix(C, object, loc, rot, scale, mat);
Member

Does this call even do something? The returned matrix seems to be unused.

Does this call even do something? The returned matrix seems to be unused.
Author
Member

Indeed, it doesn't seem to do anything.

Indeed, it doesn't seem to do anything.
ChengduLittleA marked this conversation as resolved
YimingWu added 1 commit 2024-02-28 14:24:07 +01:00
Falk David requested changes 2024-02-28 14:31:12 +01:00
Dismissed
Falk David left a comment
Member

Some more comments

Some more comments
@ -1669,0 +1702,4 @@
md->source_type = LINEART_SOURCE_SCENE;
}
/* Only created one layer and one material. */
STRNCPY(md->target_layer, grease_pencil->layers()[0]->name().c_str());
Member

I'd prefer if this either used grease_pencil->find_node_by_name or (maybe better) grease_pencil->get_active_layer()

I'd prefer if this either used `grease_pencil->find_node_by_name` or (maybe better) `grease_pencil->get_active_layer()`
@ -1669,0 +1703,4 @@
}
/* Only created one layer and one material. */
STRNCPY(md->target_layer, grease_pencil->layers()[0]->name().c_str());
md->target_material = grease_pencil->material_array[0];
Member

This should use BKE_object_material_get

This should use `BKE_object_material_get`
ChengduLittleA marked this conversation as resolved
@ -1669,0 +1721,4 @@
}
else {
if (stroke_depth_order == GP_DRAWMODE_3D) {
/* gpd->draw_mode = GP_DRAWMODE_3D; */
Member

I guess this needs a flag in GreasePencilFlag.
You can call it GREASE_PENCIL_STROKE_ORDER_3D.

I guess this needs a flag in `GreasePencilFlag`. You can call it `GREASE_PENCIL_STROKE_ORDER_3D`.
Author
Member

You meant that I add this flag directly into enum GreasePencilFlag ? But at the moment we don't really know if that's gonna be used.

Or we remove this?

You meant that I add this flag directly into `enum GreasePencilFlag` ? But at the moment we don't really know if that's gonna be used. Or we remove this?
Member

This will be used, since I'm rolling back to the current renderer which will use it. You can add the flag since it's needed for the PR. It will be initialized to 0.

This will be used, since I'm rolling back to the current renderer which will use it. You can add the flag since it's needed for the PR. It will be initialized to 0.
YimingWu added 1 commit 2024-02-28 14:40:26 +01:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
d42984a19c
Cleanups.
Falk David approved these changes 2024-02-28 14:50:15 +01:00
Falk David left a comment
Member

Thanks looks good.

Thanks looks good.
Member

@blender-bot build

@blender-bot build
Falk David merged commit d296c66ab1 into main 2024-02-28 16:21:01 +01:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
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
EEVEE & Viewport
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
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
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
EEVEE & Viewport
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
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
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
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#118833
No description provided.