Jump to content

Novice> translate OOP knowledge to Houdini & VEX


art3mis

Recommended Posts

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

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.

Edited by eco_bach
Link to comment
Share on other sites

Hi Jim,

I think Object Oriented Programming experience is very applicable to Houdini, but maybe in a different way than you would expect coming from a game engine.

First off, VEX is more like shader code, its fast, but it doesn't have many bell's and whistles. However Python scripting in Houdini is object oriented, you can find more information about that here. There are things like callbacks, but more for user event's then for "simulation" events. For example you can have a callback when a node is created, deleted, or a parameter is changed. (more on that here)

I think one architectural thing to keep in mind is that Houdini is designed to produce linear animations, which is different from game engines which are designed to produce interactive experiences. So if you wanted to have a number of glowing walls that turn on and off in secession, you would probably do that with key-frames on their material parameters, not a complex event manager setup. Now you could certainly setup these key-frames using python, which might be helpful if you wanted them to turn on and off in a complicate pattern, but you wouldn't have a bunch of event managers and callbacks running as you played your animation.

So, I don't think you would need to use any OOP to recreate that example you posted, but there are certainly areas in Houdini where high level programming skills come in handy.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...