best practice to scale primitive using VEX
12113 4 2- tosiho19
- Member
- 46 posts
- Joined: Oct. 2019
- Offline
hi,
I am wondering if the attached file is the correct way to proceed with scaling primitives.
I am using an Attribute Wrangle to define pscale attribute for each primitive. Then I am using a primitive node with Transform option that refers to @pscale in Scale Y.
Is it the correct way to scale my primitives?
Is there any way to not use the last Primitive Node with Transform option?
I mean having my “transformed” Primitive directly out of the Wrangle Attribute Node? I don't understand why the Wrangle attribute doesn't transform the geometry although I changed pscale value.
Thanks
I am wondering if the attached file is the correct way to proceed with scaling primitives.
I am using an Attribute Wrangle to define pscale attribute for each primitive. Then I am using a primitive node with Transform option that refers to @pscale in Scale Y.
Is it the correct way to scale my primitives?
Is there any way to not use the last Primitive Node with Transform option?
I mean having my “transformed” Primitive directly out of the Wrangle Attribute Node? I don't understand why the Wrangle attribute doesn't transform the geometry although I changed pscale value.
Thanks
Edited by tosiho19 - April 6, 2020 11:37:50
- N-G
- Member
- 209 posts
- Joined: March 2018
- Offline
- tosiho19
- Member
- 46 posts
- Joined: Oct. 2019
- Offline
Thanks @N-G,
What about if I want to scale after the delete node?
doesn't seem to work then. Only if I add another primitive node at the end..
Can I get my “transformed” Primitive directly out of the Wrangle Attribute Node? or do I always need to add the “Primitive” node at the end?
What about if I want to scale after the delete node?
v@scale = set(1, scale, 1);
Can I get my “transformed” Primitive directly out of the Wrangle Attribute Node? or do I always need to add the “Primitive” node at the end?
Edited by tosiho19 - April 6, 2020 22:11:12
- tamte
- Member
- 8785 posts
- Joined: July 2007
- Offline
creating f@pscale or v@scale attribute on packed primitives is not gona affect them, it's just gonna set that attribute value which is completely independent from transforms of packed primitives
to set transform of the packed primitive you can use setprimintrinsic() to set the value of “transform” intrinsic as matrix3
or you can use getpackedtransform() and setpackedtransform() functions
or create matrix3 or matrix4 attribute contiaining transform you want to apply to points or primitives and then use Transform By Attribute SOP which will have advantage of applying such transform to all desired attributes according to their qualifiers
to set transform of the packed primitive you can use setprimintrinsic() to set the value of “transform” intrinsic as matrix3
or you can use getpackedtransform() and setpackedtransform() functions
float scaley =rand(@primnum, seed)*scalar; matrix transform = getpackedtransform(0, @primnum); scale(transform, set(1, scaley, 1)); setpackedtransform(0, @primnum, transform);
or create matrix3 or matrix4 attribute contiaining transform you want to apply to points or primitives and then use Transform By Attribute SOP which will have advantage of applying such transform to all desired attributes according to their qualifiers
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- tosiho19
- Member
- 46 posts
- Joined: Oct. 2019
- Offline
-
- Quick Links