Setting random attributes

   2176   2   1
User Avatar
Member
8 posts
Joined: Sept. 2019
Offline
Hi,

I'm making some Asteroid generator and I need to non-uniform scale those object before the copytopoints node (in order to get different Asteroids measures), also I want to be able to change the size of the sphere that creates the erosion of the Asteroids (sphere2).

I did it with Python expresions, but seems to be very slow.

Thanks in advance.
Edited by ularrarte - Nov. 26, 2019 18:00:55

Attachments:
Asteroid_Gen.hipnc (192.7 KB)

User Avatar
Member
359 posts
Joined: April 2017
Offline
Try the Attribute Randomize SOP?

Or in a Point Wrangle:

float min = 0.1;
float max = 1.0;
f@pscale = fit01(rand(@ptnum), min, max);
MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
User Avatar
Member
8 posts
Joined: Sept. 2019
Offline
Does it works with non-uniform scales? If I'm not wrong that's only a float.

I also tried with the attribrandomize but it doesn't work with any of the values such as height(from mountain node), sx/sy/sz from the trasnform node or the freq (frequency from the sphere node). Thos nodes are conected before the attribrandomize node.

The thing that I want to do is:

newNode = hou.node('/obj/Asteroid_Maker/sphere1')
transformNode = hou.node('/obj/Asteroid_Maker/transform2')

parm = newNode.parm('scale')
parmSx = transformNode.parm('sx')
parmSy = transformNode.parm('sy')
parmSz = transformNode.parm('sz')

parm.set(random.random() * 7)
parmSx.set(random.random() * 3)
parmSy.set(random.random() * 3)
parmSz.set(random.random() * 3)

But with nodes.

Thanks.
Edited by ularrarte - Nov. 28, 2019 11:01:12

Attachments:
Captura.PNG (11.8 KB)

  • Quick Links