SimplyMaya
Community
The SimplyMaya Forums
View all Forums
A place you can ask or answer VFX related questions
Latest forum posts
Safari browser for Simply Maya?
Wireframe Playblaster for Maya - Render Your Wireframes With Ease!
Mr Bean Animation
Boolean>Difference - Problem
specular highlights at UV seam
Rig explodes when translation on splineIK on spine
News and articles
News & Articles
Vfx related news and articles
Random news
Make Liquids Bubble in Maya with the Free Particle to Bubble Script
Texture collaboration system (Coming Soon)
Upload or Download textures
A place to download great textures or share your own with the community
Legacy Resources
Latest uploads to our system
View new Posts
Edit your profile
View threads your subscribed to
User control panel
Training
Maya Training and Tutorials
View all training
View hundreds of hours of Maya training online or via download
Looking for something specific?
Focus on Archviz & Environments
Focus on Organics
Focus on Hard Surface
Focus on Lighting, Rendering & Texturing
Focus on Dynamics, Rigging & Animation
Post Production
Training options on SimplyMaya
Current member status:
Not logged in
Create Account
Pick a streaming payment plan
We offer several different subscription options for our online training
Try streaming for free
Watch up-to three hours of training over a 10 day period for free
Buy training for download
Choose the content you want and buy it outright, downloads don't expire and you can keep them for as long as you'd like
Latest training
Integrating 3D models with photography
Substance Painter 2017
Complex UV Layout in Maya 2018
Training you might like
Creating character renders in Maya 2017 and Arnold
Creating characters In Maya and Zbrush
If you want to ask a SimplyMaya training related question use this forum:
SimplyMaya tutorials
Create Account
Sign in
Username
Password
Sign in
Forgot Password?
SimplyMaya Forums
Welcome to the forum, feel free to ask questions here.
SM Forums
/
Maya Questions
/
Programming
/ Current Time goes to selected Key frame?
Register
FAQ
Calendar
Mark Forums Read
Programming
MEL Scripts, Expressions & Programming Related Topics
Join the conversation. Reply to post
Thread Tools
08-04-2019, 07:43 PM
#
1
Louaye
Registered User
Join Date: Mar 2007
Posts: 1
Current Time goes to selected Key frame?
Hello Script Wizards!
I'm looking for a script that will change the current time to whatever key frame I have selected.
For example, in the graph editor, I'm on frame 30. I select a key on a curve on frame 50, run the script, and it will change the current time from 30 to 50.
I'm trying to write the script myself but I don't know how to query the time from a selected key frame. My scripting skills are weak! Any help will be appreciated.
THANK YOU!
Reply with quote
Louaye
View Public Profile
Find More Posts by Louaye
05-09-2019, 11:21 PM
#
2
Intuition
Registered User
Join Date: Sep 2019
Posts: 2
You can do this pretty easy.
you can use the keyframe mel command to do a query.
keyframe -query -lastSelected -timeChange;
Whatever keyframe you last select in the graph editor the mel command above will report the frame number as the result.
Then there is a basic mel command which sets the current time.
currentTime 105;
The "105" entered above is just an example that will set the current frame to frame 105. But you can make it any frame you want.
So in order to script this you'll want to save the result of the first query into a variable.
Perhaps a float variable since you are saving a numeric value.
Use a variable name that matches what you are doing so you know what the variable is for.
Like $grabTime.
Tnen use that variable as the input for currentTime.
So like this. Copy paste the lines below this one.
// select keyframe in graph editor then run this.
float $grabTime[]=`keyframe -query -lastSelected -timeChange`;
//set currentTime to result saved in variable.
currentTime $grabTime[0];
Reply with quote
Intuition
View Public Profile
Find More Posts by Intuition
Reply
«
Previous Thread
|
Next Thread
»
Thread Tools
Show Printable Version
Email this Page
Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Crash when painting weights
Krazypoe
Maya Technical Issues
0
07-12-2014
11:58 PM
Key Framing Issues
coldsnap
Maya Basics & Newbie Lounge
1
09-10-2013
07:39 PM
procedure within procedure.???
ieoie
Programming
12
07-10-2013
09:20 PM
Theoretical Physics and the Quantum Mind
G-Man
Maya Basics & Newbie Lounge
80
30-05-2010
09:16 PM
Batch rendering seems to repeat itself
alienscience
Maya Basics & Newbie Lounge
7
01-02-2005
08:19 PM