Instantly share code, notes, and snippets.

Embed
What would you like to do?
Creates a new max scene for animation, and associates it with original
studioLib()
drvLibGame()
--Created by Corey Wolff
--This creates a new max scene, and saves it out to the animation folder, it also creates a persistent variable
--so that it can reload the rig and mesh easily when the 'update animation' script is used.
--make ref to orignal file
--save file in new location
fn GetNewAnimLocation _currentLocation = (
_theBits = filterstring _currentLocation @"\"
_destination = ""
for i = 1 to (_theBits.Count - 1) do (
_destination += _theBits[i]
_destination += @"\"
)
_destination += @"Animation\"
print _destination
return _destination
)
fn GetNewFileName _animName = (
_theBits = filterstring mfn @"_"
_fileName = ""
for i = 1 to 3 do (
_fileName += _theBits[i]
_fileName += "_"
)
_fileName += "Anim_" + _animName + "_v001_t001.max"
return _fileName
)
if(refFile == undefined) then (
persistent global refFile = (mfp + mfn)
)
_makeAnim
try(destroydialog _makeAnim) catch()
Rollout _makeAnim "Create Animation"(
editText _animName "Animation Name:"
button _doTheThing "Make Animation"
on _doTheThing pressed do (
savemaxfile ((GetNewAnimLocation mfp) + (GetNewFileName _animName.text))
)
)
createdialog _makeAnim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment