Jump to content

Bound Radii


Noobini

Recommended Posts

FYI,

the Radii Attribute in bound maybe useful in some cases...but it's a bit annoying to access it in a wrangle...here's how:

The working wrangle is where I got it to work, the others were for reverse engineering.

Is there an easier, more obvious way? (I'm preparing to facepalm...)

 

 

vu_radii.hiplc

Edited by Noobini
Link to comment
Share on other sites

that's pretty common

you need to define the type of the attribute you are expecting to bind, if left ambiguous you'll get fallback value, the best guess or error

so for example:

vector r = detail(1,"radii",0); // will load detail attribute as vector as it's the only type you are dealing with
@P *= detail(1,"radii",0); // same, therefore it will multiply @P component wise 
@P *= float(detail(1,"radii",0)); // will force detail to read as float so it will fall back to x component if "radii" is vector, therefore it will multiply @P by x component of radii
@P *= vector(detail(1,"radii",0)).y; // will force detail to read as vector so it will allow you to specify component as .y, therefore it will multiply @P by y component of radii

@P *= vector(detail("../A","radii",0)).y; // will not work, because you are missing op:
@P *= vector(detail("op:../A","radii",0)).y; // will work

// usually you may want to do this for clarity
vector r = detail(1,"radii",0); // will load detail attribute as vector as it's the only type you are dealing with
@P *= r.y;

// also you can omit last argument in detail function overall
vector r = detail(1,"radii");

 

  • Like 1
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...