View Full Version : Options Box Toggle
MilitantPenguin 10-11-2003, 12:56 AM hi everyone,
I'm fairly new to mel and i've been trying to create a simple script but for the life of me i cant figure it out. What i want to do is write a script that will let me toggle between setting a key via prompt and setting a key at curent frame. I like to use both while animating and having a button on the shelf to toggle would be great. I tired turning on echo all comands and performing the operation but the script wouldnt work at all.
anyone have any ideas?
thanx
|
|
spinlock
10-11-2003, 06:27 AM
I don't really follow what you mean by 'setting a key via prompt'...
like you want a window to pop-up where it says "enter frame" and it will set a key at the frame of whatever number you specify?
also, if you can include your sample code that didn't work it might help us better understand your problem...
ajk48n
10-11-2003, 06:46 AM
He wants to toggle the options for setKeyframe betweent "at current time", and "prompt"
For a beginning question, it was actually quite intensive. The code you want is this:
if (`optionVar -query setKeyframePrompt` == 0)
optionVar -intValue setKeyframePrompt 1;
else
optionVar -intValue setKeyframePrompt 0;
Finding the commands took a little time though. The reason echoing all commands didn't work, is because the option box is in a procedure which is called by another procedure which was called by the setKeyframe command. Follow that? :)
When "echo all commands" was on, setting a keyframe calls:
performSetKeyframeArgList 1 {"0", "animationList"};
You have to go to the Maya script directory, and look through the file "performSetKeyframeArgList.mel" to see what the variable is that controls setting the key at prompt or not. That control is "setKeyFramePrompt".
"optionVar queries preferences, and then sets it depending on what it was.
I hope this helps you out.
Again, a fun beginning question.
MilitantPenguin
10-12-2003, 07:33 PM
Thanx allot ajk that works perfectly. i never thought about using and if statement
CGTalk Moderation
01-16-2006, 07:00 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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.