50 lines
1.0 KiB
Ruby
Executable File
50 lines
1.0 KiB
Ruby
Executable File
#
|
|
|
|
#
|
|
# Author:: Mark Harrison-Ball <Mark.Harrison-Ball@rockstargames.com>
|
|
# Date:: 20 Februray 2013 (AP3)
|
|
# Purpose:
|
|
# Animation dump
|
|
#
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
# Uses
|
|
#-----------------------------------------------------------------------------
|
|
require 'System.Core'
|
|
include System
|
|
include System::IO
|
|
include System::Diagnostics
|
|
|
|
class AnimDump
|
|
def initialize(config, log)
|
|
@config = config
|
|
@log = log
|
|
@log.message('Anim Dump init')
|
|
@extractPath = System::IO::Path.GetTempPath()
|
|
|
|
end
|
|
|
|
def dump(filename)
|
|
commandline = "$(toolsbin)/anim/animdump.exe"
|
|
cmd_exe = @config.Environment.Subst(commandline)
|
|
|
|
args = cmd_exe
|
|
args += " -anim "
|
|
args += filename
|
|
args += " -values -track -eulers "
|
|
args += " > #{filename}.txt" # Write to file
|
|
|
|
@log.message(args)
|
|
|
|
exit_code = system args
|
|
|
|
if exit_code then
|
|
@log.Message("Anim Extracted ok")
|
|
else
|
|
@log.Error("Errors extracting animations, see log")
|
|
end
|
|
|
|
|
|
end
|
|
end |