Skip to content

Commit 0ba32b3

Browse files
committed
cleanup and fixes (HarbourMasters#43)
1 parent c814228 commit 0ba32b3

10 files changed

Lines changed: 17 additions & 127 deletions

File tree

__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import bpy
2-
32
from bpy.utils import register_class, unregister_class
43
from bpy.path import abspath
54

@@ -27,7 +26,8 @@
2726
from .fast64_internal.z64.actor.properties import initOOTActorProperties
2827
from .fast64_internal.utility_anim import utility_anim_register, utility_anim_unregister, ArmatureApplyWithMeshOperator
2928

30-
from .fast64_internal.mk64 import MK64_Properties, mk64_register, mk64_unregister
29+
from .fast64_internal.mk64 import mk64_register, mk64_unregister
30+
from .fast64_internal.mk64.mk64_properties import MK64_ObjectProperties, MK64_Properties
3131
from .fast64_internal.mk64.mk64_constants import mk64_world_defaults
3232

3333
from .fast64_internal.f3d.f3d_gbi import get_F3D_GBI
@@ -72,7 +72,7 @@
7272
"version": (2, 5, 3),
7373
"author": "kurethedead",
7474
"location": "3DView",
75-
"description": "Plugin for exporting F3D display lists and other game data related to Nintendo 64 games. Modified for HM64 Ship of Harkinian.",
75+
"description": "Plugin for exporting F3D display lists and other game data related to Nintendo 64 games.",
7676
"category": "Import-Export",
7777
"blender": (3, 2, 0),
7878
}
@@ -291,7 +291,7 @@ class Fast64_ObjectProperties(bpy.types.PropertyGroup):
291291

292292
sm64: bpy.props.PointerProperty(type=SM64_ObjectProperties, name="SM64 Object Properties")
293293
oot: bpy.props.PointerProperty(type=OOT_ObjectProperties, name="Z64 Object Properties")
294-
mk64: bpy.props.PointerProperty(type=MK64_ObjectProperties, name="MK64 Object Properties")
294+
mk64: bpy.props.PointerProperty(type=MK64_Properties, name="MK64 Object Properties")
295295

296296

