Can we declare a custom function before the main function and defining it after main function in houdini?

   1349   2   0
User Avatar
Member
16 posts
Joined: April 2019
Offline
in C, I can write something like:

int sum(int a, int b);
void main()
{
sum(1, 2);
}
sum(int a, int b)
{
return a + b;
}

I can see the main() much easier in this way by putting all the custom functions behind the main(). However I don't know how to do that in houdini.
Is there any way to achieve that?

thx~
User Avatar
Member
7759 posts
Joined: Sept. 2011
Online
You can in .vfl VEX source files. You need to manually compile them though with the vcc commandline tool. If you are talking about a ‘wrangle’ node, you don't actually have access to the main function. The entirety of the source is a void function called in the main function.

You can also define nodes in C++ using the HDK and compiling them, which would follow the form you describe.
User Avatar
Member
16 posts
Joined: April 2019
Offline
jsmack
You can in .vfl VEX source files. You need to manually compile them though with the vcc commandline tool. If you are talking about a ‘wrangle’ node, you don't actually have access to the main function. The entirety of the source is a void function called in the main function.

You can also define nodes in C++ using the HDK and compiling them, which would follow the form you describe.

thx~
  • Quick Links