Jump to content

Using $dist attribute in stamping


Lukich

Recommended Posts

Hi there. I'm raying a point on a grid, having enabled the point distance attribute. However, when I tried to use that attribute to stamp a length of a certain line, Copy sop gave me an error, saying "Undefined variable". What makes the $dist attribute invalid?

Thanks!!!

Link to comment
Share on other sites

attributes are a black art as far as I'm concerned. It would be nice to assume that they're available downstream as a variable, but mostly they aren't.

What's best to do in these situations is use the point() expression to grab the dist attribute from your ray SOP. That will more than likely get you what you want.

Cheers

Marc

Link to comment
Share on other sites

It's not really a black art. If an operator has local variables, then it's usually listed in the help under the Locals section. Otherwise, if you created (or re-created) an attribute using the AttribCreate SOP, then it creates the special "varmap" detail attributes which allows downstream sops to use attributes as variables. It's very easy to see if you've got them, just middle-click on the node tile. If it has them, you will see the section "Custom Variable Mappings" which shows how a particular attribute is mapped to a variable.

Link to comment
Share on other sites

Except that (I'm pretty sure) sometimes when creating an attribute with the attributecreate, it still isn't recognised as a variable by downstream SOPs. I'll try and dig up a file where I was trying to get this to work.

It could, of course, be me doing something wrong :).

Link to comment
Share on other sites

Hi there.  I'm raying a point on a grid, having enabled the point distance attribute.  However, when I tried to use that attribute to stamp a length of a certain line, Copy sop gave me an error, saying "Undefined variable".  What makes the $dist attribute invalid?

Thanks!!!

14676[/snapback]

I've attached a file to demo how you can work around this.

In the copy sop you're limited to the local variables listed in the help, but

you can use these get at the ones you want.

eg

point("../ray",$PT,"dist",0)

there's also another geo called "fixing_missingVarMaps" that shows

the problem that Mark was refering to(missing varmap variable)

and how to work around it with attributeCreate.

stampingMissingvar.hip.gz

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...