Newb stuck on the start

   153   2   0
User Avatar
Member
3 posts
Joined: July 2023
Offline
Hi guys


I`m working in 3dSMax for over a 10 years now and recently started learning Houdini. And at the first day of learning it the fact that you cannot apply the scale attribute to a mesh object but you can apply it to a point made me not only confused but pretty mad I remembered some friends say "when you learn it more it will start to look pretty logical and intuitive". Well, it means that I haven`t learned it enough yet because wherever I look it just pure illogical hell to me.

I hope someone will explain at least any of these things to me, I will appreciate that :


1) Why points have wrong coordinates on some geometry objects like spheres and tors and ok on others like grids and boxes ? When I create a sphere from scratch on a new scene and turn on point visibility and numeration I see the points 0 and 1 appear to be the highest and lowest point of the sphere and in a viewport they are placed in the 0 coordinate of x and z axis (of course). But when I open geometry spreadsheet their coordinates are -2 , 0.5 , -5 and 3.6 , -0.5 , 9.7 respectively.

When I do same with grid or box everything is ok.

Whats going on ?


2) Why normal N attribute is 3 float by default and not vector ?


3) Why when I declare vector parameter whith a channel by typing "vector freq = ch ("freq");" and press "Create spare param" button it creates a non vector but single value float parameter ?


4) See attachment . Why when I type @P.y=sin(@P.x); in an attribute wrangler attached to a horizontal line it gives me spiral (like it should) but when I do same in point node's VEXpression field it gives me some weird line in viewport (and its P.x coordinates are changed for some reason as I see in the spreadsheet) and I need to type @P.x=self;@P.y=sin(@P.x);@P.z=cos(@P.x); in order for spiral to appear forcing P.x to stay same (not to be changed change by Point node like before). Meaning that point node affects P.x component even when I`m not touching it while wrangler only changes what you tell him to. It was tested on different versions of Houdini.

Thank you

Attachments:
scr.jpg.49551967b55c6f7dcf68f9cdfa752f91.jpg (1.0 MB)

User Avatar
Member
9276 posts
Joined: July 2007
Offline
Harry_S
1)...When I create a sphere from scratch on a new scene and turn on point visibility and numeration I see the points 0 and 1 appear to be the highest and lowest point of the sphere and in a viewport they are placed in the 0 coordinate of x and z axis (of course). But when I open geometry spreadsheet their coordinates are -2 , 0.5 , -5 and 3.6 , -0.5 , 9.7 respectively.
the coordinates are likely something like:
-2.1111e-8, 0.5, -5.65669e-9
3.64627e-8, -0.5, 9.77017e-9
where -2.111e-8 is a scientific notation of describing -0.00000002111 so a negligibly small number, this is common and comes down to floating point precision, some DCCs would round display of such values to 0

Harry_S
2) Why normal N attribute is 3 float by default and not vector ?
3 float or vector it's generally just a semantics
in Houdini vector3 attributes are technically 3 float attributes with optional qualifier that can be position, vector, normal, color, ... which is a hint of whether and how such attribute should be transformed
so in node info window you should see something like: N 3flt Norm

Harry_S
3) Why when I declare vector parameter whith a channel by typing "vector freq = ch ("freq");" and press "Create spare param" button it creates a non vector but single value float parameter ?
to lookup or create vector parameter use chv() instead of ch()

Harry_S
4) See attachment . Why when I type @P.y=sin(@P.x); in an attribute wrangler attached to a horizontal line it gives me spiral (like it should) but when I do same in point node's VEXpression field it gives me some weird line in viewport (and its P.x coordinates are changed for some reason as I see in the spreadsheet) and I need to type @P.x=self;@P.y=sin(@P.x);@P.z=cos(@P.x); in order for spiral to appear forcing P.x to stay same (not to be changed change by Point node like before). Meaning that point node affects P.x component even when I`m not touching it while wrangler only changes what you tell him to. It was tested on different versions of Houdini.
look at Generate Code tab and hit Update Code, that will help you see the full Wrangle snippet code generated
which will also reveal the logic behind the Attrib Expression

you will see that result of your expression is assigned to your chosen attribute and therefore it's more like a shortcut for simple assignments rather than full on replacement of the Wrangle

so in your case you would have to use something like
set( self.x, sin( self.x ), cos( self.x ) )

to simply construct a vector that will be assigned to the chosen vector attrib

understanding the logic how the code is built, you can also hack it using code injection similar to yours, by first ending the assignment using self;, therefore you dont have to assign all components afterwards, like in your screenshot, just setting y:
self; v@P.y = sin( @P.x )
which also defeats the purpose of attribute expression SOP which was built to ease the transition between old Point SOP towards Wrangles and you can aslo just use wrangle in that case
Edited by tamte - yesterday 16:17:04
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
9276 posts
Joined: July 2007
Offline
Harry_S
. And at the first day of learning it the fact that you cannot apply the scale attribute to a mesh object but you can apply it to a point made me not only confused but pretty mad
this likely comes from wanting to treat geometry as objects

you can technically do it with some primitives, like primitive Sphere or Packed Primitive, ..., which while technically part of geometry within the actual object they still keep track of intrinsic attributes like transform that can be modified and even for such primitives this only defines scale and orientation, since translation is usually defined from P of the point they are attached to

and since Polygon primitives are attached to multiple points they get their full shape from P of those points
so if you want more granular control of trandforms for individual subset of geometry within a singe Object you can leverage Packed Primitives
Tomas Slancik
CG Supervisor
Framestore, NY
  • Quick Links