Jump to content

Find attribute in ForEach Loop


Recommended Posts

You have two problems. One is that the attribute you are trying to reference does not exist in the detail context, it exists on the points context. The other problem is you are trying to fetch the value from input 0. Input 0 of the transform node would be box1, not the FOREACH_BEGIN. When using hScript functions to fetch data, you almost always have to provide the explicit path to the node where you are fetching the data. 

While you can use an expression to drive a transform, there is no need, that is what f@pscale is used for.

point("../foreach_begin1/",0,"myDist",0)

 

Untitled-1.jpg

 

Here is the scene implemented using f@pscale instead, with the transform disabled. They look the same.

Untitled-1.thumb.jpg.69ea454e2dd61cbc134718b764270d86.jpg

Edited by Atom
  • Like 1
Link to comment
Share on other sites

11 minutes ago, Atom said:

You have two problems. One is that the attribute you are trying to reference does not exist in the detail context, it exists on the points context. The other problem is you are trying to fetch the value from input 0. Input 0 of the transform node would be box1, not the FOREACH_BEGIN. When using hScript functions to fetch data, you almost always have to provide the explicit path to the node where you are fetching the data. 

While you can use an expression to drive a transform, there is no need, that is what f@pscale is used for.


point("../foreach_begin1/",0,"myDist",0)

 

Untitled-1.jpg

Thank you, I can see now several ways to solve it. Pscale is probably the simplest and cleanest, to keep the detail attribute you could promote it from point to detail. 

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