Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OoT] Fixed standalone cutscene export #480

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions fast64_internal/oot/cutscene/operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,24 @@ def execute(self, context):

cpath, hpath, headerfilename = checkGetFilePaths(context)
csdata = ootCutsceneIncludes(headerfilename)
cs_name = activeObj.name.removeprefix("Cutscene.")

if context.scene.fast64.oot.exportMotionOnly:
# TODO: improve this
csdata.append(insertCutsceneData(cpath, activeObj.name.removeprefix("Cutscene.")))
csdata.append(insertCutsceneData(cpath, cs_name))
else:
csdata.append(Cutscene(activeObj, context.scene.fast64.oot.useDecompFeatures).getC())
cutscene = Cutscene.new(
cs_name,
activeObj,
context.scene.fast64.oot.useDecompFeatures,
context.scene.fast64.oot.exportMotionOnly,
)

if cutscene is not None:
csdata.append(cutscene.getC())
else:
raise PluginError(f"ERROR: can't process cutscene '{cs_name}'.")

writeCData(csdata, hpath, cpath)

self.report({"INFO"}, "Successfully exported cutscene")
Expand Down Expand Up @@ -218,7 +230,19 @@ def execute(self, context):
if context.scene.fast64.oot.exportMotionOnly:
raise PluginError("ERROR: Not implemented yet.")
else:
csdata.append(Cutscene(obj, context.scene.fast64.oot.useDecompFeatures).getC())
cs_name = obj.name.removeprefix("Cutscene.")
cutscene = Cutscene.new(
cs_name,
obj,
context.scene.fast64.oot.useDecompFeatures,
context.scene.fast64.oot.exportMotionOnly,
)

if cutscene is not None:
csdata.append(cutscene.getC())
else:
raise PluginError(f"ERROR: can't process cutscene '{cs_name}'.")

count += 1

if count == 0:
Expand Down