297297
class Fast64_CurveProperties(bpy.types.PropertyGroup):
@@ -300,7 +300,7 @@ class Fast64_CurveProperties(bpy.types.PropertyGroup):
300300
All new object properties should be children of this property group.
301301
"""
302302

303-
mk64: bpy.props.PointerProperty(type=MK64_ObjectProperties, name="MK64 Curve Properties")
303+
mk64: bpy.props.PointerProperty(type=MK64_Properties, name="MK64 Curve Properties")
304304

305305

306306
class UpgradeF3DMaterialsDialog(bpy.types.Operator):

addon_updater_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1523,7 +1523,7 @@ def register(bl_info):
15231523
# Note: updater.include_branch_list defaults to ['master'] branch if set to
15241524
# none. Example targeting another multiple branches allowed to pull from:
15251525
# updater.include_branch_list = ['master', 'dev']
1526-
updater.include_branch_list = ["hm64"]
1526+
updater.include_branch_list = ["main"]
15271527

15281528
# Only allow manual install, thus prompting the user to open
15291529
# the addon's web page to download, specifically: updater.website

fast64_internal/f3d/f3d_gbi.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import struct
99
import re
1010
import bpy, os, enum, copy
11-
from struct import pack
1211

1312
from ..utility import *
1413

@@ -2688,7 +2687,6 @@ def addMesh(
26882687
self.meshes[final_name] = mesh = FMesh(final_name, self.DLFormat)
26892688
self.onAddMesh(mesh, contextObj)
26902689
return mesh
2691-
>>>>>>> hm64
26922690

26932691
def onAddMesh(self, fMesh, contextObj):
26942692
return
@@ -5084,7 +5082,6 @@ def to_binary(self, f3d, segments):
50845082
words = _SHIFTL(f3d.G_CLEARGEOMETRYMODE, 24, 8), word
50855083
return words[0].to_bytes(4, "big") + words[1].to_bytes(4, "big")
50865084

5087-
50885085
def to_soh_xml(self, objectPath=""):
50895086
if not self.flagList:
50905087
return "<ClearGeometryMode/>"
@@ -6525,5 +6522,5 @@ def to_soh_xml(self):
65256522
DPLoadTLUT_pal16,
65266523
DPLoadTLUT_pal256,
65276524
DPLoadTLUT,
6528-
]
6529-
6525+
]
6526+

fast64_internal/f3d/f3d_writer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,6 +1888,7 @@ def removeDL(sourcePath, headerPath, DLName):
18881888
if DLDataH != originalDataH:
18891889
writeFile(headerPath, DLDataH)
18901890

1891+
18911892
class Fast64_DLRedirectPanel(bpy.types.Panel):
18921893
bl_idname = "FAST64_PT_f3d_redirect"
18931894
bl_label = "F3D Exporter"
@@ -1924,5 +1925,5 @@ def f3d_writer_unregister():
19241925

19251926
del bpy.types.Scene.DLTexDir
19261927
del bpy.types.Scene.DLExportPath
1927-
del bpy.types.Scene.matWriteMethod
1928-
1928+
del bpy.types.Scene.matWriteMethod
1929+

fast64_internal/utility.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ def parentObject(parent, child):
264264
setActiveObject(parent)
265265
bpy.ops.object.parent_set(type="OBJECT", keep_transform=True)
266266

267+
267268
def getFMeshName(
268269
fModel,
269270
vertexGroup,

fast64_internal/z64/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,13 @@
7777
oot_operator_unregister,
7878
)
7979

80+
8081
feature_set_enum = (
8182
("default", "Default", "Default"),
8283
("hackeroot", "HackerOoT", "HackerOoT"),
8384
)
8485

86+
8587
oot_versions_items = [
8688
("Custom", "Custom", "Custom", 0),
8789
("ntsc-1.0", "ntsc-1.0", "ntsc-1.0", 11),

fast64_internal/z64/exporter/skeleton/classes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33

44
from ....f3d.f3d_writer import GfxList
5-
from ....utility import CData, toAlnum
5+
from ....utility import CData, toAlnum, writeXMLData
66

77

88
class OOTSkeleton:

fast64_internal/z64/exporter/skeleton/functions.py

Lines changed: 0 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -229,119 +229,6 @@ def ootConvertArmatureToSkeletonWithMesh(
229229
)
230230

231231

232-
def ootConvertArmatureToXML(
233-
originalArmatureObj: bpy.types.Object,
234-
convertTransformMatrix: mathutils.Matrix,
235-
DLFormat: DLFormat,
236-
savePNG: bool,
237-
drawLayer: str,
238-
settings: OOTSkeletonExportSettings,
239-
logging_func,
240-
):
241-
logging_func({"INFO"}, "ootConvertArmatureToXML 0")
242-
243-
if settings.mode != "Generic" and not settings.isCustom:
244-
importInfo = ootSkeletonImportDict[settings.mode]
245-
skeletonName = importInfo.skeletonName
246-
folderName = importInfo.folderName
247-
overlayName = importInfo.actorOverlayName
248-
flipbookUses2DArray = importInfo.flipbookArrayIndex2D is not None
249-
flipbookArrayIndex2D = importInfo.flipbookArrayIndex2D
250-
isLink = importInfo.isLink
251-
else:
252-
skeletonName = toAlnum(originalArmatureObj.name)
253-
folderName = settings.customAssetIncludeDir
254-
overlayName = settings.actorOverlayName if not settings.isCustom else None
255-
flipbookUses2DArray = settings.flipbookUses2DArray
256-
flipbookArrayIndex2D = settings.flipbookArrayIndex2D if flipbookUses2DArray else None
257-
isLink = False
258-
259-
logging_func(
260-
{"INFO"}, "ootConvertArmatureToXML 1 skeletonName = " + (skeletonName if skeletonName is not None else "<None>")
261-
)
262-
263-
exportPath = bpy.path.abspath(settings.customPath)
264-
isCustomExport = settings.isCustom
265-
removeVanillaData = settings.removeVanillaData
266-
optimize = settings.optimize
267-
fModel = OOTModel(skeletonName, DLFormat, drawLayer)
268-
logging_func({"INFO"}, "ootConvertArmatureToXML 1.5")
269-
skeleton, fModel = ootConvertArmatureToSkeletonWithMesh(
270-
originalArmatureObj, convertTransformMatrix, fModel, skeletonName, not savePNG, drawLayer, optimize
271-
)
272-
273-
logging_func({"INFO"}, "ootConvertArmatureToXML 2")
274-
275-
if originalArmatureObj.ootSkeleton.LOD is not None:
276-
lodSkeleton, fModel = ootConvertArmatureToSkeletonWithMesh(
277-
originalArmatureObj.ootSkeleton.LOD,
278-
convertTransformMatrix,
279-
fModel,
280-
skeletonName + "_lod",
281-
not savePNG,
282-
drawLayer,
283-
optimize,
284-
)
285-
else:
286-
lodSkeleton = None
287-
288-
logging_func({"INFO"}, "ootConvertArmatureToXML 3")
289-
290-
if lodSkeleton is not None:
291-
skeleton.hasLOD = True
292-
limbList = skeleton.createLimbList()
293-
lodLimbList = lodSkeleton.createLimbList()
294-
295-
if len(limbList) != len(lodLimbList):
296-
raise PluginError(
297-
originalArmatureObj.name
298-
+ " cannot use "
299-
+ originalArmatureObj.ootSkeleton.LOD.name
300-
+ "as LOD because they do not have the same bone structure."
301-
)
302-
303-
for i in range(len(limbList)):
304-
limbList[i].lodDL = lodLimbList[i].DL
305-
limbList[i].isFlex |= lodLimbList[i].isFlex
306-
307-
# data = CData()
308-
# data.source += '#include "ultra64.h"\n#include "global.h"\n'
309-
# if not isCustomExport:
310-
# data.source += '#include "' + folderName + '.h"\n\n'
311-
# else:
312-
# data.source += "\n"
313-
314-
data = ""
315-
316-
logging_func({"INFO"}, "ootConvertArmatureToXML 4")
317-
318-
path = ootGetPath(exportPath, isCustomExport, "assets/objects/", folderName, False, True)
319-
logging_func({"INFO"}, "ootConvertArmatureToXML 4.1")
320-
exportData = fModel.to_xml(path, settings.customAssetIncludeDir, logging_func)
321-
logging_func({"INFO"}, "ootConvertArmatureToXML 4.2")
322-
skeletonXML = skeleton.toXML(path, settings.customAssetIncludeDir)
323-
logging_func({"INFO"}, "ootConvertArmatureToXML 4.3")
324-
325-
data += exportData
326-
data += skeletonXML
327-
328-
# if isCustomExport:
329-
# textureArrayData = writeTextureArraysNew(fModel, flipbookArrayIndex2D)
330-
# data.append(textureArrayData)
331-
332-
logging_func({"INFO"}, "ootConvertArmatureToXML 5")
333-
334-
writeXMLData(data, os.path.join(path, skeletonName))
335-
336-
logging_func({"INFO"}, "ootConvertArmatureToXML 6")
337-
338-
# if not isCustomExport:
339-
# writeTextureArraysExisting(bpy.context.scene.ootDecompPath, overlayName, isLink, flipbookArrayIndex2D, fModel)
340-
# addIncludeFiles(folderName, path, skeletonName)
341-
# if removeVanillaData:
342-
# ootRemoveSkeleton(path, folderName, skeletonName)
343-
344-
345232
def ootConvertArmatureToC(
346233
originalArmatureObj: bpy.types.Object,
347234
convertTransformMatrix: mathutils.Matrix,

fast64_internal/z64/scene/operators.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ def execute(self, context):
142142
settings = context.scene.ootSceneExportSettings
143143
levelName = settings.name
144144
option = settings.option
145+
145146
bootOptions = context.scene.fast64.oot.bootupSceneOptions
146147
is_hackeroot_features = is_hackeroot()
147148

fast64_internal/z64/scene/panels.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def draw(self, context):
3737
if not settings.customExport:
3838
self.drawSceneSearchOp(exportBox, settings.option, "Export")
3939
settings.draw_props(exportBox)
40+
4041
exportBox.operator(OOT_ExportScene.bl_idname)
4142

4243
# Scene Importer

0 commit comments

Comments
 (0)