diff --git a/fast64_internal/f3d/f3d_gbi.py b/fast64_internal/f3d/f3d_gbi.py index 948077644..ea31459e3 100644 --- a/fast64_internal/f3d/f3d_gbi.py +++ b/fast64_internal/f3d/f3d_gbi.py @@ -2137,6 +2137,7 @@ def to_c(self): data.source += "};\n\n" return data + def empty_logging_func(a, b): pass @@ -2206,13 +2207,12 @@ def to_c_dynamic(self): return data def to_soh_xml(self, modelDirPath, objectPath, *args, **kwargs): - logging_func = kwargs.get('logging_func', empty_logging_func) + logging_func = kwargs.get("logging_func", empty_logging_func) logging_func({"INFO"}, "GfxList to_soh_xml 1") data = '\n' for command in self.commands: - logging_func({"INFO"}, "GfxList to_soh_xml 2 command=" + (str(command) if command is not None else "None")) if isinstance(command, (SPDisplayList, SPBranchList, SPVertex, DPSetTextureImage)): @@ -3254,8 +3254,15 @@ def to_soh_xml(self, modelDirPath, objectPath, logging_func): vtxData += self.vertexList.to_soh_xml() # vtxData += "\n" - logging_func({"INFO"}, "FTriGroup.to_soh_xml 1.1 modelDirPath=" + (str(modelDirPath) if modelDirPath is not None else "None")) - logging_func({"INFO"}, "FTriGroup.to_soh_xml 1.2 self.vertexList.name=" + (str(self.vertexList.name) if self.vertexList.name is not None else "None")) + logging_func( + {"INFO"}, + "FTriGroup.to_soh_xml 1.1 modelDirPath=" + (str(modelDirPath) if modelDirPath is not None else "None"), + ) + logging_func( + {"INFO"}, + "FTriGroup.to_soh_xml 1.2 self.vertexList.name=" + + (str(self.vertexList.name) if self.vertexList.name is not None else "None"), + ) # writeXMLData(vtxData, os.path.join(modelDirPath, self.vertexList.name)) diff --git a/fast64_internal/f3d/f3d_writer.py b/fast64_internal/f3d/f3d_writer.py index 4f2082fbb..d64bfb85f 100644 --- a/fast64_internal/f3d/f3d_writer.py +++ b/fast64_internal/f3d/f3d_writer.py @@ -416,9 +416,18 @@ def empty_logging_func(a, b): # Make sure to set original_name before calling this # used when duplicating an object def saveStaticModel( - triConverterInfo, fModel, obj, transformMatrix, ownerName, convertTextureData, revertMatAtEnd, drawLayerField, *args, **kwargs + triConverterInfo, + fModel, + obj, + transformMatrix, + ownerName, + convertTextureData, + revertMatAtEnd, + drawLayerField, + *args, + **kwargs, ): - logging_func = kwargs.get('logging_func', empty_logging_func) + logging_func = kwargs.get("logging_func", empty_logging_func) logging_func({"INFO"}, "saveStaticModel 1") @@ -464,10 +473,12 @@ def saveStaticModel( logging_func({"INFO"}, "saveStaticModel 7") if drawLayer not in fMeshes: - logging_func({"INFO"}, "saveStaticModel 7.11 " + (obj.original_name if obj.original_name is not None else "None" )) - logging_func({"INFO"}, "saveStaticModel 7.12 " + (ownerName if ownerName is not None else "None" )) - logging_func({"INFO"}, "saveStaticModel 7.13 " + (drawLayerName if drawLayerName is not None else "None" )) - logging_func({"INFO"}, "saveStaticModel 7.14 " + (str(obj) if obj is not None else "None" )) + logging_func( + {"INFO"}, "saveStaticModel 7.11 " + (obj.original_name if obj.original_name is not None else "None") + ) + logging_func({"INFO"}, "saveStaticModel 7.12 " + (ownerName if ownerName is not None else "None")) + logging_func({"INFO"}, "saveStaticModel 7.13 " + (drawLayerName if drawLayerName is not None else "None")) + logging_func({"INFO"}, "saveStaticModel 7.14 " + (str(obj) if obj is not None else "None")) fMesh = fModel.addMesh(obj.original_name, ownerName, drawLayerName, False, obj) logging_func({"INFO"}, "saveStaticModel 7.2") fMeshes[drawLayer] = fMesh @@ -527,7 +538,7 @@ def saveStaticModel( revertMatAndEndDraw(fMesh.draw, []) else: fModel.endDraw(fMesh, obj) - + logging_func({"INFO"}, "saveStaticModel 12") logging_func({"INFO"}, "saveStaticModel 13") diff --git a/fast64_internal/oot/animation/importer/functions.py b/fast64_internal/oot/animation/importer/functions.py index ae9c19730..273bcd7d6 100644 --- a/fast64_internal/oot/animation/importer/functions.py +++ b/fast64_internal/oot/animation/importer/functions.py @@ -32,7 +32,7 @@ def getFrameData(filepath, animData, frameDataName): raise PluginError("Cannot find animation frame data named " + frameDataName + " in " + filepath) data = matchResult.group(1) - #fixes the "invalid literal for int() with base 16: 'x0'" error + # fixes the "invalid literal for int() with base 16: 'x0'" error frameData = [] for value in data.split(","): value = value.strip() @@ -42,11 +42,11 @@ def getFrameData(filepath, animData, frameDataName): valueInt = int.from_bytes([int(value[2:4], 16), int(value[4:6], 16)], "big", signed=True) frameData.append(-valueInt if isNegative else valueInt) - #frameData = [ + # frameData = [ # int.from_bytes([int(value.strip()[2:4], 16), int(value.strip()[4:6], 16)], "big", signed=True) # for value in data.split(",") # if value.strip() != "" - #] + # ] return frameData diff --git a/fast64_internal/oot/f3d/operators.py b/fast64_internal/oot/f3d/operators.py index 610d51d2e..a08e48bbd 100644 --- a/fast64_internal/oot/f3d/operators.py +++ b/fast64_internal/oot/f3d/operators.py @@ -31,7 +31,7 @@ def ootConvertMeshToC( DLFormat: DLFormat, saveTextures: bool, settings: OOTDLExportSettings, - logging_func + logging_func, ): folderName = settings.folder exportPath = bpy.path.abspath(settings.customPath) @@ -99,7 +99,7 @@ def ootConvertMeshToXML( DLFormat: DLFormat, saveTextures: bool, settings: OOTDLExportSettings, - logging_func + logging_func, ): logging_func({"INFO"}, "ootConvertMeshToXML 1") @@ -129,7 +129,15 @@ def ootConvertMeshToXML( logging_func({"INFO"}, "ootConvertMeshToXML 5") fMeshes = saveStaticModel( - triConverterInfo, fModel, obj, finalTransform, fModel.name, not saveTextures, False, "oot", logging_func=logging_func + triConverterInfo, + fModel, + obj, + finalTransform, + fModel.name, + not saveTextures, + False, + "oot", + logging_func=logging_func, ) logging_func({"INFO"}, "ootConvertMeshToXML 6") @@ -137,7 +145,7 @@ def ootConvertMeshToXML( # Since we provide a draw layer override, there should only be one fMesh. for drawLayer, fMesh in fMeshes.items(): fMesh.draw.name = name - + logging_func({"INFO"}, "ootConvertMeshToXML 7") ootCleanupScene(originalObj, allObjs) @@ -148,8 +156,14 @@ def ootConvertMeshToXML( ootCleanupScene(originalObj, allObjs) raise Exception(str(e)) - logging_func({"INFO"}, "ootConvertMeshToXML 9 exportPath=" + (str(exportPath) if exportPath is not None else "None")) - logging_func({"INFO"}, "ootConvertMeshToXML 9 settings.customAssetIncludeDir=" + (str(settings.customAssetIncludeDir) if settings.customAssetIncludeDir is not None else "None")) + logging_func( + {"INFO"}, "ootConvertMeshToXML 9 exportPath=" + (str(exportPath) if exportPath is not None else "None") + ) + logging_func( + {"INFO"}, + "ootConvertMeshToXML 9 settings.customAssetIncludeDir=" + + (str(settings.customAssetIncludeDir) if settings.customAssetIncludeDir is not None else "None"), + ) path = ootGetPath(exportPath, isCustomExport, "assets/objects/", folderName, False, True) @@ -159,9 +173,7 @@ def ootConvertMeshToXML( logging_func({"INFO"}, "ootConvertMeshToXML 11") - data = fModel.to_soh_xml( - path, path, logging_func - ) + data = fModel.to_soh_xml(path, path, logging_func) logging_func({"INFO"}, "ootConvertMeshToXML 12") @@ -284,14 +296,7 @@ def execute(self, context): self.report({"INFO"}, "OOT_ExportDL execute 4") if context.scene.fast64.oot.featureSet == "SoH": - ootConvertMeshToXML( - obj, - finalTransform, - DLFormat.Static, - saveTextures, - exportSettings, - self.report - ) + ootConvertMeshToXML(obj, finalTransform, DLFormat.Static, saveTextures, exportSettings, self.report) else: ootConvertMeshToC( obj,