PDA

View Full Version : random scale of nulls in layout



geo_n
05-26-2008, 01:29 AM
Is there a way to randomly or have more control of the scale value of nulls in layout? i have thousand of nulls that I would like to scale randomly. :)
if there's scale then its not too impossible to have random rotation also. :D

prometheus
05-27-2008, 09:01 AM
Not sure if there is a tool for that, have to check around but It made me think about if you can do it by first create a particle emitter with around thousands particles per frame and then ad the null, then use dynamic fx linker
and use the null to replace particles, then you can randomly set a particle size value at the +- tab or use the texture or envelope tab, you should be able to se the nulls change in the open gl directly.

I think you also can give it random rotation& scale directly in the particles rotation tab, since its dynamic fx linked you can change size exactly when
You want it.

However I guess you might need to change the scene you already have so Im not sure if you can do anything with this.

michael

Red_Oddity
05-27-2008, 09:36 AM
This creates a thousand nulls and randomizes the scale and position, you can do some nifty work with LS Commander (albeit not as handy as say MEL scripting)



@warnings

generic
{
for(i=0;i<1000;i++)
{
AddNull("Null");
randomScale = random(-1,1);
randomPosMax = 10;
randomPosMin = -10;
AddScale(randomScale,randomScale,randomScale);
AddPosition(random(randomPosMin,randomPosMax),rand om(randomPosMin,randomPosMax),random(randomPosMin, randomPosMax));
}
}

evenflcw
05-27-2008, 09:47 AM
Hmm... randomisation should be added to the new Scene Editors Adjust Properties panel.

RedOddity, if you made that script iterate through all selected items instead it would obviously become more general and thus more usefull.

geo_n
05-27-2008, 08:41 PM
Thanks guys for the suggestion. Took a while before anyone posted ideas.
This is in regard to my scene I did in kray for testing. I`ll try out your script Red_Oddity. Thanks.
I wonder if I can place them more accurately.

Btw, here`s what I did. I couldn`t figure out how to make my penguins scale randomly. Kray is specific about nulls names. But its powerful enough to do instancing.
http://www.kraytracing.com/wiki/index.php?title=Basic_Kray_Instancing

Red_Oddity
05-28-2008, 07:57 AM
Aaah, for existing items...hang on...

Red_Oddity
05-28-2008, 08:22 AM
added random rotation aswell, why not..



@warnings

generic
{
curScene = Scene();

selList = curScene.getSelect();

if(selList == nil)
{
return;
}

for(i=1;i<=size(selList);i++)
{
SelectItem(selList[i].id);
randomScale = random(-1,1);
randomPosMax = 10;
randomPosMin = -10;
randomRotMax = 180;
randomRotMin = -180;
AddScale(randomScale,randomScale,randomScale);
AddPosition(random(randomPosMin,randomPosMax),rand om(randomPosMin,randomPosMax),random(randomPosMin, randomPosMax));
AddRotation(random(randomRotMin,randomRotMax),rand om(randomRotMin,randomRotMax),random(randomRotMin, randomRotMax));
}

for(i=1;i<size(selList);i++) // this will restore the selection you had prior to running macro
{
AddToSelection(selList[i].id);
}
}

geo_n
05-29-2008, 07:53 PM
Thanks I tried it now. Seems lw has issues with picking more than 1000 nulls in layout. I had to pick in hundreds to run the lscript. more than 10million poly with gi. Amazing!

http://img105.imageshack.us/img105/7010/clone0000000001tk8.jpg (http://imageshack.us)