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,13 +1,15 @@
from typing import List, Dict, Optional, Any
import lnx.utils
from lnx import assets
def parse_context(
c: dict,
sres: dict,
asset,
defs: list[str],
vert: list[str] = None,
frag: list[str] = None,
c: Dict[str, Any],
sres: Dict[str, Any],
asset: Any,
defs: List[str],
vert: Optional[List[str]] = None,
frag: Optional[List[str]] = None,
):
con = {
"name": c["name"],
@ -99,7 +101,12 @@ def parse_context(
def parse_shader(
sres, c: dict, con: dict, defs: list[str], lines: list[str], parse_attributes: bool
sres: Dict[str, Any],
c: Dict[str, Any],
con: Dict[str, Any],
defs: List[str],
lines: List[str],
parse_attributes: bool
):
"""Parses the given shader to get information about the used vertex
elements, uniforms and constants. This information is later used in
@ -229,7 +236,12 @@ def parse_shader(
check_link(c, defs, cid, const)
def check_link(source_context: dict, defs: list[str], cid: str, out: dict):
def check_link(
source_context: Dict[str, Any],
defs: List[str],
cid: str,
out: Dict[str, Any]
):
"""Checks whether the uniform/constant with the given name (`cid`)
has a link stated in the json (`source_context`) that can be safely
included based on the given defines (`defs`). If that is the case,
@ -273,7 +285,12 @@ def check_link(source_context: dict, defs: list[str], cid: str, out: dict):
def make(
res: dict, base_name: str, json_data: dict, fp, defs: list[str], make_variants: bool
res: Dict[str, Any],
base_name: str,
json_data: Dict[str, Any],
fp: Any,
defs: List[str],
make_variants: bool
):
sres = {"name": base_name, "contexts": []}
res["shader_datas"].append(sres)