GPv3: Vertex Group functions should make use of the VArray
API #117753
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#117753
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
The functions in
grease_pencil_vertex_groups.cc
should make use ofVArrayImpl_For_VertexWeights
(seeBKE_deform.hh
).bke::varray_for_deform_verts
for readingbke::varray_for_mutable_deform_verts
for writingbke::remove_defgroup_index
to remove a group by its index.For
assign_to_vertex_group
here are my changes (sinceassign_to_vertex_group
is dealing with selection, the code should probably be in the editors file, rather than in the kernel):For that matter, it might be even nicer to use the attribute API here. Once the vertex group is created, it can be accessed as a float attribute on the point domain.
@HooglyBoogly True! Would be even better.
Lukas and I noticed that if the user creates a vertex group that has the same name as some attribute, that it would first find the attribute.
I guess the only solution to that would be to make sure that when a vertex group is created, that it doesn't have the same name as any other attribute. Not sure how this would work if the attribute was added afterwards though...
Oh there is task already, didn't know that. Perhaps unrelated, I tried some changes (for simplification) during weekend while understanding the new vgroup structure). How about using
Indexmask selection
instead of looping all points inthreading::parellel_for
?:Code Changes
@PratikPB2123 Generally, code in
blenkernel
shouldn't call code in the editors. This is why I suggested to move this logic into a static function that's called byassign_to_vertex_group
. And this static function would e.g. ensure that the vertex group exists, which can be a kernel function.And I think that it's better
assign_to_vertex_group
will useretrieve_visible_drawings()
instead of assigning to all drawings. I checked, that's the behaviour in GPv2 too.@HooglyBoogly I'm wondering if we can make all of this easier by adding a
try_create
function toCurvesVertexGroupsAttributeProvider
. That should essentially replace theensure_vertex_group
no?We can't do that, since float attributes should be created by default in geometry nodes (and elsewhere in the attribute API) instead of vertex groups. Vertex groups always have to be created explicitly outside of the attribute API, for now anyway.