Use prim attributes in resample sop parameter expression?

   7618   4   0
User Avatar
Member
5 posts
Joined: June 2008
Offline
Hello,

I'm having trouble using & referencing primitive attributes in an expression for a resample sop node and I was wondering if anyone could give me some help or pointers please.

I have a piece of geometry with 52 individual prims and each prim has its own attribute (say the prim's area from a measure sop). I want the “Segments” parameter of the resample sop to use each prim's “area” attribute for its value- i.e. each prim will have its own individual segment value that's calculated from its area attribute.

I've tried using hscript & python but I just can't seem to reference prim attributes… I've tried lvar(), curPoint().attribValue(), even basics such as $PR etc. but nothing seems to work & I'm out of ideas- lil help please!

Thanks in advance.


PS: Kinda unrelated but is there any way of seeing, using or customising the source code for a houdini node so that I could try making a new operator type to do the above?
User Avatar
Member
5 posts
Joined: June 2008
Offline
Is there no-one that can shed some light on this? I've been stuck on this for two days now… PLZ HALP! :cry:
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
The best way to get a response is to post up a simple scene ! with what you want to do

Rob
Gone fishing
User Avatar
Member
1904 posts
Joined: Nov. 2006
Offline
This cannot be accomplished using expressions like you wish because the Resample sop does not support local variables, such as $PR. If you look at the help card for it you will see that it lists no supported Local Variables, which appear in something like a Point sop.

This is why it or lvar() won't work. curPoint/curPrim doesn't work because the sop is not cooking on a per point/primitive basis.

What you are attempting to do is best accomplished using the ForEach sop.

Take a look at the attached file.

Attachments:
random_resample.hip (48.9 KB)

Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
5 posts
Joined: June 2008
Offline
Graham- you are a God like genius, thanks very much! Does exactly what I was looking for
  • Quick Links