Skip to content

Commit c649495

Browse files
authored
Merge pull request #593 from svip/pirates_kf
Added support for KF export for Sid Meier's Pirates!
2 parents 9387125 + 05641f7 commit c649495

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

io_scene_niftools/modules/nif_export/animation/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,11 @@ def __init__(self):
5353

5454
def set_flags_and_timing(self, kfc, exp_fcurves, start_frame=None, stop_frame=None):
5555
# fill in the non-trivial values
56-
kfc.flags = 8 # active
56+
kfc.flags._value = 8 # active
5757
kfc.flags |= self.get_flags_from_fcurves(exp_fcurves)
58+
if bpy.context.scene.niftools_scene.game == 'SID_MEIER_S_PIRATES':
59+
# Sid Meier's Pirates! want the manager_controlled flag set
60+
kfc.flags.manager_controlled = True
5861
kfc.frequency = 1.0
5962
kfc.phase = 0.0
6063
if not start_frame and not stop_frame:

io_scene_niftools/modules/nif_export/animation/transform.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def export_kf_root(self, b_armature=None):
7474
kf_root = block_store.create_block("NiSequenceStreamHelper")
7575
elif game in (
7676
'SKYRIM', 'OBLIVION', 'FALLOUT_3', 'CIVILIZATION_IV', 'ZOO_TYCOON_2', 'FREEDOM_FORCE_VS_THE_3RD_REICH',
77-
'MEGAMI_TENSEI_IMAGINE'):
77+
'MEGAMI_TENSEI_IMAGINE', 'SID_MEIER_S_PIRATES'):
7878
kf_root = block_store.create_block("NiControllerSequence")
7979
else:
8080
raise NifError(f"Keyframe export for '{game}' is not supported.")
@@ -109,6 +109,8 @@ def export_kf_root(self, b_armature=None):
109109
kf_root.weight = 1.0
110110
kf_root.cycle_type = NifClasses.CycleType.CYCLE_CLAMP
111111
kf_root.frequency = 1.0
112+
if game in ('SID_MEIER_S_PIRATES',):
113+
kf_root.accum_root_name = targetname
112114

113115
if anim_textextra.num_text_keys > 0:
114116
kf_root.start_time = anim_textextra.text_keys[0].time

0 commit comments

Comments
 (0)