Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion fast64_internal/z64/f3d/operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from bpy.path import abspath
from bpy.utils import register_class, unregister_class
from mathutils import Matrix
from typing import Optional

from ...utility import CData, PluginError, raisePluginError, writeCData, toAlnum
from ...f3d.f3d_parser import importMeshC, getImportData
Expand All @@ -29,6 +30,15 @@
)


class OOTF3DGfxFormatter(OOTGfxFormatter):
def __init__(self, scrollMethod):
OOTGfxFormatter.__init__(self, scrollMethod)

# override the function to give a custom name to the DL array
def drawToC(self, f3d, gfxList, layer: Optional[str] = None):
return gfxList.to_c(f3d, name_override=f"{gfxList.name}_{layer.lower()}_dl")


def ootConvertMeshToC(
originalObj: bpy.types.Object,
finalTransform: mathutils.Matrix,
Expand Down Expand Up @@ -80,7 +90,7 @@ def ootConvertMeshToC(
path = ootGetPath(exportPath, isCustomExport, "assets/objects/", folderName, False, True)
includeDir = settings.customAssetIncludeDir if settings.isCustom else f"assets/objects/{folderName}"
exportData = fModel.to_c(
TextureExportSettings(False, saveTextures, includeDir, path), OOTGfxFormatter(ScrollMethod.Vertex)
TextureExportSettings(False, saveTextures, includeDir, path), OOTF3DGfxFormatter(ScrollMethod.Vertex)
)

data.append(exportData.all())
Expand Down
6 changes: 1 addition & 5 deletions fast64_internal/z64/model_classes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import bpy, os, re, mathutils
from typing import Union, Optional
from typing import Union

from ..f3d.f3d_parser import F3DContext, F3DTextureReference, getImportData
from ..f3d.f3d_material import TextureProperty, createF3DMat, texFormatOf, texBitSizeF3D
Expand Down Expand Up @@ -305,10 +305,6 @@ class OOTGfxFormatter(GfxFormatter):
def __init__(self, scrollMethod):
GfxFormatter.__init__(self, scrollMethod, 64, None)

# override the function to give a custom name to the DL array
def drawToC(self, f3d, gfxList, layer: Optional[str] = None):
return gfxList.to_c(f3d, name_override=f"{gfxList.name}_{layer.lower()}_dl")


class OOTTriangleConverterInfo(TriangleConverterInfo):
def __init__(self, obj, armature, f3d, transformMatrix, infoDict):
Expand Down