Skip to content
Snippets Groups Projects
Commit 24349481 authored by Candoran2's avatar Candoran2 Committed by neomonkeus
Browse files

Changed armature export so that the pose position (pose or rest) is preserved.

parent d22cc667
No related branches found
No related tags found
No related merge requests found
...@@ -452,7 +452,7 @@ class Mesh: ...@@ -452,7 +452,7 @@ class Mesh:
# update bind position skinning data # update bind position skinning data
# trishape.update_bind_position() # trishape.update_bind_position()
# override pyffi ttrishape.update_bind_position with custom one that is relative to the nif root # override pyffi trishape.update_bind_position with custom one that is relative to the nif root
self.update_bind_position(trishape, n_root) self.update_bind_position(trishape, n_root)
# calculate center and radius for each skin bone data block # calculate center and radius for each skin bone data block
...@@ -720,6 +720,7 @@ class Mesh: ...@@ -720,6 +720,7 @@ class Mesh:
# get the armature influencing this mesh, if it exists # get the armature influencing this mesh, if it exists
b_armature_obj = b_obj.find_armature() b_armature_obj = b_obj.find_armature()
if b_armature_obj: if b_armature_obj:
old_position = b_armature_obj.data.pose_position
b_armature_obj.data.pose_position = 'REST' b_armature_obj.data.pose_position = 'REST'
# make sure the model has a triangulation modifier # make sure the model has a triangulation modifier
...@@ -730,7 +731,7 @@ class Mesh: ...@@ -730,7 +731,7 @@ class Mesh:
eval_obj = b_obj.evaluated_get(dg) eval_obj = b_obj.evaluated_get(dg)
eval_mesh = eval_obj.to_mesh(preserve_all_data_layers=True, depsgraph=dg) eval_mesh = eval_obj.to_mesh(preserve_all_data_layers=True, depsgraph=dg)
if b_armature_obj: if b_armature_obj:
b_armature_obj.data.pose_position = 'POSE' b_armature_obj.data.pose_position = old_position
return eval_mesh return eval_mesh
def ensure_tri_modifier(self, b_obj): def ensure_tri_modifier(self, b_obj):
......
...@@ -100,11 +100,7 @@ class NifExport(NifCommon): ...@@ -100,11 +100,7 @@ class NifExport(NifCommon):
return {'FINISHED'} return {'FINISHED'}
for b_obj in self.exportable_objects: for b_obj in self.exportable_objects:
# armatures should not be in rest position if b_obj.type == 'MESH':
if b_obj.type == 'ARMATURE':
b_obj.data.pose_position = 'POSE'
elif b_obj.type == 'MESH':
if b_obj.parent and b_obj.parent.type == 'ARMATURE': if b_obj.parent and b_obj.parent.type == 'ARMATURE':
for b_mod in b_obj.modifiers: for b_mod in b_obj.modifiers:
if b_mod.type == 'ARMATURE' and b_mod.use_bone_envelopes: if b_mod.type == 'ARMATURE' and b_mod.use_bone_envelopes:
......
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