PDA

View Full Version : item creation - general methodology - beginner level


bonsai_kittenz
04-27-2006, 09:21 PM
Hey folks,

been using (ha) for just over a year now, and have a good knowledge of how maya is set up, and i can read basic mel, but only now am i getting into writing something custom.

I have a background in novice programming in a previous life, mostly database logic.

so i'm looking for advice on a general approach to something:

i'm looking to set up a scene with a bunch of smoke plumes coming out of the ground, and instead of tediously going through the creation process each time, i did it once and copied the process from the script editor, and removed all useless lines.

however now i'm running into something foreseeable, but i overlooked it nonetheless... things like changing a certain attr on, say, 'particleShape1', which is part of the setup process, don't work if i want to create multiple smoke plumes...the 2nd one i try to create, goes back and changes attr's on the first in my script...

so am i right to assume, that i should be setting up some sort of structure with variables? is there any way to query the system for item names, or even to have scripts change themselves dynamically for multiple iterations of a sequence?

i know i'm probably being quite a bit confusing...please do let me know what needs to be clarified

and MANY thanks to any help in advance

john_homer
04-27-2006, 09:31 PM
you just need to create thing "into" variables.. if that makes sence..

example..

string $aSphere[] = `sphere -name "stupidSphere"`;
setAttr ($aSphere[0] + ".translateX") 5;

just be aware that sometimes (like this case) maya insists on returning a string array rather than just a string, even though there is only 1 string to return ;(

thats why this would error.. but may work for something else..
string $newSphere = `sphere -name "stupidSphere"`;
setAttr ($newSphere + ".translateX") 5;

.j

CGTalk Moderation
04-27-2006, 09:31 PM
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.