how to scale several primitives differently inside a Sop

   8706   9   4
User Avatar
Member
30 posts
Joined: Jan. 2012
Offline
Hi,
im trying to achieve an effect where i voronoid a sphere, ramped it to control when they show up using color(so black they belong to the deleted group and red they are not in it so they show up)and im using for each to control the individual scale of each one of them from their pivots.

now im just not sure how to map the color gradient to make the pieces also scale from 0 to 1 as they get redder(so it would look like their not just appearing, but their scaling up to)

thanks
User Avatar
Member
2544 posts
Joined: June 2008
Offline
Have you tried using $CR in the Uniform Scale channel of a transform?
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
30 posts
Joined: Jan. 2012
Offline
thanks for the reply

i tried it, but doesnt seem like its doing much for me
User Avatar
Member
1799 posts
Joined: Oct. 2010
Offline
if it is primitives you are scaling, have you tried a primitive SOP instead of a transform SOP?
-G
User Avatar
Member
1391 posts
Joined: Dec. 2010
Offline
I made some interesting projects with this method too.

for gradient color I suggest you to use an Attribute Transfer SOP.

for example create a grid sop, and use Facet SOP (Turn On Unique Points) for detaching all of the primitives.

create a Sphere SOP and set a RED color with Color SOP to it.
Also set BLACK color with Color SOP to the grid.


NOTE : using primitive color or point color are not different , but primitive color is a little faster !


transfer color of the Sphere to the Grid based on their distance with Attribute Transfer SOP.
for gradient color set Blend parameter of the Attribute Transfer to 1 and set Threshold parameter to some smaller value.

Also use a Transform SOP for Sphere for moving it from far to near place to the Grid over 100 frames(or anything).

connect final colored grid from Attribute transfer SOP to the For Each SOP and iterate over all primitives.

use a Transform SOP inside of For Each SOP for scaling each primitive of the grid based on it's color.

for example you can use this expression for uniform scale :

// If your color attribute is point attribute
point(“../each1”,0,“Cd”,0) // We need only take color of the first point

// If your color attribute is primitive attribute
prim(“../each1”,0,“Cd”,0) // We need only take color of the first primitive

and you should use $CEX , $CEY , $CEZ for center pivot.

If you doing this with Primitive SOP instead of For Each SOP , it's so faster than For Each method !
https://www.youtube.com/c/sadjadrabiee [www.youtube.com]
Rabiee.Sadjad@Gmail.Com
User Avatar
Member
30 posts
Joined: Jan. 2012
Offline
hey guys, thanks a lot! ive learned a lot!! i didnt knew about the primitive sop, and i never transfered colors. that is really awesome- thanks Rabiee for such a detailed explanation.

one question tho
when i scale up the sphere, looks like the sphere's interior is not transfering color(so my color becomes black when i scale/move the sphere into the grid). any way i can make it so that the interior of the sphere also counts as red?

indeed the primitive sop is a lot easier and faster to compute!!
User Avatar
Member
1391 posts
Joined: Dec. 2010
Offline
Yes , you can use PointFromVolume SOP for generating some points inside of the Sphere , in this case you should use these interior points for transfering color 8)
https://www.youtube.com/c/sadjadrabiee [www.youtube.com]
Rabiee.Sadjad@Gmail.Com
User Avatar
Member
1391 posts
Joined: Dec. 2010
Offline
OK , I made these two methods for you :wink:

Attachments:
JK_AttrTransfer.hip (121.9 KB)

https://www.youtube.com/c/sadjadrabiee [www.youtube.com]
Rabiee.Sadjad@Gmail.Com
User Avatar
Member
30 posts
Joined: Jan. 2012
Offline
thanks a bunch!!!!
User Avatar
Member
408 posts
Joined: June 2015
Offline
grayOlorin
if it is primitives you are scaling, have you tried a primitive SOP instead of a transform SOP?


Just passing by. Thanks for that one, never used that SOP before, does the trick i was searching the interwebz for.

Cheers,

A.
  • Quick Links