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
how to scale several primitives differently inside a Sop
8706 9 4- mulafraga
- Member
- 30 posts
- Joined: Jan. 2012
- Offline
- Enivob
- Member
- 2544 posts
- Joined: June 2008
- Offline
- mulafraga
- Member
- 30 posts
- Joined: Jan. 2012
- Offline
- grayOlorin
- Member
- 1799 posts
- Joined: Oct. 2010
- Offline
- Sadjad Rabiee
- 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 !
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 !
- mulafraga
- 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!!
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!!
- Sadjad Rabiee
- Member
- 1391 posts
- Joined: Dec. 2010
- Offline
- Sadjad Rabiee
- Member
- 1391 posts
- Joined: Dec. 2010
- Offline
- mulafraga
- Member
- 30 posts
- Joined: Jan. 2012
- Offline
- Adriano
- Member
- 408 posts
- Joined: June 2015
- Offline
-
- Quick Links