Translating Object Oriented coding knowledge to VEX + Hscript

   2912   1   1
User Avatar
Member
350 posts
Joined: June 2016
Offline
Hi

As someone just entering the Houdini world but with over 10 years of Object Oriented coding experience in java, C#, Javascript and AS3 I was wondering how much of that knowledge can be ‘transferred’ over to the Houdini & VEX world. For instance do things like inheritance, event listeners, callbacks etc even exist in VEX? 

Or am I better off to ‘unlearn’ or forget all of my OOP knowledge and instead think only in ‘nodes’?

As a practical example take this extremely simply Cornell box with some rotating cubes, created in Unity

https://channel9.msdn.com/Series/UnityCreativeCoding/Deconstructing-Darkness [channel9.msdn.com]

For the ring of rotating cubes, would a Copy SOP be the only or best way to recreate in Houdini?


And lets say I wanted the walls to emit light, either at the same or in succession.

In Unity I would create an Event manager class and have the wall objects subscribe as ‘listeners’ to this class.  Then this Event manager class or even a higher level ‘Main’ class would contain most of my application logic determining both the timing and selection of wall objects dispatching events to all subscribed listeners (wall objects).

How would the same scenario be recreated in Houdini?

I realize this is a very basic example for experienced Houdini coders but getting a grasp on this would mean a huge leap forward for me in my understanding of how to best architect Houdini projects.

And strongly suggest a coding subforum devoted to all code related Houdini questions!
Edited by art3mis - Aug. 20, 2016 08:11:23
User Avatar
Member
2572 posts
Joined: June 2008
Offline
If you have not watched Jeff Wagner's video on VEX, check it out.
https://vimeo.com/173658697 [vimeo.com] (I know who has time to watch two hours of coding talk…I did)

VEX is more about snippets, let's face it, it can not even open a file. It can open a point cloud.
You can define functions and call them, but I am not sure if you can define a class.
VEX can not even do two dimensional array data types as of H15.5.

Any previous coding experience is advantageous.

But don't forget python is available as well if you require a full feature language.

There is a scripting sub forum on OdForce so post there, most people check both forums daily. There is also a French Houdini forum as well, I believe.

Edited by Enivob - Aug. 20, 2016 13:00:50
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
  • Quick Links