Set font text in VEX

   6411   7   0
User Avatar
Member
55 posts
Joined: March 2015
Offline
Hi

So basically I was writing stuff in a point wrangle and got stuck in an if statement where I compare two variables, now to dedug this I would normally print the value out but since Im not in an IDE I cant just print it out, so I tought so use the font sop to display the variable.

I searched and I found this old thread https://www.sidefx.com/forum/topic/45221 [sidefx.com] where they say to check out an an asset from ortobolt, wich I already did but couldnt fully understand how it displays the text
Can someone please clearly explain me how to create a variable in a wrangle and then display its value in a font sop?

I bet I already saw it in a sidefx's masterclass…


Thanks
https://vimeo.com/user43100796 [vimeo.com]
User Avatar
Member
605 posts
Joined: July 2013
Offline
For debugging, IMO and experience, it's just easier to write the variable to an attribute so that you can check its value in the Geometry spreadsheet.

For me, I dont even look at the viewport when coding VEX. I check that my data is accurate using the Geometry Spreadsheet and only then look at the viewport.

If you still are stuck, post a scene or your VEX code and someone will help you along.
Houdini Indie
Karma/Redshift 3D
User Avatar
Member
2538 posts
Joined: June 2008
Offline
As of Houdini 15.5…
You can't actually set another nodes parameters using VEX.
You can't set another nodes attributes using VEX.

VEX can only target geoself() for setting attributes.

NOTE: Parameters and Attributes are not the same thing.

You can use printf for debugging purposes. (C style)
As Daryl mentions, most commonly you just setup a temp attribute on self and then review the value in the Geometry Spreadsheet.

You can set another nodes parameters using Python.
You can set another nodes attributes using Python.

Edited by Enivob - Aug. 5, 2016 14:18:51

Attachments:
Untitled-1.jpg (50.7 KB)
Untitled-2.jpg (151.5 KB)

Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
55 posts
Joined: March 2015
Offline
Thanks to both of you

Personally I find the houdini console method to be PERFECT for what I needed.
Actually before this I thought the houdini console was useless…another day, another thing learned

With this method I was able to immediatly find the error in the code

Btw I just came up with another thing I dont know:

When initializing a vector why cant I write:

vector _sup = {a ,b ,c}

Where a b and c are float variables

this doesnt work too:

vector _sup = {functiona() ,functionb() ,functionc()}

I tried this with the pointavg() function…

Why I must enter a value instead of a var/function?

Thanks

Attachments:
Screenshot_2.jpg (10.6 KB)

https://vimeo.com/user43100796 [vimeo.com]
User Avatar
Member
605 posts
Joined: July 2013
Offline
There is no wrong answer in Houdini, its a modular framework, so there's always more than one way to get the result your after.

With that in mind, HScript is my preferred method to read downstream attributes.

For example, I ended using the “details” function to read a detail attribute into my Font SOP.

`details("opPath", "detailStringAttribute")`
Houdini Indie
Karma/Redshift 3D
User Avatar
Member
55 posts
Joined: March 2015
Offline
Yes I saw that on the other post

What about the vector question?
https://vimeo.com/user43100796 [vimeo.com]
User Avatar
Member
605 posts
Joined: July 2013
Offline
SteN
What about the vector question?

You cant construct a vector from calculated values using brackets {}, you have to use set() instead;

vector a = {1.0, 1.0, 1.0};  //legal

vector a = {myVar, 1.0, 1.0}; //illegal

vector a = set(myVar, 1.0, 1.0); //legal
Edited by TwinSnakes007 - Aug. 5, 2016 20:29:16
Houdini Indie
Karma/Redshift 3D
User Avatar
Member
55 posts
Joined: March 2015
Offline
Daryl Dunlap
SteN
What about the vector question?

You cant construct a vector from calculated values using brackets {}, you have to use set() instead;

vector a = {1.0, 1.0, 1.0};  //legal

vector a = {myVar, 1.0, 1.0}; //illegal

vector a = set(myVar, 1.0, 1.0); //legal
Awesome, thanks
https://vimeo.com/user43100796 [vimeo.com]
  • Quick Links