SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Home / forum / Animation / Mel Scripts & Programming / delay reaction script
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 13-01-2004, 07:31 PM   #1
strytus
Registered User
 
Join Date: Dec 2002
Location: east coast
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Default delay reaction script

Hey guys, i'm trying to make a delayed reaction and was hoping a script would justify it. I have looked on the sticky thread and found it to be of good use, but after that i'm stuck. (i'm not a scripter of any sort) Basically i'm using this script for a halo right above my angels head.


I used the:
Attribute of an object at a certain “offset"

int $offset = 10;
int $currentTime = `currentTime -q`;
$offsetTime = $currentTime - $offset;
$cube1Zpos = `getAttr -t $offsetTime pCube1.tz`;
pSphere1.translateZ = $cube1Zpos;

this works well for the only translate Z axis, then i've tried to duplicate it throughout the Y and X axis, but i get a syntax error
here's the modified version of it

int $offset = 10;
int $currentTime = `currentTime -q`;
$offsetTime = $currentTime - $offset;

$cube1Zpos = `getAttr -t $offsetTime pCube1.tz`;
$cube1Ypos = `getAttr -t $offsetTime pCube1.ty`;
$cube1Xpos = `getAttr -t $offsetTime pCube1.tx`;

pSphere1.translateZ = $cube1Zpos;
pSphere1.translateY = $cube1Ypos;
pSphere1.translateX = $cube1Xpos;

any suggestions on how to fix this or get it to work correctly

thanks in advance
strytus is offline   Reply With Quote
Old 20-01-2004, 05:50 PM   #2
Alan
Moderator
 
Alan's Avatar
 
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
Thanks: 0
Thanked 5 Times in 5 Posts
Default

I think you may need to use setAttr rather than saying pSphere1.translateX.

so
setAttr pShere1.tx $cube1Xpos;
setAttr pShere1.ty $cube1Ypos;
setAttr pShere1.tz $cube1Zpos;

try that, is this an expression or a script? cause that will make a difference to your syntax.

Post again if you need more help

Alan
__________________
Technical Director - Framestore

Currently working on: Your Highness

IMDB
Alan is offline   Reply With Quote
Old 21-01-2004, 08:43 AM   #3
strarup
Subscriber
 
Join Date: Jan 2003
Location: Denmark
Posts: 338
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi strytus,

maybe you can use some of this from this tutorial by Swanimator... "Time offset Expression"... -->
http://www.swanimator.com/tipstutori...Expression.htm

regards

Strarup
__________________
------------------------------------------------
Alex V. U. Strarup

One mistake can ruin it all...
strarup is offline   Reply With Quote
Old 24-01-2004, 05:37 AM   #4
strytus
Registered User
 
Join Date: Dec 2002
Location: east coast
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks strarup

but what's the difference between the scripted i typed in and the one that's on the link???? is it only because I done mine is Z, Y, X order instead of the XYZ order?
strytus is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Extremely annoying delay on input boxes in firefox David Members Lounge 0 01-12-2010 05:57 PM

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.