Fixed empty Vtx[] declarations. Added option for which refresh function map to choose.

This commit is contained in:
kurethedead
2019-12-06 01:04:58 -08:00
parent 7eda4adf6b
commit 81e3239973
6 changed files with 6315 additions and 3156 deletions
+9
View File
@@ -31,6 +31,11 @@ enumExportType = [
('Insertable Binary', 'Insertable Binary', 'Insertable Binary')
]
enumRefreshVer = [
("Refresh 3", "Refresh 3", "Refresh 3"),
("Refresh 4", "Refresh 4", "Refresh 4"),
]
panelSeparatorSize = 5
def checkExpanded(filepath):
@@ -1440,6 +1445,7 @@ class SM64_FileSettingsPanel(bpy.types.Panel):
col.prop(context.scene, 'outputRom')
col.prop(context.scene, 'extendBank4')
col.prop(context.scene, 'decomp_compatible')
prop_split(col, context.scene, 'refreshVer', 'Decomp Func Map')
class SM64_AddressConvertPanel(bpy.types.Panel):
bl_idname = "SM64_PT_addr_conv"
@@ -1708,6 +1714,8 @@ def register():
name = 'Address')
bpy.types.Scene.levelConvert = bpy.props.EnumProperty(
items = level_enums, name = 'Level', default = 'IC')
bpy.types.Scene.refreshVer = bpy.props.EnumProperty(
items = enumRefreshVer, name = 'Refresh', default = 'Refresh 4')
bpy.types.Scene.characterIgnoreSwitch = \
bpy.props.BoolProperty(name = 'Ignore Switch Nodes', default = True)
@@ -1824,6 +1832,7 @@ def unregister():
del bpy.types.Scene.extendBank4
del bpy.types.Scene.convertibleAddr
del bpy.types.Scene.levelConvert
del bpy.types.Scene.refreshVer
mat_unregister()
bone_unregister()
+9 -10
View File
@@ -1,27 +1,26 @@
import re
# function map.txt is build/us/sm64.us.map, but
# only the text after "Linker script and memory map"
# and before "build/us/src/game/main.o(.data*)"
function_map_path = './function map.txt'
output_map_path = './sm64_function_map.py'
refresh_name = 'Refresh 4'
function_map_path = './sm64.us.map.txt'
output_map_path = './sm64_function_map_output.py'
def parse_func_map():
mapfile = open(function_map_path, 'r')
outfile = open(output_map_path, 'w')
outfile.write('func_map = {\n')
outfile.write('\t"' + refresh_name + '" : {\n')
nextLine = mapfile.readline()
while nextLine != '':
while nextLine != '' and nextLine != 'Linker script and memory map\n':
nextLine = mapfile.readline()
while nextLine != '' and nextLine != ' build/us/src/game/main.o(.data*)\n':
if nextLine[:17] == ' ' * 16 + '0':
outfile.write('\t"' + nextLine[26:34] + '" : ')
outfile.write('\t\t"' + nextLine[26:34] + '" : ')
searchName = nextLine[34:]
searchResult = re.search(r'\s*(\S*).*', searchName)
outfile.write('"' + searchResult.group(1) + '",\n')
nextLine = mapfile.readline()
outfile.write("}\n")
outfile.write("\t}\n")
mapfile.close()
outfile.close()
File diff suppressed because it is too large Load Diff
+3 -2
View File
@@ -303,8 +303,9 @@ class JumpNode:
self.geolayout.name + '),'
def convertAddrToFunc(addr):
if addr.lower() in func_map:
return func_map[addr.lower()]
refresh_func_map = func_map[bpy.context.scene.refreshVer]
if addr.lower() in refresh_func_map:
return refresh_func_map[addr.lower()]
else:
return toAlnum(addr)
+3 -1
View File
@@ -1170,10 +1170,12 @@ def saveModelGivenVertexGroup(fModel, obj, vertexGroup,
#print("Skinned")
fMeshGroup = saveSkinnedMeshByMaterial(skinnedFaces, fModel,
vertexGroup, obj, currentMatrix, parentMatrix, namePrefix, infoDict)
else:
elif len(groupFaces) > 0:
fMeshGroup = FMeshGroup(toAlnum(namePrefix + \
('_' if namePrefix != '' else '') + vertexGroup),
FMesh(toAlnum(namePrefix + vertexGroup) + '_mesh'), None)
else:
return None
# Save mesh group
checkUniqueBoneNames(fModel, toAlnum(namePrefix + \
BIN
View File
Binary file not shown.