How to calculate polyextrude Divisions value by attribute.

   1104   6   0
User Avatar
Member
60 posts
Joined: 2月 2022
Offline


I want to affect the height of polyextrude by creating a new `exit` value. The Divisions value is also calculated based on `exit`, but polyextrude prompts Local variable 'exit_div' not found. I tried converting the `exit` to a point type(`exit_div`), but the prompt persists. why is it like this? thanks for your help!

Attachments:
Polyextrude_Test.hiplc (213.7 KB)

User Avatar
Member
22 posts
Joined: 6月 2018
Online
Hey,

You can't access an attribute outside a wrangle by just typing @attribute, with few exceptions (like group expression...).
It should be a little vex expression to access to point, detail, vertex or primitive attribute, for example in your case : point(0,0,"exit_div",0) * 10.

If you want a deeper understanding of this, this is the template for this expression that you can find in the doc : point(surface_node, point_number, attribute, index)

It's "0" for the surface node because your attribute is set on the node you edit, but if you want to access an attribute outside, you can replace "0" by an absolute, or relative path like this : point("../attributepromote1",0,"exit_div",0) * 10.

Hope it will help you!
Have a nice day.
User Avatar
Member
60 posts
Joined: 2月 2022
Offline
肯廷
Hey,

You can't access an attribute outside a wrangle by just typing @attribute, with few exceptions (like group expression...).
It should be a little vex expression to access to point, detail, vertex or primitive attribute, for example in your case : point(0,0,"exit_div",0) * 10.

If you want a deeper understanding of this, this is the template for this expression that you can find in the doc : point(surface_node, point_number, attribute, index)

It's "0" for the surface node because your attribute is set on the node you edit, but if you want to access an attribute outside, you can replace "0" by an absolute, or relative path like this : point("../attributepromote1",0,"exit_div",0) * 10.

Hope it will help you!
Have a nice day.

Thanks for your help, it's a bit hard for me, I'll look into it.
I tried to write in this way, and it did solve the error, but the Divisions are still the same result.

User Avatar
Member
60 posts
Joined: 2月 2022
Offline
HenDaSheng
肯廷
Hey,

You can't access an attribute outside a wrangle by just typing @attribute, with few exceptions (like group expression...).
It should be a little vex expression to access to point, detail, vertex or primitive attribute, for example in your case : point(0,0,"exit_div",0) * 10.

If you want a deeper understanding of this, this is the template for this expression that you can find in the doc : point(surface_node, point_number, attribute, index)

It's "0" for the surface node because your attribute is set on the node you edit, but if you want to access an attribute outside, you can replace "0" by an absolute, or relative path like this : point("../attributepromote1",0,"exit_div",0) * 10.

Hope it will help you!
Have a nice day.

Thanks for your help, it's a bit hard for me, I'll look into it.
I tried to write in this way, and it did solve the error, but the Divisions are still the same result.


--------



However, the problem is solved from another angle. There is a Divisions Scale option in PolyExtrude -> Local Control.



Before PolyExtrude, associate exit with divsscale through an expression, thus achieving the desired effect.
Thank you so much for your help and inspiration!
Edited by HenDaSheng - 2023年3月9日 09:49:32
User Avatar
Member
22 posts
Joined: 6月 2018
Online
You need to create a "for each node", and then a meta import node in the foreach.
Then you can access to the attribute "iteration" to randomize each block.
I join you your hip with that and comments to help you understand better the process.

Attachments:
Polyextrude_Test.hiplc (219.2 KB)

User Avatar
Member
22 posts
Joined: 6月 2018
Online
Oh great, houdini as so much ways to do things, glad you find one !
With my file you can see another one!
Have a good day
User Avatar
Member
60 posts
Joined: 2月 2022
Offline
kentin
Oh great, houdini as so much ways to do things, glad you find one !
With my file you can see another one!
Have a good day

I also thought of forloop, but I don't know how to use it.
I can learn forloop from your file again!
Have a great day too!
  • Quick Links