grease pencil vertex group add fails in python #56280

Closed
opened 2018-08-09 03:50:18 +02:00 by goat head · 11 comments

System Information
Operating system and graphics card
Fedora, Intel Graphics

Blender Version
latest blender2.8 branch from git

Short description of error
the python below should add points to the new vertex group, but it fails.

Exact steps for others to reproduce the error
v = ob.vertex_groups.new(name="mygroup")
v.add( [1,2,3], weight=1.0, type="ADD")

**System Information** Operating system and graphics card Fedora, Intel Graphics **Blender Version** latest blender2.8 branch from git **Short description of error** the python below should add points to the new vertex group, but it fails. **Exact steps for others to reproduce the error** v = ob.vertex_groups.new(name="mygroup") v.add( [1,2,3], weight=1.0, type="ADD")
Author

Added subscriber: @hartsantler

Added subscriber: @hartsantler
Antonio Vazquez was assigned by Bastien Montagne 2018-08-09 11:04:31 +02:00

Added subscriber: @mont29

Added subscriber: @mont29

I can confirm this, but it's not a bug but an unsupported python API feature.

The weight data in grease pencil reuse some areas of vertex groups used in meshes, but the weight point information is handle totally different due the nature of the internal strokes data and this is the reason the weight add is not working.

I will investigate how we can expose this api in python.

@mont29 what we must do with this bug report? change status, close, I don't know?

I can confirm this, but it's not a bug but an unsupported python API feature. The weight data in grease pencil reuse some areas of vertex groups used in meshes, but the weight point information is handle totally different due the nature of the internal strokes data and this is the reason the weight add is not working. I will investigate how we can expose this api in python. @mont29 what we must do with this bug report? change status, close, I don't know?

@hartsantler You could use a different approach.

After creating the vertex group, you can select the points of the stroke and then use the operator gpencil.vertex_group_assign.

I have not tested but I think it can be work.

@hartsantler You could use a different approach. After creating the vertex group, you can select the points of the stroke and then use the operator gpencil.vertex_group_assign. I have not tested but I think it can be work.

Looking in detail in python API, the add function will never work because when adding a weight to vertex in a mesh, the vertex 1, 2, x is know, but in grease pencil, the vertex 1, 2, n is not like that, first you need define in what layer, in what frame and in what stroke are you adding the weight.

For example, the weight 1.0 to vertex 5 could be: Layer A->Frame 32->Stroke 75->Vertex 5 = 1.0

I need design an API to do that, but in any case, always will need a stroke parameter, never object only.

Looking in detail in python API, the add function will never work because when adding a weight to vertex in a mesh, the vertex 1, 2, x is know, but in grease pencil, the vertex 1, 2, n is not like that, first you need define in what layer, in what frame and in what stroke are you adding the weight. For example, the weight 1.0 to vertex 5 could be: Layer A->Frame 32->Stroke 75->Vertex 5 = 1.0 I need design an API to do that, but in any case, always will need a stroke parameter, never object only.

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

We can consider this as a non supported python api, so we can close the bug.

We can consider this as a non supported python api, so we can close the bug.

Added subscriber: @nantille

Added subscriber: @nantille

This comment was removed by @nantille

*This comment was removed by @nantille*

Added subscriber: @maumemoli

Added subscriber: @maumemoli

In #56280#525614, @antoniov wrote:
@hartsantler You could use a different approach.

After creating the vertex group, you can select the points of the stroke and then use the operator gpencil.vertex_group_assign.

I have not tested but I think it can be work.

Anything that forces the python developers use bpy.ops because of limits in the API shouldn't be an option...
I was wondering if there is any update on this issue.

> In #56280#525614, @antoniov wrote: > @hartsantler You could use a different approach. > > After creating the vertex group, you can select the points of the stroke and then use the operator gpencil.vertex_group_assign. > > I have not tested but I think it can be work. Anything that forces the python developers use bpy.ops because of limits in the API shouldn't be an option... I was wondering if there is any update on this issue.
Sign in to join this conversation.
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
4 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#56280
No description provided.