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

@ -10,7 +10,7 @@ mutable (common Python pitfall, be aware of this!), but because they
don't get accessed later it doesn't matter here and we keep it this way
for parity with the Blender API.
"""
from typing import Any, Callable, Sequence, Union
from typing import Any, Callable, List, Sequence, Set, Union
import sys
import bpy
@ -49,6 +49,10 @@ def __haxe_prop(prop_type: Callable, prop_name: str, *args, **kwargs) -> Any:
# bpy.types.Bone, remove them here to prevent registration errors
if 'tags' in kwargs:
del kwargs['tags']
# Remove override parameter for Blender versions that don't support it
if bpy.app.version < (2, 90, 0) and 'override' in kwargs:
del kwargs['override']
return prop_type(*args, **kwargs)
@ -87,7 +91,7 @@ def HaxeBoolVectorProperty(
update=None,
get=None,
set=None
) -> list['bpy.types.BoolProperty']:
) -> List['bpy.types.BoolProperty']:
"""Declares a new BoolVectorProperty that has a Haxe counterpart
with the given prop_name (Python and Haxe names must be identical
for now).
@ -118,7 +122,7 @@ def HaxeEnumProperty(
items: Sequence,
name: str = "",
description: str = "",
default: Union[str, set[str]] = None,
default: Union[str, Set[str]] = None,
options: set = {'ANIMATABLE'},
override: set = set(),
tags: set = set(),
@ -180,7 +184,7 @@ def HaxeFloatVectorProperty(
update=None,
get=None,
set=None
) -> list['bpy.types.FloatProperty']:
) -> List['bpy.types.FloatProperty']:
"""Declares a new FloatVectorProperty that has a Haxe counterpart
with the given prop_name (Python and Haxe names must be identical
for now).
@ -232,7 +236,7 @@ def HaxeIntVectorProperty(
update=None,
get=None,
set=None
) -> list['bpy.types.IntProperty']:
) -> List['bpy.types.IntProperty']:
"""Declares a new IntVectorProperty that has a Haxe counterpart with
the given prop_name (Python and Haxe names must be identical for now).
"""