mirror of
https://github.com/ApfelTeeSaft/lightspeed64.git
synced 2026-09-03 04:13:35 +00:00
You can now skin scross switch nodes for the first option, which will work with material/draw layer overrides. Fixed geolayout import bugs.
This commit is contained in:
@@ -275,7 +275,7 @@ def getBinaryBank0F3DData(fModel, RAMAddr, exportRange):
|
||||
|
||||
def checkForF3DMaterial(obj):
|
||||
if len(obj.material_slots) == 0:
|
||||
raise ValueError(obj.name + " has no Fast3D material.")
|
||||
raise ValueError(obj.name + " has no Fast3D material. Make sure to add a Fast3D material to it.")
|
||||
for materialSlot in obj.material_slots:
|
||||
if materialSlot.material is None or \
|
||||
not materialSlot.material.is_f3d:
|
||||
|
||||
@@ -618,8 +618,9 @@ def parseDL(romfile, currentAddress, currentTransform, bMesh, obj, armatureObj,
|
||||
currentTransform, True, command, segmentData, bMesh, obj,
|
||||
nodeIndex, 'DisplayList', vertexBuffer,
|
||||
f3dType, isHWv1)
|
||||
bone = armatureObj.data.bones[boneName]
|
||||
bone.draw_layer = str(drawLayer)
|
||||
if armatureObj is not None:
|
||||
bone = armatureObj.data.bones[boneName]
|
||||
bone.draw_layer = str(drawLayer)
|
||||
|
||||
currentAddress += commandSize
|
||||
return currentAddress
|
||||
@@ -857,8 +858,9 @@ def parseTranslate(romfile, currentAddress,
|
||||
finalTransform, loadDL, command, segmentData, bMesh, obj,
|
||||
nodeIndex, 'Translate', vertexBuffer,
|
||||
f3dType, isHWv1)
|
||||
bone = armatureObj.data.bones[boneName]
|
||||
bone.draw_layer = str(drawLayer)
|
||||
if armatureObj is not None:
|
||||
bone = armatureObj.data.bones[boneName]
|
||||
bone.draw_layer = str(drawLayer)
|
||||
else:
|
||||
boneName = None
|
||||
|
||||
@@ -891,8 +893,9 @@ def parseRotate(romfile, currentAddress,
|
||||
finalTransform, loadDL, command, segmentData, bMesh, obj,
|
||||
nodeIndex, 'Rotate', vertexBuffer,
|
||||
f3dType, isHWv1)
|
||||
bone = armatureObj.data.bones[boneName]
|
||||
bone.draw_layer = str(drawLayer)
|
||||
if armatureObj is not None:
|
||||
bone = armatureObj.data.bones[boneName]
|
||||
bone.draw_layer = str(drawLayer)
|
||||
else:
|
||||
boneName = None
|
||||
|
||||
@@ -925,8 +928,9 @@ def parseBillboard(romfile, currentAddress,
|
||||
finalTransform, loadDL, command, segmentData, bMesh, obj,
|
||||
nodeIndex, 'Billboard', vertexBuffer,
|
||||
f3dType, isHWv1)
|
||||
bone = armatureObj.data.bones[boneName]
|
||||
bone.draw_layer = str(drawLayer)
|
||||
if armatureObj is not None:
|
||||
bone = armatureObj.data.bones[boneName]
|
||||
bone.draw_layer = str(drawLayer)
|
||||
else:
|
||||
boneName = None
|
||||
|
||||
|
||||
@@ -418,9 +418,9 @@ def generateSwitchOptions(transformNode, geolayout, geolayoutGraph, prefix):
|
||||
copyNode = optionGeolayout.nodes[0]
|
||||
|
||||
#i -= 1
|
||||
# Assumes first child is a jump node to option 0
|
||||
# Assumes first child is a start node, where option 0 is
|
||||
# assumes overrideChild starts with a Start node
|
||||
option0Nodes = transformNode.children[0].node.geolayout.nodes
|
||||
option0Nodes = [transformNode.children[0]]
|
||||
if len(option0Nodes) == 1 and \
|
||||
isinstance(option0Nodes[0].node, StartNode):
|
||||
for startChild in option0Nodes[0].children:
|
||||
@@ -787,18 +787,22 @@ def processBone(fModel, boneName, obj, armatureObj, transformMatrix,
|
||||
else:
|
||||
#print(boneGroup.name if boneGroup is not None else "Offset")
|
||||
if len(bone.children) > 0:
|
||||
optionGeolayout = \
|
||||
geolayoutGraph.addGeolayout(
|
||||
transformNode, boneName + '_opt0')
|
||||
geolayoutGraph.addJumpNode(transformNode, geolayout,
|
||||
optionGeolayout)
|
||||
optionGeolayout.nodes.append(TransformNode(StartNode()))
|
||||
#optionGeolayout = \
|
||||
# geolayoutGraph.addGeolayout(
|
||||
# transformNode, boneName + '_opt0')
|
||||
#geolayoutGraph.addJumpNode(transformNode, geolayout,
|
||||
# optionGeolayout)
|
||||
#optionGeolayout.nodes.append(TransformNode(StartNode()))
|
||||
nextStartNode = TransformNode(StartNode())
|
||||
transformNode.children.append(nextStartNode)
|
||||
nextStartNode.parent = transformNode
|
||||
|
||||
childrenNames = sorted([bone.name for bone in bone.children])
|
||||
for name in childrenNames:
|
||||
processBone(fModel, name, obj, armatureObj,
|
||||
finalTransform, lastTranslateName, lastRotateName,
|
||||
lastDeformName, optionGeolayout.nodes[0], materialOverrides,
|
||||
namePrefix, optionGeolayout,
|
||||
lastDeformName, nextStartNode, materialOverrides,
|
||||
namePrefix, geolayout,
|
||||
geolayoutGraph, infoDict)
|
||||
#transformNode.children.append(childNode)
|
||||
#childNode.parent = transformNode
|
||||
|
||||
Reference in New Issue
Block a user