houdini Vex global value

   996   1   0
User Avatar
Member
6 posts
Joined: Sept. 2021
Offline
I want to use a global variable.
Attribute can be used like a global variable, but
If it is not saved by the if conditional statement, the attribute is initialized to 0.

////////////////////////////////
if(////...)
{
@ABC = 0;
}
{

}
User Avatar
Member
131 posts
Joined: Aug. 2012
Offline
Attributes on the input item must match. Mis-matched attributes are initialized with 0. You can work around this to some extent by force-initializing a value like -1:

@ABC = -1;
if(...){{
@ABC = 0;
}

String attributes are initialized with "", empty value.
  • Quick Links