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
Blender Institute releases Agent 327: Operation Barbershop teaser
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
Maya for 3D Printing - Rapid Prototyping
Spach-Alspaugh House and Environment Volume 4
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
/ Using expressions on multiple objects
Register
FAQ
Calendar
Mark Forums Read
Programming
MEL Scripts, Expressions & Programming Related Topics
Join the conversation. Reply to post
Thread Tools
21-10-2008, 08:10 AM
#
1
bendingiscool
Subscriber
Join Date: Jul 2006
Location: London
Posts: 567
Using expressions on multiple objects
Hey guys,
Basically what I am after is a way of running an expression on multiple objects, for instance...
polySphere -name "ball";
expression -s "ball.translateX = time;" -o pSphere1 -ae 1 -uc all ;
will make the ball head in the X direction over time, but how would I be able to select multiple objects and giving each of them this expression, as the expression above is only going to work on the first object.
Many thanks in advance as this is bugging me loads
Chris
Reply with quote
bendingiscool
View Public Profile
Visit bendingiscool's homepage!
Find More Posts by bendingiscool
22-10-2008, 01:46 AM
#
2
gster123
Moderator
Join Date: May 2005
Location: Manchester Uk
Posts: 6,300
Could you not create an array to hold the object names and have it go through that?
__________________
"No pressure, no diamonds" Thomas Carlyle
Reply with quote
gster123
View Public Profile
Visit gster123's homepage!
Find More Posts by gster123
22-10-2008, 05:43 AM
#
3
bendingiscool
Subscriber
Join Date: Jul 2006
Location: London
Posts: 567
Turns out I was just going at it in an overcomplicated fashion, here's the working script...
//give expression to all selected
for($n in `ls -sl`){
expression -s ($n + ".translateX = time;") -o $n -ae 1 -uc all ;
}
Cheers,
Chris
Reply with quote
bendingiscool
View Public Profile
Visit bendingiscool's homepage!
Find More Posts by bendingiscool
Reply
«
Previous Thread
|
Next Thread
»
Thread Tools
Show Printable Version
Email this Page
Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
using mel to select multiple objects
davad138
Programming
2
29-01-2020
03:10 PM
Objects move inconsistently when I move multiple
MrSandman
Maya Technical Issues
5
20-04-2015
08:13 PM
adjust multiple objects at once
cobair
Maya Materials & Textures
2
05-10-2012
01:23 PM
Strange Problem - Unable to change attributes for multiple objects
anthonysw3
Maya Technical Issues
4
04-12-2010
11:56 PM
Problems with multiple collision objects
Uglynakedguy
Maya Technical Issues
1
08-05-2008
01:06 AM