Customdata merging does not check layer limit on destination #111609

Merged
Philipp Oeser merged 1 commits from lichtwerk/blender:111608_a into main 2023-08-29 18:02:44 +02:00
Member

LayerTypeInfo can define a layers_max() function which determines the
maximum allowed number of layers.

Upon merging, this limit was respected from the source, but not on the
destination, so it was possible to exceed the max (if there were layers
on the destination already).

NOTE: layers_max() is currently only defined for legacy CD_MTFACE, but
we might want to enforce this for UVs / CD_PROP_FLOAT2 again.

This came up in #111608.

`LayerTypeInfo` can define a `layers_max()` function which determines the maximum allowed number of layers. Upon merging, this limit was respected from the source, but not on the destination, so it was possible to exceed the max (if there were layers on the destination already). NOTE: `layers_max()` is currently only defined for legacy CD_MTFACE, but we might want to enforce this for UVs / CD_PROP_FLOAT2 again. This came up in #111608.
Philipp Oeser added 1 commit 2023-08-28 13:54:59 +02:00
784e3949d4 Customdata merging does not check layer limit on destination
`LayerTypeInfo` can define a `layers_max()` function which determines the
maximum allowed number of layers.

Upon merging, this limit was respected from the source, but not on the
destination, so it was possible to exceed the max (if there were layers
on the destination already).

NOTE: `layers_max()` is currently only defined for legacy CD_MTFACE, but
we might want to enforce this for UVs / CD_PROP_FLOAT2 again.

This came up in #111608.
Philipp Oeser added this to the Modeling project 2023-08-28 13:55:08 +02:00
Philipp Oeser requested review from Hans Goudey 2023-08-28 13:55:17 +02:00
Philipp Oeser requested review from Campbell Barton 2023-08-28 13:55:24 +02:00
Philipp Oeser requested review from Bastien Montagne 2023-08-28 13:55:30 +02:00
Member

Hmm, one of the points of moving to generic attributes is that we don't have this sort of limit anymore. Agree in principle a limit should be respected when merging, but since CD_MTFACE is only used for legacy MFace faces, this won't really have an effect.

Hmm, one of the points of moving to generic attributes is that we don't have this sort of limit anymore. Agree in principle a limit should be respected when merging, but since `CD_MTFACE` is only used for legacy `MFace` faces, this won't really have an effect.
Bastien Montagne approved these changes 2023-08-28 14:31:41 +02:00
Bastien Montagne left a comment
Owner

Looks reasonable to me :)

Looks reasonable to me :)
Author
Member

Hmm, one of the points of moving to generic attributes is that we don't have this sort of limit anymore. Agree in principle a limit should be respected when merging, but since CD_MTFACE is only used for legacy MFace faces, this won't really have an effect.

Yes, but shouldnt this be corrected still? And I am not totally sure we never want limits going forward? For example the UV case? (have you checked on #111608 and the other issues mentioned there?)

> Hmm, one of the points of moving to generic attributes is that we don't have this sort of limit anymore. Agree in principle a limit should be respected when merging, but since `CD_MTFACE` is only used for legacy `MFace` faces, this won't really have an effect. Yes, but shouldnt this be corrected still? And I am not totally sure we **never** want limits going forward? For example the UV case? (have you checked on #111608 and the other issues mentioned there?)

@HooglyBoogly AFAIK UI and user-level tools in Blender still limit the amount of UV layers to 8? So having code (besides very maybe python API) that allows to generate meshes with more UV layers than this limit is very, very bad.

@HooglyBoogly AFAIK UI and user-level tools in Blender still limit the amount of UV layers to 8? So having code (besides _very maybe_ python API) that allows to generate meshes with more UV layers than this limit is very, very bad.

Accepting, although I think it would be good to have object joining default to match UV layers by index instead of by name, this way joining many meshes won't loose their UV's. There can be an option to map layer names for UV's still but this has the down side that it may attempt to add more than 8 layers which then looses UV data.

Accepting, although I think it would be good to have object joining default to match UV layers by index instead of by name, this way joining many meshes won't loose their UV's. There can be an option to map layer names for UV's still but this has the down side that it may attempt to add more than 8 layers which then looses UV data.
Campbell Barton approved these changes 2023-08-29 08:10:21 +02:00
Author
Member

Would like to clarify that this patch DOES NOT alter the behavior of the join operator at all atm. (at least not without introducing further changes such as adding layers_max() for CD_PROP_FLOAT2)

Would like to clarify that this patch DOES NOT alter the behavior of the join operator at all atm. (at least not without introducing further changes such as adding `layers_max()` for `CD_PROP_FLOAT2`)
Hans Goudey approved these changes 2023-08-29 15:24:44 +02:00
Hans Goudey left a comment
Member

Enforcing the limit is okay. I don't think adding back a limit for UVs is the right way forward, but we can handle that separately.

Enforcing the limit is okay. I don't think adding back a limit for UVs is the right way forward, but we can handle that separately.
Philipp Oeser merged commit a3c045d49d into main 2023-08-29 18:02:44 +02:00
Philipp Oeser deleted branch 111608_a 2023-08-29 18:02:46 +02:00
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
4 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#111609
No description provided.