SimplyMaya Forums

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

Home / forum / Lounges / Maya Basics & Newbie Lounge / Random initial spin to active rigid body.
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 03-02-2003, 12:19 AM   #1
grunze
Registered User
 
grunze's Avatar
 
Join Date: Nov 2002
Posts: 117
Thanks: 0
Thanked 0 Times in 0 Posts
Default Random initial spin to active rigid body.

Does anyone know how to assign a random initial spin to whole bunch of rigid bodies, so i dont have to go into each one and do it manually?

Thanks!!!!!!

:banana:
__________________
Thanks,
Ari
grunze is offline   Reply With Quote
Old 03-02-2003, 05:16 AM   #2
ragecgi
Super Moderator
 
ragecgi's Avatar
 
Join Date: Sep 2002
Location: Minnesota, USA
Posts: 3,709
Thanks: 0
Thanked 13 Times in 12 Posts
Default

Well, long story short, you could use an expression like this:

Select all of your rigid objects in the viewport, then in the channelbox, highlight the x,y and z initialSpin attributes, right-click and choose expressions, and paste this into the box:

RigidObjectName|SolverName.initialSpinX = rand(1,2);
RigidObjectName|SolverName.initialSpinY = rand(1,2);
RigidObjectName|SolverName.initialSpinZ = rand(1,2);

Worked for me.....
__________________
Israel "Izzy" Long
Motion and Title Design for Broadcast-Film-DS
izzylong.com
ragecgi is offline   Reply With Quote
Old 03-02-2003, 09:24 PM   #3
Darkware
Subscriber
 
Darkware's Avatar
 
Join Date: Oct 2002
Location: USA
Posts: 1,172
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Well, I typed that in, but it doesn't work. Is "RigidObjectName" supposed to be a variable for "rigidBody1, rigidBody2, etc'? Because all objects you select have a different rigid body with them. If you have to type the name of every rigid body in place of "RigidBodyName" then we would have a lot of typing to do. Also, what is the "SolverName" for? If it's not a variable, what should I replace it with? Perhaps writting it out a little more would help me. I just stink at this stuff. Sorry! lol!

Let's say we have polyCube1, polyCube2, and polyCube3. Each are active rigid bodies. polyCube1 had rigidBody1, polyCube2 has rigidBody2, and polyCube3 has rigidBody3. After selecting all three, shift-selecting the initialSpin X, Y, and Z attributes in the channel box, then right-clicking and choosing "Expressions" what do you type in the box?
__________________
www.Darkware3D.com
Darkware is offline   Reply With Quote
Old 03-02-2003, 10:16 PM   #4
ragecgi
Super Moderator
 
ragecgi's Avatar
 
Join Date: Sep 2002
Location: Minnesota, USA
Posts: 3,709
Thanks: 0
Thanked 13 Times in 12 Posts
Default

Each of your rigids have a "different" solver?? weird...

By default, when you create your first active rigid object in your scene, Maya creates a default rigid "Solver".

Then, every object you create after that, i.e. polycube2, polycube3 etc. are attached to that same solver unless you tell Maya otherwise.

(at least, that's the way it has always worked for me in 4.0 and 4.5)

You should only have one main rigid solver, for your rigids.

So, for my expression to work, you would have had to select all of your objects that you want rigid, then make them active rigids, then you would have only ONE solver for all of your objects.

hehe... I suck at this too, but my expression worked for me so....
not sure what else I can tell ya....

Sorry.... I'm a tard....
__________________
Israel "Izzy" Long
Motion and Title Design for Broadcast-Film-DS
izzylong.com
ragecgi 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

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.