How to read custom variable in node?

   1034   4   0
User Avatar
Member
60 posts
Joined: Feb. 2022
Offline


I try to read the height value of line and save it as a custom variable (h).



But when I assign the h variable to polytrude -> dstance, it prompts me that this variable cannot be found.What is the question?

Thanks for your help!
User Avatar
Member
1907 posts
Joined: Nov. 2006
Offline
Since you're creating the attribute in VEX you need to manually create a mapping between the parameter and a variable:
addvariablename(0, "h", "MYVAR");

That being said, PolyExtrude won't accept a local variable in that parameter so even if your variable was correctly set up it would throw a warning. In your case you could do something like set the Distance to 1 and use your attribute as the Distance Scale in the Local Attributes tab.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
60 posts
Joined: Feb. 2022
Offline
graham
Since you're creating the attribute in VEX you need to manually create a mapping between the parameter and a variable:
addvariablename(0, "h", "MYVAR");

That being said, PolyExtrude won't accept a local variable in that parameter so even if your variable was correctly set up it would throw a warning. In your case you could do something like set the Distance to 1 and use your attribute as the Distance Scale in the Local Attributes tab.

Thank you for your help, but I don't understand the specific method, can you be more specific?
User Avatar
Member
2041 posts
Joined: Sept. 2015
Offline
You can also use the point function and specify the point number to use or promote the desired point numbers attribute to detail and use the detail function.
Edited by BabaJ - June 7, 2023 11:35:20

Attachments:
Pt_Att_For_Extrusion.hiplc (139.7 KB)

User Avatar
Member
60 posts
Joined: Feb. 2022
Offline
BabaJ
You can also use the point function and specify the point number to use or promote the desired point numbers attribute to detail and use the detail function.

Great! This completely solved my problem and has a very clear idea.
Thanks for your help
Edited by HenDaSheng - June 7, 2023 11:56:04
  • Quick Links