GPv3: Add layer 'pass index' attribute. #118495
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#118495
Loading…
Reference in New Issue
No description provided.
Delete Branch "mont29/blender:tmp-gp-layer-index"
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?
Add this data as a layer attribute. It's usage was already implemented
by the modifier filtering generic code, but data itself did not yet
exist in GPv3 data.
Also add RNA accessors and handle it in conversion code.
@blender-bot build
Thanks, just one remark.
@ -386,0 +389,4 @@
layer_idx = 0;
LISTBASE_FOREACH_INDEX (bGPDlayer *, gpl, &gpd.layers, layer_idx) {
layer_passes.span[layer_idx] = int(gpl->pass_index);
I think it's best to put this in the loop above. E.g. below
new_layer.opacity = gpl->opacity;
Is that possible? AFAICT, the loop above is adding layers one by one, can the attribute data remain valid in that context?
Ah yea, good point. Technically it would be possible (because the layer data is getting resized when a layer is added), but let's not overcomplicate this :)
Maybe just a comment, something like:
/* Write to layer attributes after all layers were created. */
, could help.8bf8129c83
to2ff5b7ed3e
I guess we already used the "pass" name? I find that a bit vague/short for this, but it can be tweaked outside of this PR too.
@ -138,0 +160,4 @@
bke::SpanAttributeWriter<int> layer_passes =
grease_pencil.attributes_for_write().lookup_or_add_for_write_span<int>(
"pass", bke::AttrDomain::Layer);
layer_passes.span[layer_idx] = max_ii(0, value);
max_ii
->std::max
@filedescriptor do we actually? AFAICT in current code in
main
, it's only referenced in the filtering code of modifiers... but there should be no data with that attribute currently existing?In which case renaming should rather happen now, than later... I guess
layer_index
would be a better name?@mont29 This feature is meant to allow users to assign a "pass" number to a layer (but multiple layers could use the same "pass") to allow for arbitrary "grouping" of layers. E.g. layers with the same "pass" ID would use the same filtering in a modifier for example. Initially this was also meant to be used by the renderer to allow to render layer by passes (though that never happend).
So with that in mind, I think
pass
orpass_id
or something of that sort could be fine.@blender-bot build
@filedescriptor renamed to
pass_index
, since it's also the RNA prop name...GPv3: Add 'layer pass index'.to GPv3: Add layer 'pass index' attribute.