Gpencil: Make visible in RNA the weights of the points #84967

Closed
opened 2021-01-22 16:05:07 +01:00 by Antonio Vazquez · 7 comments

Actually we have an array inside the stroke (bGPDstroke) with the weights, but this is not visible in the python API and the artists need to read this data.

The actual code in rna_GpencilVertex_groups_begin is not working because it does not display the full array of values. The problem is the "owner" of the data is bGPDstroke and if we move the RNA prop to Point, we are unable to get the Stroke because is not an ID.

RNA_def_property_collection_funcs(prop,
"rna_GpencilVertex_groups_begin",
"rna_iterator_array_next",
"rna_iterator_array_end",
"rna_iterator_array_get",
NULL,
NULL,
NULL,
NULL);
RNA_def_property_struct_type(prop, "GpencilVertexGroupElement");
RNA_def_property_ui_text(
prop, "Groups", "Weights for the vertex groups this vertex is member of");```

Actually we have an array inside the stroke (bGPDstroke) with the weights, but this is not visible in the python API and the artists need to read this data. The actual code in `rna_GpencilVertex_groups_begin` is not working because it does not display the full array of values. The problem is the "owner" of the data is bGPDstroke and if we move the RNA prop to Point, we are unable to get the Stroke because is not an ID. ```prop = RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE); ``` RNA_def_property_collection_funcs(prop, "rna_GpencilVertex_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL); RNA_def_property_struct_type(prop, "GpencilVertexGroupElement"); RNA_def_property_ui_text( prop, "Groups", "Weights for the vertex groups this vertex is member of");```
Author
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author
Member

Added subscribers: @antoniov, @brecht

Added subscribers: @antoniov, @brecht
Author
Member

@brecht Could you help me with this? I don't know enough of RNA to solve it. Thanks in advance.

@brecht Could you help me with this? I don't know enough of RNA to solve it. Thanks in advance.
Author
Member

Added subscribers: @Pullup, @PierreMervaillie

Added subscribers: @Pullup, @PierreMervaillie
Author
Member

Following @brecht advices, I'm going to implement this as a function because expose as array is not efficient.

Following @brecht advices, I'm going to implement this as a function because expose as array is not efficient.
Antonio Vazquez self-assigned this 2021-01-22 16:33:44 +01:00

This issue was referenced by 71e63153eb

This issue was referenced by 71e63153ebf3668c6552afda5acfc746dcc49853
Author
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser Project (Legacy)
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
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#84967
No description provided.