Mesh properties API does not allow for zeros in byte array #32581
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#32581
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?
%%%easy to reproduce at console with default scene:
layer = bpy.data.meshes["Cube"].polygon_layers_string.new("Data")
layer.data- [x].value = bytes([1, 2, 0, 1, 2])
print(layer.data- [x].value)
result:
b'\x01\x02'%%%
Changed status to: 'Open'
%%%Confirmed, to support we need to
... a new callback would have to take a length argument too.
For BMesh support this is simple but for rna a few callbacks would have to support this especially.%%%
%%%Additionally the name of the property layer is misleading, you cannot actually assign strings at all, it must be a bytes object (which makes it especially broken at the moment). I understand this is probably for historical reasons but thought I should mention it anyway.%%%
%%%Committed support for bmesh: r53681.
---
import bpy
import bmesh
me = bpy.context.object.data
bm = bmesh.new() # create an empty BMesh
bm.from_mesh(me) # fill it in from a Mesh
layer = bm.verts.layers.string.new()
v = bm.verts[0]
v[layer] = bytes([1, 2, 0, 1, 2])
print(v[layer])
bm.to_mesh(me)
bm.free() # free and prevent further access
%%%
%%%setting as todo
http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Scripting#Python.2FRNA_API_Design_TODO%%%
Changed status from 'Open' to: 'Resolved'