correcting struct declaration
This commit is contained in:
parent
464ddbab4e
commit
dcdfc666a3
@ -364,6 +364,7 @@ class ExportMyFormat(bpy.types.Operator, ExportHelper):
|
|||||||
"\tlong * OTz;\n" +
|
"\tlong * OTz;\n" +
|
||||||
"\tBODY * body;\n" +
|
"\tBODY * body;\n" +
|
||||||
"\tVANIM * anim;\n" +
|
"\tVANIM * anim;\n" +
|
||||||
|
"\tvoid * node;\n" +
|
||||||
"\t} MESH;\n\n")
|
"\t} MESH;\n\n")
|
||||||
|
|
||||||
# CAMPOS
|
# CAMPOS
|
||||||
@ -745,7 +746,7 @@ class ExportMyFormat(bpy.types.Operator, ExportHelper):
|
|||||||
chkProp['isBG'] = 0;
|
chkProp['isBG'] = 0;
|
||||||
|
|
||||||
if m.get('isActor'):
|
if m.get('isActor'):
|
||||||
actorPtr = cleanName
|
actorPtr = m.name
|
||||||
|
|
||||||
if m.get('isLevel'):
|
if m.get('isLevel'):
|
||||||
levelPtr = cleanName
|
levelPtr = cleanName
|
||||||
@ -753,8 +754,8 @@ class ExportMyFormat(bpy.types.Operator, ExportHelper):
|
|||||||
if m.get('isProp'):
|
if m.get('isProp'):
|
||||||
propPtr = cleanName
|
propPtr = cleanName
|
||||||
|
|
||||||
if m.get('isLevel'):
|
# ~ if m.get('isLevel'):
|
||||||
nodePtr = cleanName
|
# ~ nodePtr = cleanName
|
||||||
|
|
||||||
## Vertex animation
|
## Vertex animation
|
||||||
|
|
||||||
@ -1044,7 +1045,7 @@ class ExportMyFormat(bpy.types.Operator, ExportHelper):
|
|||||||
f.write("};\n\n")
|
f.write("};\n\n")
|
||||||
|
|
||||||
|
|
||||||
f.write("MESH * actorPtr = &mesh" + actorPtr + ";\n")
|
f.write("MESH * actorPtr = &mesh" + CleanName(actorPtr) + ";\n")
|
||||||
|
|
||||||
f.write("MESH * levelPtr = &mesh" + levelPtr + ";\n")
|
f.write("MESH * levelPtr = &mesh" + levelPtr + ";\n")
|
||||||
|
|
||||||
@ -1058,11 +1059,11 @@ class ExportMyFormat(bpy.types.Operator, ExportHelper):
|
|||||||
# ToDo :
|
# ToDo :
|
||||||
# Auto-detect which plane the actor is on and set that as curNode
|
# Auto-detect which plane the actor is on and set that as curNode
|
||||||
|
|
||||||
# Planes in the level ( define by 'isLevel' data property for now )
|
# Planes in the level - dict of strings
|
||||||
|
|
||||||
LvlPlanes = {}
|
LvlPlanes = {}
|
||||||
|
|
||||||
# Objects in the level
|
# Objects in the level - dict of strings
|
||||||
|
|
||||||
LvlObjects = {}
|
LvlObjects = {}
|
||||||
|
|
||||||
@ -1113,9 +1114,10 @@ class ExportMyFormat(bpy.types.Operator, ExportHelper):
|
|||||||
|
|
||||||
Yvalues = []
|
Yvalues = []
|
||||||
|
|
||||||
# For each object not a plane and not actor, get its coordinates
|
# For each object not a plane, get its coordinates
|
||||||
|
|
||||||
if not o.data.get('isLevel') and not o.data.get('isActor') :
|
# ~ if not o.data.get('isLevel') and not o.data.get('isActor') :
|
||||||
|
if not o.data.get('isLevel'):
|
||||||
|
|
||||||
# World matrix is used to convert local to global coordinates
|
# World matrix is used to convert local to global coordinates
|
||||||
|
|
||||||
@ -1168,11 +1170,19 @@ class ExportMyFormat(bpy.types.Operator, ExportHelper):
|
|||||||
|
|
||||||
for o in LvlObjects:
|
for o in LvlObjects:
|
||||||
|
|
||||||
# If object is above plane ..
|
# If object is above plane
|
||||||
|
|
||||||
if isInPlane(p, o) == 1:
|
if isInPlane(p, o) == 1:
|
||||||
|
|
||||||
# .. add this object to the plane's list
|
# If actor is on this plane, use it as starting node
|
||||||
|
|
||||||
|
if o == actorPtr:
|
||||||
|
|
||||||
|
nodePtr = p
|
||||||
|
|
||||||
|
break
|
||||||
|
|
||||||
|
# Add this object to the plane's list
|
||||||
|
|
||||||
if 'objects' in PlanesObjects[p]:
|
if 'objects' in PlanesObjects[p]:
|
||||||
|
|
||||||
@ -1231,8 +1241,26 @@ class ExportMyFormat(bpy.types.Operator, ExportHelper):
|
|||||||
|
|
||||||
# Write PARENTNODE structure
|
# Write PARENTNODE structure
|
||||||
|
|
||||||
|
nSiblings = 0
|
||||||
|
|
||||||
|
if 'S' in PlanesObjects[p]['siblings']:
|
||||||
|
|
||||||
|
nSiblings += len(PlanesObjects[p]['siblings']['S'])
|
||||||
|
|
||||||
|
if 'N' in PlanesObjects[p]['siblings']:
|
||||||
|
|
||||||
|
nSiblings += len(PlanesObjects[p]['siblings']['N'])
|
||||||
|
|
||||||
|
if 'E' in PlanesObjects[p]['siblings']:
|
||||||
|
|
||||||
|
nSiblings += len(PlanesObjects[p]['siblings']['E'])
|
||||||
|
|
||||||
|
if 'W' in PlanesObjects[p]['siblings']:
|
||||||
|
|
||||||
|
nSiblings += len(PlanesObjects[p]['siblings']['W'])
|
||||||
|
|
||||||
f.write("PARENTNODE node" + pName + "_siblings = {\n" +
|
f.write("PARENTNODE node" + pName + "_siblings = {\n" +
|
||||||
"\t" + str(len(PlanesObjects[p]['siblings'])) + ",\n" +
|
"\t" + str(nSiblings) + ",\n" +
|
||||||
"\t{\n")
|
"\t{\n")
|
||||||
|
|
||||||
if 'siblings' in PlanesObjects[p]:
|
if 'siblings' in PlanesObjects[p]:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user