Error on assigning different amount of verts to MeshPolygon.vertices in Blender 3.5 #106384
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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 & 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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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#106384
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
Blender 3.5
Short description of error
Found that in 3.5 the code below that's trying to assign different number of verts to polygon than there was before results in error. Haven't found anything related in https://wiki.blender.org/wiki/Reference/Release_Notes/3.5/Python_API.
It's not that big of a deal, I can rework original code with bmesh. Just wanted to put it out there - maybe it's part of some different issue.
Exact steps for others to reproduce the error
Select cube and run the code below in default scene. You can test the same code in 3.4 - it doesn't result in error.
Cannot assignto Cannot assign different amount of verts to MeshPolygon.vertices in Blender 3.5Cannot assign different amount of verts to MeshPolygon.vertices in Blender 3.5to Error on assigning different amount of verts to MeshPolygon.vertices in Blender 3.5If you add
to the end of the above code in 3.4, you should be able to see that the assignment to
vertices
doesn't do anything;vertices
remains zero length.It looks like
51e5417bd3
in 3.5 also has the effect of raising an error when the array cannot be resized by assignment and the array is smaller than the sequence it's being set to.To set
vertices
like this, theloop_total
of the polygon can be set to the number of vertices beforehand so thatvertices
changes to the desired length.This should work in both 3.4 and 3.5, though for practical use you may want to add new loops and set the
loop_start
of the polygon too so you're not overwriting thevertex_index
of any existing loops or overwriting unallocated memory when the loops don't exist (there don't appear to be any safeguards).That's true. In the code I was using orginally assigning vertices with
obj.data.polygons[-1].vertices = [0,1,2]
prior to declaringobj.data.polygons[-1].loop_total
basically had no effect and it was just a happy accident that it produced correct geometry.Checked that it worked exactly the same way even with
obj.data.polygons[-1].vertices = [0,1,2]
commented out.I am not very familiar with workflow in this case, does this mean that there is no issue after all?
Yeah, basically it wasn't working before and now there is error message for it.
I don't think there is an issue actually.