Skip to content

Commit

Permalink
Fix some errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Pepe20129 committed Jun 28, 2024
1 parent 790bc88 commit 10b9bd2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions fast64_internal/f3d/f3d_gbi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2893,9 +2893,11 @@ def save_soh_textures(self, exportPath, logging_func):
oldpath = image.filepath
try:
image.filepath = bpy.path.abspath(os.path.join(exportPath, imageFileName))
logging_func({"INFO"}, "FModel.save_soh_textures 3.1 " + imageFileName)
logging_func({"INFO"}, "FModel.save_soh_textures 3.2 " + image.filepath)
logging_func({"INFO"}, "FModel.save_soh_textures 3.3 " + oldpath)
logging_func({"INFO"}, "FModel.save_soh_textures 3.1 " + exportPath)
logging_func({"INFO"}, "FModel.save_soh_textures 3.2 " + fImage.filename)
logging_func({"INFO"}, "FModel.save_soh_textures 3.3 " + imageFileName)
logging_func({"INFO"}, "FModel.save_soh_textures 3.4 " + image.filepath)
logging_func({"INFO"}, "FModel.save_soh_textures 3.5 " + oldpath)
with open(image.filepath, "wb") as file:
# Write OTR Header
# I - Endianness
Expand Down Expand Up @@ -3264,15 +3266,15 @@ def to_soh_xml(self, modelDirPath, objectPath, logging_func):
+ (str(self.vertexList.name) if self.vertexList.name is not None else "None"),
)

# writeXMLData(vtxData, os.path.join(modelDirPath, self.vertexList.name))
writeXMLData(vtxData, os.path.join(modelDirPath, self.vertexList.name))

logging_func({"INFO"}, "FTriGroup.to_soh_xml 2")

triListData = ""
# triListData += "<!-- TriList Start ({triListName}) -->\n".format(triListName = self.triList.name)
triListData += self.triList.to_soh_xml(modelDirPath, objectPath)
# triListData += "<!-- TriList End -->\n"
# writeXMLData(triListData, os.path.join(modelDirPath, self.triList.name))
writeXMLData(triListData, os.path.join(modelDirPath, self.triList.name))

logging_func({"INFO"}, "FTriGroup.to_soh_xml 3")

Expand Down Expand Up @@ -5197,7 +5199,7 @@ def to_binary(self, f3d, segments):
return gsSetImage(f3d.G_SETTIMG, fmt, siz, self.width, imagePtr)

def to_soh_xml(self, objectPath):
name = self.image.name
name = (self.image.filename[:-6] if self.image.filename is not None else self.image.name)
return f"<SetTextureImage Path=\"{('>' + name if '0x' in name else (objectPath + '/' + name))}\" Format=\"{self.fmt}\" Size=\"{self.siz}\" Width=\"{self.width}\"/>"


Expand Down
2 changes: 1 addition & 1 deletion fast64_internal/oot/skeleton/exporter/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def toSohXML(self, isLOD, objectPath):
else:
data += 'Lod" '

DLName = self.DL.name if self.DL is not None else "NULL"
DLName = self.DL.name if self.DL is not None else "gEmptyDL"

if DLName != "gEmptyDL" and DLName != "NULL":
DLName = (objectPath + "/" if len(objectPath) > 0 else ">") + DLName
Expand Down

0 comments on commit 10b9bd2

Please sign in to comment.