Skip to content
Snippets Groups Projects
  • Robert Guetzkow's avatar
    a0e8b8b7
    Fix T82830: Handle limit for vertex color and uv layers in importer · a0e8b8b7
    Robert Guetzkow authored
    Blender has a limit for both vertex color layers and UV layers. The
    functions `bpy.types.Mesh.vertex_colors.new()` and
    `bpy.types.Mesh.uv_layers.new()` will return `None` once the limit
    is reached. The FBX importer and glTF importer didn't handle this
    case before and attempted to access the `data`, which failed. This
    patch adds the missing checks. In case no vertex colors or uv map
    can be created, the assignment of colors or uv coordinates is
    skipped.
    
    Reviewed By: mont29, julien
    
    Differential Revision: https://developer.blender.org/D9613
    a0e8b8b7
    History
    Fix T82830: Handle limit for vertex color and uv layers in importer
    Robert Guetzkow authored
    Blender has a limit for both vertex color layers and UV layers. The
    functions `bpy.types.Mesh.vertex_colors.new()` and
    `bpy.types.Mesh.uv_layers.new()` will return `None` once the limit
    is reached. The FBX importer and glTF importer didn't handle this
    case before and attempted to access the `data`, which failed. This
    patch adds the missing checks. In case no vertex colors or uv map
    can be created, the assignment of colors or uv coordinates is
    skipped.
    
    Reviewed By: mont29, julien
    
    Differential Revision: https://developer.blender.org/D9613
import_fbx.py 135.41 KiB