Bug on vertex group creation after using bisect_plane #65685

Closed
opened 2019-06-10 10:15:03 +02:00 by wenye he · 5 comments

System Information
Operating system: Windows 10
Graphics card: GTX1060

Blender Version
Blender 2.79

Short description of error
Wrong vertices are added to a vertex group.

Exact steps for others to reproduce the error
I am writing a script to create contour lines on an object. Each line is created, its vertices will be added into a new vertex group.
I use bmesh.ops.bisect_plane to create contour lines. I get mutilple sets of vertices from geom_cut.
I create the new vertex groups for each set of vertices.
However, the newer vertex groups somehow contain the vertices from previous vertex groups.
After a long time of testing, I believe the problem is on BMesh.
The attachment is the file showing my trials. The instruction is in the scripts.
BugReport.blend

**System Information** Operating system: Windows 10 Graphics card: GTX1060 **Blender Version** Blender 2.79 **Short description of error** Wrong vertices are added to a vertex group. **Exact steps for others to reproduce the error** I am writing a script to create contour lines on an object. Each line is created, its vertices will be added into a new vertex group. I use **bmesh.ops.bisect_plane** to create contour lines. I get mutilple sets of vertices from **geom_cut**. I create the new vertex groups for each set of vertices. However, the newer vertex groups somehow contain the vertices from previous vertex groups. After a long time of testing, I believe the problem is on BMesh. The attachment is the file showing my trials. The instruction is in the scripts. [BugReport.blend](https://archive.blender.org/developer/F7097298/BugReport.blend)
Author

Added subscriber: @WenyeHe

Added subscriber: @WenyeHe
Member

Added subscribers: @ideasman42, @brecht, @lichtwerk

Added subscribers: @ideasman42, @brecht, @lichtwerk
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Philipp Oeser self-assigned this 2019-06-11 14:25:58 +02:00
Member

The thing is that newly created geometry weights will always be interpolated from adjacent geometryand will end up in neighboring vertex groups.

This is not special to bisect_plane or usage from python.
You can also see this by just creating an edgeloop using the Loopcut Tool next to a loop that is already in a vertex group. The new loop will also be put in neighboring vertex group(s) [can be multiple] and weights will be interpolated.
(it is not always consistent, but basically, this it how it works...)

In your file you are mentioning you are getting good results when bisecting, remembering the created new vertex indices and creating the vertex groups after all cuts have been made.
This works for the same reason: you are not creating new gemoetry next to gemoetry that already has weights.

You seem to be using vertex groups like selection sets [meaning one vertex should only be in a single group only].
Suggest to either store indices in a list [aka your own implementation of this] or if you want to keep using vertex groups, then make sure to remove newly created vertices from all other existing groups after creation.

I will close this [unless @ideasman42 or @brecht have objections?] as not being a bug...
@WenyeHe : feel free to comment again if issues persist...

The thing is that newly created geometry weights will always be interpolated from adjacent geometryand will end up in neighboring vertex groups. This is not special to `bisect_plane` or usage from python. You can also see this by just creating an edgeloop using the Loopcut Tool next to a loop that is already in a vertex group. The new loop will also be put in neighboring vertex group(s) [can be multiple] and weights will be interpolated. (it is not always consistent, but basically, this it how it works...) In your file you are mentioning you are getting good results when bisecting, remembering the created new vertex indices and creating the vertex groups after all cuts have been made. This works for the same reason: you are not creating new gemoetry next to gemoetry that already has weights. You seem to be using vertex groups like selection sets [meaning one vertex should only be in a single group only]. Suggest to either store indices in a list [aka your own implementation of this] or if you want to keep using vertex groups, then make sure to remove newly created vertices from all other existing groups after creation. I will close this [unless @ideasman42 or @brecht have objections?] as not being a bug... @WenyeHe : feel free to comment again if issues persist...

Agree this isn't a bug.

Agree this isn't a bug.
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
3 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#65685
No description provided.