GPv3: Lock material layer property #119913
No reviewers
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#119913
Loading…
Reference in New Issue
No description provided.
Delete Branch "PratikPB2123/blender:gpv3-lock-material-layer-prop"
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?
Port
lock_material
layer level property to gpv3.For this,
layer_index
is also required to choose strokes based onlock_material
property. Hence include extra argument in
editable_strokes/points
functions.GPv3: Lock material layer propertyto WIP: GPv3: Lock material layer propertyWIP: GPv3: Lock material layer propertyto GPv3: Lock material layer propertyI have some concerns with the names.
GP_LAYER_TREE_NODE_LOCK_MATERIAL
is confusing because it's a flag on the layer that seems to lock a layer. I'd name it something likeGP_LAYER_TREE_NODE_USE_LOCKED_MATERIAL
. Same for the RNA property ("use_locked_material"
). This should be documented in #114419.@ -474,1 +474,4 @@
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
prop = RNA_def_property(srna, "lock_material", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(
Seems incorrect to use
RNA_def_property_boolean_negative_sdna
forGP_LAYER_TREE_NODE_LOCK_MATERIAL
when the property is alsolock_material
Thanks for the review. Done, renamed the property/flag. Now by default this property will be off for each layer.
Did another pass on this. It would be better if the
layer
was passed as a const reference so that the functions don't need to get thelayer()
span.@ -565,3 +568,3 @@
curves_range, GrainSize(4096), memory, [&](const int64_t curve_i) {
const int material_index = materials[curve_i];
return editable_material_indices.contains(material_index);
return editable_material_indices.contains(material_index) ||
Shouldn't this use
&&
?No. We want points/strokes to be visible in edit mode for following 2 cases:
@ -632,3 +639,3 @@
points_range, GrainSize(4096), memory, [&](const int64_t point_i) {
const int material_index = materials[point_i];
return editable_material_indices.contains(material_index);
return editable_material_indices.contains(material_index) ||
Shouldn't this use
&&
?@ -204,6 +204,7 @@ Vector<DrawingInfo> retrieve_visible_drawings(const Scene &scene,
IndexMask retrieve_editable_strokes(Object &grease_pencil_object,
const bke::greasepencil::Drawing &drawing,
int layer_index,
This should be
const bke::greasepencil::Layer &layer
instead.@ -211,9 +212,10 @@ IndexMask retrieve_editable_strokes_by_material(Object &object,
IndexMaskMemory &memory);
IndexMask retrieve_editable_points(Object &object,
const bke::greasepencil::Drawing &drawing,
int layer_index,
Same as above.
@ -214,3 +216,3 @@
IndexMaskMemory &memory);
IndexMask retrieve_editable_elements(Object &object,
const bke::greasepencil::Drawing &drawing,
const MutableDrawingInfo &info,
Like above, pass the
drawing
andconst bke::greasepencil::Layer &layer
instead.@ -223,3 +225,3 @@
IndexMask retrieve_editable_and_selected_strokes(Object &grease_pencil_object,
const bke::greasepencil::Drawing &drawing,
const MutableDrawingInfo &info,
Same as above.
@ -226,3 +228,3 @@
IndexMaskMemory &memory);
IndexMask retrieve_editable_and_selected_points(Object &object,
const bke::greasepencil::Drawing &drawing,
const MutableDrawingInfo &info,
Same as above.
@ -229,3 +231,3 @@
IndexMaskMemory &memory);
IndexMask retrieve_editable_and_selected_elements(Object &object,
const bke::greasepencil::Drawing &drawing,
const MutableDrawingInfo &info,
Same as above.
Hi, thanks for the review.
If we're passing layer instead of index, we still require layer span because we can't obtain the current layer without
layer_index
andlayer span
.Only difference would be: adding extra lines of code to get current layer each time before calling
retrieve_editable_strokes/points
Hi, not sure if you saw previous comment about passing
layer_index
^Checkout
From your project repository, check out a new branch and test the changes.