PDA

View Full Version : rotate


fbitonti
02-10-2008, 02:48 AM
I have a cube that is instanced to a flock of partcles. I need to write a script that will query the rotation of each cube in the x,y,z. I have never scripted for instaces before and I'm a bit stuck on where to begin to look for answeres. Any help would be great.

T1ckL35
02-11-2008, 12:27 AM
Hi,

It might not give you exactly what you're after but there are various bits of code that deal with particles in a boid like way in some code I did last year:
http://www.flash-fx.net/3D/tools/bFlocking/
Just download it and have a look in the code - it should be commented quite extensively.

If nothing else then the lessons I learned in the code there might help you for reference ;)

Simon

fbitonti
02-11-2008, 04:33 AM
I am trying to run your script but i keep geting the following error.

# Error: name 'fl' is not defined
# Traceback (most recent call last):
# File "<maya console>", line 1, in <module>
# NameError: name 'fl' is not defined #
# Error: name 'fl' is not defined
# Traceback (most recent call last):
# File "<maya console>", line 1, in <module>
# NameError: name 'fl' is not defined #

Thank you for the help.

T1ckL35
02-11-2008, 10:17 AM
It was originally set up to be run from the userSetup.py file when Maya starts hence it not running 'out of the box'.
In the script editor try:
import bFlocking as fl
and then run the script

Its there more for looking at the code as reference on one way of handling particles ;)

Simon

CGTalk Moderation
02-11-2008, 10:17 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.