Blender 2.8 - 4.5 Support

This commit is contained in:
2025-09-28 12:44:04 -07:00
parent 8f8d4b1376
commit f97d8fd846
34 changed files with 581 additions and 399 deletions

View File

@ -2,8 +2,7 @@
Exports smaller geometry but is slower.
To be replaced with https://github.com/zeux/meshoptimizer
"""
from typing import Optional
from typing import Optional, TYPE_CHECKING
import bpy
from mathutils import Vector
import numpy as np
@ -21,7 +20,12 @@ else:
class Vertex:
__slots__ = ("co", "normal", "uvs", "col", "loop_indices", "index", "bone_weights", "bone_indices", "bone_count", "vertex_index")
def __init__(self, mesh: bpy.types.Mesh, loop: bpy.types.MeshLoop, vcol0: Optional[bpy.types.Attribute]):
def __init__(
self,
mesh: 'bpy.types.Mesh',
loop: 'bpy.types.MeshLoop',
vcol0: Optional['bpy.types.MeshLoopColor' if bpy.app.version < (3, 0, 0) else 'bpy.types.Attribute']
):
self.vertex_index = loop.vertex_index
loop_idx = loop.index
self.co = mesh.vertices[self.vertex_index].co[:]