Jump to content

VEX and normals from @ptnum


mottosso

Recommended Posts

Hi all,

I'm new to VEX and am facing an odd issue. With an Attribute Wrangle iterating over points, connected with any polygonal mesh (in this case a Sphere).

// Why does this not work..
vector broken_normal = point(0, "N", @ptnum);

// Why this does?
vector working_normal = @N;

// And this as well?
vector working_position = point(0, "P", @ptnum);

if (@ptnum == 0) {
    printf("%s\n", broken_normal);
    printf("%s\n", working_normal);
}

// {0,0,0}
// {-6.31725e-09,7.5807e-08,-1}

As you can see, the "broken_normal" yields a value of { 0, 0, 0 } when I would have expected a value identical to the "working_normal". I'm running this on Houdini 18.

vex_and_normals.hipnc

Link to comment
Share on other sites

That's it, thanks. I figured it must have been something obvious like that.

But that begs the question; what attributes are generated on the fly like this? More importantly, how do I generate attributes on the fly for anything other than geometry 0?

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...