papsphilip Posted January 7, 2021 Share Posted January 7, 2021 Hello, inside a polyextrude SOP node i have ticked the "transform extruded front" option and i want to scale depending on the @primnum, but the attribute is not recognized. i am using this expression fit(rand(@primnum * 123), 0.0, 1.0, 0.2, 1.2) there is no zscale attribute equivalent, how can i go about this without creating a foreach loop? Quote Link to comment Share on other sites More sharing options...
dleonhardt Posted January 8, 2021 Share Posted January 8, 2021 If you want uniform scaling, you need to use the "insetscale" attribute. Local variables or per-primitive/edge expressions are not supported for performance reasons. https://www.sidefx.com/docs/houdini/nodes/sop/polyextrude#notes Quote Link to comment Share on other sites More sharing options...
papsphilip Posted January 8, 2021 Author Share Posted January 8, 2021 I wanted to do non uniform scaling only on the Y axis. So I guess a foreach loop is my only option Quote Link to comment Share on other sites More sharing options...
Aizatulin Posted January 8, 2021 Share Posted January 8, 2021 Hi, you can workaround it by using a reference prim for each point. After extrusion you can store the prim number as point attribute (limited to the extrusion group). Once you have the information you can rescale the points base on the primitives orientation. extrude_non_uniform_scale_ref.hipnc 1 Quote Link to comment Share on other sites More sharing options...
papsphilip Posted January 11, 2021 Author Share Posted January 11, 2021 Thank you!!! i see you are using matrix operations as well. Could you explain a bit more that last wrangle where you perform the scale? Quote Link to comment Share on other sites More sharing options...
Aizatulin Posted January 11, 2021 Share Posted January 11, 2021 (edited) C is here the Center point (prim center), substracting it will the prim center to zero. M is an orientation matrix (rotation) constructed by the normal of the prim and the difference vector between the first and second point. It should represent the orientation of the primitive. Applying transpose(M) is the inverse of M, which makes the prim X,Y,Z aligned. Now we can perform our scale just on x and y. After scale we apply M and add C to transform the prim back to original position. P.S. M is not a rotation in this case (determinant(M) = -1 ~ reflection) but this does not matter. Edited January 11, 2021 by Aizatulin Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.