add NODE struct
This commit is contained in:
parent
ffa48bb8e3
commit
55af8e8406
@ -57,7 +57,6 @@ class ExportMyFormat(bpy.types.Operator, ExportHelper):
|
|||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
|
|
||||||
|
|
||||||
def triangulate_object(obj): # Stolen from here : https://blender.stackexchange.com/questions/45698/triangulate-mesh-in-python/45722#45722
|
def triangulate_object(obj): # Stolen from here : https://blender.stackexchange.com/questions/45698/triangulate-mesh-in-python/45722#45722
|
||||||
me = obj.data
|
me = obj.data
|
||||||
# Get a BMesh representation
|
# Get a BMesh representation
|
||||||
@ -219,6 +218,13 @@ class ExportMyFormat(bpy.types.Operator, ExportHelper):
|
|||||||
"\tVECTOR points[];\n" +
|
"\tVECTOR points[];\n" +
|
||||||
"\t} CAMPATH;\n\n")
|
"\t} CAMPATH;\n\n")
|
||||||
|
|
||||||
|
# NODE struc
|
||||||
|
f.Write("typedef struct {\n" +
|
||||||
|
"\tMESH * curPlane;\n" +
|
||||||
|
"\tMESH * siblings[];" +
|
||||||
|
"\tMESH * objects[];" +
|
||||||
|
"\t} NODE;\n\n")
|
||||||
|
|
||||||
camPathPoints = []
|
camPathPoints = []
|
||||||
|
|
||||||
first_mesh = CleanName(bpy.data.meshes[0].name)
|
first_mesh = CleanName(bpy.data.meshes[0].name)
|
||||||
@ -326,6 +332,7 @@ class ExportMyFormat(bpy.types.Operator, ExportHelper):
|
|||||||
actorPtr = first_mesh
|
actorPtr = first_mesh
|
||||||
levelPtr = first_mesh
|
levelPtr = first_mesh
|
||||||
propPtr = first_mesh
|
propPtr = first_mesh
|
||||||
|
nodePtr = first_mesh
|
||||||
|
|
||||||
timList = []
|
timList = []
|
||||||
|
|
||||||
@ -479,6 +486,8 @@ class ExportMyFormat(bpy.types.Operator, ExportHelper):
|
|||||||
if m.get('isProp'):
|
if m.get('isProp'):
|
||||||
propPtr = cleanName
|
propPtr = cleanName
|
||||||
|
|
||||||
|
if m.get('isLevel'):
|
||||||
|
nodePtr = cleanName
|
||||||
# write vertex anim if isAnim != 0 # https://stackoverflow.com/questions/9138637/vertex-animation-exporter-for-blender
|
# write vertex anim if isAnim != 0 # https://stackoverflow.com/questions/9138637/vertex-animation-exporter-for-blender
|
||||||
if m.get("isAnim") is not None and m["isAnim"] != 0:
|
if m.get("isAnim") is not None and m["isAnim"] != 0:
|
||||||
|
|
||||||
@ -695,6 +704,8 @@ class ExportMyFormat(bpy.types.Operator, ExportHelper):
|
|||||||
|
|
||||||
f.write("CAMANGLE * camPtr = &camAngle_" + CleanName(defaultCam) + ";\n\n")
|
f.write("CAMANGLE * camPtr = &camAngle_" + CleanName(defaultCam) + ";\n\n")
|
||||||
|
|
||||||
|
f.write("NODE * curNode = &node_" + nodePtr + ";\n\n")
|
||||||
|
|
||||||
# set default cam back
|
# set default cam back
|
||||||
if defaultCam != 'NULL':
|
if defaultCam != 'NULL':
|
||||||
bpy.context.scene.camera = bpy.data.objects[defaultCam]
|
bpy.context.scene.camera = bpy.data.objects[defaultCam]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user