PDA

View Full Version : save/Load animation with two buttons


wamo
01-31-2008, 07:02 AM
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.

JHN
01-31-2008, 07:19 AM
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

wamo
01-31-2008, 09:01 AM
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.

wamo
01-31-2008, 08:24 PM
hey guys it's orgunt if someone know what should i do plz replay. :hmm:

RustyKnight
01-31-2008, 10:30 PM
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

focomoso
02-01-2008, 01:34 AM
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.

RustyKnight
02-01-2008, 02:09 AM
I think you guys are over thinking his problem.Hay, it's what I get paid for ;)

wamo
02-01-2008, 03:44 AM
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 :
<filename>LoadSaveAnimation.loadAnimationDlg() <filename>LoadSaveAnimation.saveAnimationDlg()
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?

RustyKnight
02-01-2008, 04:07 AM
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 :
<filename>LoadSaveAnimation.loadAnimationDlg() <filename>LoadSaveAnimation.saveAnimationDlg()
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
<string>loadAnimationDlg()

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
<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 :P

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

Teirz
02-01-2008, 04:16 AM
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.

wamo
02-01-2008, 04:51 AM
hey guys :)
really thanks
you solved my problem it was realy nessesery,i aprociate it.:)

CGTalk Moderation
02-01-2008, 04:51 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.