Write a custom VOP node?

   2633   2   1
User Avatar
Member
36 posts
Joined: Aug. 2006
Offline
Hello,

I'd like to be able to write my own custom vop node, ideally in VEX, much as one writes a custom shop or vop. Something like:

vop myFactorial (
int n = 3;
) {
int prod = 1;
int i;
for (i = 1; i <= n; i += 1) {
prod *= i;
}
ans = prod;
}

I see that vop is not a valid vex context. Is there any way to do this? Note that I know vop otls can be made from vop subnets, but I want to be able to WRITE, ie. code, a vop.

Thanks,

Jeremy.
User Avatar
Member
1390 posts
Joined: July 2005
Offline
Hi there,
take a look on the oldschool blog entries:
http://www.sidefx.com/index.php?option=com_content&task=blogcategory&id=115&Itemid=216 [sidefx.com]

for a detail description on how to develop your own vops from a code.

As a shortcut: for mantra shaders, I usually write: surface something() {…} shader, and after testing it as a pure vex shader (“vcc -l” command) I recompile it with -m flag. vcc takes care of everything, and creates vop instead of shop from my code!
User Avatar
Member
36 posts
Joined: Aug. 2006
Offline
Much thanks SYmek! Those tutorials look very promising, though I can't check them just now (no headphones). That cool trick with vcc -m should do me for now - even makes export parms into outputs, which is great!

Jeremy.
  • Quick Links