Jump to content


How to include embedded code files into VEX?


  • Please log in to reply
2 replies to this topic

#1 magneto

magneto

    Grand Master

  • Members
  • PipPipPipPipPip
  • 1,295 posts
  • Joined: 04-October 11
  • Location:Canada
  • Name:Ryan K

Posted 28 July 2012 - 03:10 PM

Hi,

I am experimenting with the new namespaces but I couldn't find a way to do this. Basically I want to refer to a VEX code file stored in the Extra Files tab to be included like this:

#include "myEmbeddedFile.vfl"

I tried namespaced syntax too. But it doesn't work. I didn't try this method before namespaces so not sure if it would work?

I assume the opdef syntax is not something the built-in include function would recognize? Python has a dedicated hou.readFile that knows about opdef paths, but for VEX is this not possible?


Thanks :)

#2 hopbin9

hopbin9

    Houdini Master

  • Members
  • PipPipPipPip
  • 803 posts
  • Joined: 14-March 10
  • Location:Canada
  • Name:Hop Bin

Posted 28 July 2012 - 04:19 PM

opdef references are parameter level references inside Houdini that are valid at the time of a node cooking.

VEX can be compiled on the command line by vcc outside of Houdini. It's also only compiled once, where opdef can change depending on what OTL was loaded. Since the include statement is only evaluated when VEX is compiled, then I don't think it's possible to have an opdef reference.

I could be wrong as I've never written VEX by hand.
Posted Image
Come download the free open source asset library for Houdini.
Help us reach 1,000 fans on facebook!

#3 magneto

magneto

    Grand Master

  • Members
  • PipPipPipPipPip
  • 1,295 posts
  • Joined: 04-October 11
  • Location:Canada
  • Name:Ryan K

Posted 28 July 2012 - 04:39 PM

It's a shame if it can't be done. Because I have a lot of code libraries that I include but if Extra Files can't be used, then I will have to copy paste everywhere and keep track of every little code and make sure to update them if any of them changes.

You did write VEX though, I got you to do it :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users