PDA

View Full Version : scripting: random values for instances of an object


Aearon
07-24-2003, 10:52 AM
Hey guys.. i seem to need push in the right direction here.

what i'm looking for is a way to generate random values for the 'angle' and 'direction' properties of a bend modifier. i need different random values for instanced objects. i need this for grass-stems inside a scatter object. i tried expressions and everything, but they always generate the same values for every instance (suprise). maybe some scripting would help?

The solution might be simple, but rest assured i made a search and i looked through some grass tutorials ;)

Aearon
07-24-2003, 06:27 PM
no ideas people?

i had one.. but i can't get it to work: in the expression for the bend values i tried to use the objects position & rotation values to sort of randomize this, and have different values for each object.. but it seems that you can only assign one specific objects' position to variables. this way the expression always relies on only one specific object, not each individual instance.

i'm stuck :shrug:

EricChadwick
07-25-2003, 02:25 PM
Blur Studios has an old script called Do that lets you apply random settings to certain modifiers on selected objects. If I recall correctly, I haven't used it in a while.
http://www.neilblevins.com/blurscripts/blurscripts.htm

Maybe I misunderstood you, but you can't use different bend amounts on instanced objects (they're instances!), unless they are copies or references (with the Bend mod applied afterwards).

Michael Comet's BlowGrass script allows you to create grass that works pretty well, randomizes and animates the bends etc.
http://www.comet-cartoons.com/toons/maxscript.cfm#B

CGTalk Moderation
01-15-2006, 05:00 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.