[Closed] save/Load animation with two buttons
hi guys,
i was wondering if you could say how can i save/Load animation with two buttons,
i know how to make a button in maxscript but donno how can i associate the buttons to the save/load animaton dialog,i mean press one button apears the save animation dialog and press the other apears the load animation dialog.
Thanks,
Ehsan.
What is it you want exactly… you want a script that calls the loadsave animation dialog with a hotkey, or a dialog pops up with two buttons that lets you choose what you want to do?
Also you can assign shortcuts to it in the preferences, is that not what you are after?
-Johan
I exactlly want a button that when i press that,it atuomaticly select the controllers and then save their animaions in a file in directory.
and the a button to load as same above,i mean first slect the controllers then load animation into them.
thanks bro.
Ehsan.
Well, you could start by looking up Interface: LoadSaveAnimation in the docs.
Lots of wounderful stuff there. If you have a particular issue, let me know…
Shane
I think you guys are over thinking his problem. He’s asking how to create a macroScript for save and load animation…
wamo:
- turn on the macroRecorder
- perform an action (any action, in this case, open the Load Animation dialog)
- highlight the text the macroRecorder spits out and drag it to any toolbar
You now have a button that performs that action.
hey hey thanks guys,
sorry,probably a bisically problem with scripting
focomoso just macro recorder lets to use load or save and cant get other scripts through the mapping and targeting i think.
shane
i got what you mean but still a problem
in the Interface: LoadSaveAnimation there is :
<[font=Courier New]filename>LoadSaveAnimation.[b]loadAnimationDlg/b <[size=2][font=Courier New]filename>LoadSaveAnimation.[b]saveAnimationDlg/b[/font][/size][/font]
but now i got problem with that,i mean for filename i write this:
"g:\\Trainings\\my_walk.xaf" LoadSaveAnimation.loadAnimationDlg()
but it returns like this:
– Error occurred in anonymous codeblock; filename: ; position: 0
– Type error: Call needs function or class, got: “g:\Trainings\my_walk.xaf”
and also what’s difrence between this twe?:
(animation of the nodes and animation of the node anims ),cz there were twe difrent methods for these.
so what should i do?
I can see how that might be confusion…The docs say
[left]<string>loadAnimationDlg()
[/left]
[left]Opens the Load Animation dialog. Returns the filename of the selected file, or undefined if the dialog was canceled.
Which means that the function will RETURN TO YOU that name of the file that the user selected, not the file you want to load
Now, if you know the file you want to load, you should be using
[left]<boolean>loadAnimation <filename>fileName <&node array>nodeTab relative:<boolean> insert:<boolean> insertTime:<time> useMapFile:<boolean> mapFileName:<filename>
This is an automated function, in that it will skip over the ui and let you perform many of the tasks automatically…I think i said that
The loadAnimationNodeAnim allows you to load the animation directly the “sub-anims” in the “by reference” array (some reading of the docs might be in order)…personally, i’d stick with the loadanimation function, but that’s me
Shane
[/left]
[/left]
[left]
[/left]
Below is some of my code for my old rig for save/load
on btnLoadAnim pressed do
(
-- Select all controls
clearSelection()
select $*ctrl*
-- Save animation
LoadSaveAnimation.loadAnimationDlg()
clearSelection()
)
on btnSaveAnim pressed do
(
-- Select all controls
clearSelection()
select $*ctrl*
-- Save animation
LoadSaveAnimation.saveAnimationDlg()
clearSelection()
)
LoadAnimationDlg()/saveAnimationDlg() are for calling the dialog. The <filename> in front of it means that the function will return a string consist of the filename after you are done with the dialog for setting and loading/saving.
If you want to load/save without loading the dialog, just refer to loadAnimtion/saveAnimation.
Hope it helps.
hey guys
really thanks
you solved my problem it was realy nessesery,i aprociate it.