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

@ -1,5 +1,5 @@
import os
from typing import Optional, TextIO
from typing import List, Optional, TextIO, Dict, Any, TypeVar, TYPE_CHECKING
import bpy
@ -17,14 +17,14 @@ if lnx.is_reload(__name__):
else:
lnx.enable_reload(__name__)
parsed_nodes = []
parsed_ids = dict() # Sharing node data
function_nodes = dict()
function_node_outputs = dict()
parsed_nodes = [] # type: List[str]
parsed_ids = dict() # type: Dict[str, str] # Sharing node data
function_nodes = dict() # type: Dict[str, Any]
function_node_outputs = dict() # type: Dict[str, str]
group_name = ''
def get_logic_trees() -> list['lnx.nodes_logic.LnxLogicTree']:
def get_logic_trees() -> List['lnx.nodes_logic.LnxLogicTree']:
ar = []
for node_group in bpy.data.node_groups:
if node_group.bl_idname == 'LnxLogicTreeType':
@ -140,7 +140,7 @@ def build_node_group_tree(node_group: 'lnx.nodes_logic.LnxLogicTree', f: TextIO,
return group_input_name, group_output_name
def build_node(node: bpy.types.Node, f: TextIO, name_prefix: str = None) -> Optional[str]:
def build_node(node: bpy.types.Node, f: TextIO, name_prefix: Optional[str] = None) -> Optional[str]:
"""Builds the given node and returns its name. f is an opened file object."""
global parsed_nodes
global parsed_ids