Skip to content
Snippets Groups Projects
Commit 87ff389b authored by Campbell Barton's avatar Campbell Barton
Browse files

remove XNA hacks

parent c5639d0a
No related branches found
No related tags found
No related merge requests found
...@@ -197,8 +197,6 @@ class ExportFBX(bpy.types.Operator, ExportHelper): ...@@ -197,8 +197,6 @@ class ExportFBX(bpy.types.Operator, ExportHelper):
use_mesh_edges = BoolProperty( use_mesh_edges = BoolProperty(
name="Include Edges", name="Include Edges",
description=("Edges may not be necessary, can cause import "
"pipeline errors with XNA"),
default=False, default=False,
) )
use_armature_deform_only = BoolProperty( use_armature_deform_only = BoolProperty(
...@@ -238,11 +236,6 @@ class ExportFBX(bpy.types.Operator, ExportHelper): ...@@ -238,11 +236,6 @@ class ExportFBX(bpy.types.Operator, ExportHelper):
default=6.0, default=6.0,
) )
path_mode = path_reference_mode path_mode = path_reference_mode
use_rotate_workaround = BoolProperty(
name="XNA Rotate Animation Hack",
description="Disable global rotation, for XNA compatibility",
default=False,
)
batch_mode = EnumProperty( batch_mode = EnumProperty(
name="Batch Mode", name="Batch Mode",
items=(('OFF', "Off", "Active scene to file"), items=(('OFF', "Off", "Active scene to file"),
......
...@@ -223,7 +223,6 @@ def save_single(operator, scene, filepath="", ...@@ -223,7 +223,6 @@ def save_single(operator, scene, filepath="",
use_metadata=True, use_metadata=True,
path_mode='AUTO', path_mode='AUTO',
use_mesh_edges=True, use_mesh_edges=True,
use_rotate_workaround=False,
use_default_take=True, use_default_take=True,
): ):
...@@ -233,10 +232,6 @@ def save_single(operator, scene, filepath="", ...@@ -233,10 +232,6 @@ def save_single(operator, scene, filepath="",
mtx_x90 = Matrix.Rotation(math.pi / 2.0, 3, 'X') mtx_x90 = Matrix.Rotation(math.pi / 2.0, 3, 'X')
# Used for mesh and armature rotations # Used for mesh and armature rotations
mtx4_z90 = Matrix.Rotation(math.pi / 2.0, 4, 'Z') mtx4_z90 = Matrix.Rotation(math.pi / 2.0, 4, 'Z')
# Rotation does not work for XNA animations. I do not know why but they end up a mess! (JCB)
if use_rotate_workaround:
# Set rotation to Matrix Identity for XNA (JCB)
mtx4_z90.identity()
if global_matrix is None: if global_matrix is None:
global_matrix = Matrix() global_matrix = Matrix()
...@@ -485,10 +480,6 @@ def save_single(operator, scene, filepath="", ...@@ -485,10 +480,6 @@ def save_single(operator, scene, filepath="",
rot = tuple(rot.to_euler()) # quat -> euler rot = tuple(rot.to_euler()) # quat -> euler
scale = tuple(scale) scale = tuple(scale)
# Essential for XNA to use the original matrix not rotated nor scaled (JCB)
if use_rotate_workaround:
matrix = ob.matrix_local
else: else:
# This is bad because we need the parent relative matrix from the fbx parent (if we have one), dont use anymore # This is bad because we need the parent relative matrix from the fbx parent (if we have one), dont use anymore
#if ob and not matrix: matrix = ob.matrix_world * global_matrix #if ob and not matrix: matrix = ob.matrix_world * global_matrix
...@@ -2291,7 +2282,8 @@ Definitions: { ...@@ -2291,7 +2282,8 @@ Definitions: {
}''' % tmp) }''' % tmp)
del tmp del tmp
# Bind pose is essential for XNA if the 'MESH' is included (JCB) # Bind pose is essential for XNA if the 'MESH' is included,
# but could be removed now?
fw(''' fw('''
ObjectType: "Pose" { ObjectType: "Pose" {
Count: 1 Count: 1
...@@ -3047,7 +3039,7 @@ def save(operator, context, ...@@ -3047,7 +3039,7 @@ def save(operator, context,
return {'FINISHED'} # so the script wont run after we have batch exported. return {'FINISHED'} # so the script wont run after we have batch exported.
# APPLICATION REQUIREMENTS # APPLICATION REQUIREMENTS
# Please update the lists for UDK, Unity, XNA etc. on the following web page: # Please update the lists for UDK, Unity etc. on the following web page:
# http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Import-Export/UnifiedFBX # http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Import-Export/UnifiedFBX
# NOTE TO Campbell - # NOTE TO Campbell -
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment