The first uv layer will be overwritten by the second uv layer #104569
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#104569
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?
System Information
Operating system: macOS-13.3.1-arm64-arm-64bit 64 Bits
Graphics card: Apple M1 Apple 4.1 Metal - 83.1
Blender Version
Broken: version: 3.5.0, branch: blender-v3.5-release, commit date: 2023-03-29 02:56, hash: 1be25cfff18b
Worked: (newest version of Blender that worked as expected)
Short description of error
The first uv layer will be overwritten by the second uv layer
Exact steps for others to reproduce the error
This issue only appears in Blender 3.5, Blender 2.93/3.3/3.4/3.6 alpha have no issues.
If I import two uv layers via Python script, the first uv layer will be overwritten by the second uv layer, while the second uv layer has no data at all; if I only import the first uv layer, the first uv layer will be correct, so I can confirm that the first uv layer is overwritten by the second uv layer.
Here is my code:
bm = bmesh.new()
bm.from_mesh(me)
for uv in node['UV']:
uv_name = uv[0]
uv_index = uv[1]
uvs = uv_dic[uv_index]
uv_layer = bm.loops.layers.uv.new(uv_name)
bm.faces.layers.face_map.verify()
for (i, f) in enumerate(bm.faces):
for (j, l) in enumerate(f.loops):
luv = l[uv_layer]
luv.uv = (uvs[i][j][0], uvs[i][j][1])
bm.to_mesh(me)
me.update()
bm.free
Note: node['UV'] is a list of uv name and uv index, uv_dic is a dictionary of the uv values.
Probably related to:
blender/blender#107500
blender/blender#107491
Thanks for taking time making the report, but please provide a working script so we can properly replicate the issue.
Also note that you reported this issue in the blender-addons repository but no addons were reported.
Sorry I don't have a working script at present, for my add-on is so complicated that I can't make a simple testing script from the source code, I guess that the issue may be caused by this line:
luv = l[uv_layer]
Where luv should be a pointer of the uv layer by uv name, but luv was always wrongly mapped to the first uv layer in Blender 3.5, in other Blender versions(3.3/3.4/3.6 alpha) the mappings are correct.
OK. I took some time to complete the code myself. But I couldn't replicate the issue described. It worked normally as expected. So I'm going to assume that the problem is somewhere else, probably not a bug in Blender. So closing since this report also has no activity for more than a week.
I have just tested the code in Blender 3.5.0, the bug is still there, but after I upgraded to Blender 3.5.1, the bug has gone, so I confirmed that the bug has been fixed in Blender 3.5.1, it works correctly now:)