Jump to content
Stremik

Writing VEX SOPs

Recommended Posts

I'm tying to write an SOP OP that would allow multiple inputs.

How is it usually taken care of?

For instance I want to be able to pipe two sphere OPs in to this one and modify appearance of the spheres individually. Based on the R of each sphere.

Bigeer R of the sphere will resault in bigger displasement of the surfase of this individual sphere and vice versa.

Any help?

Thank you!

Share this post


Link to post
Share on other sites

OK. Let me put it this way.

When I do "Create Type From" in Houdini, I'm presented with an option

to spesify a minimum and maximum numbers of inputs.

How do I do it in VEX by hand? How does a custop VEX OP reads in inputs

and tells them apart?

Thanks!

Share this post


Link to post
Share on other sites

in VOPs you could use the import attribute

node, if I'm not mistaken.

-cpb

Share this post


Link to post
Share on other sites

I think t's in the .ds file that gets created. Try using the -p option with vcc and see what you get.

Share this post


Link to post
Share on other sites

Doesn't this work for you?

Share this post


Link to post
Share on other sites
Doesn't this work for you?

I think he is trying to do it by hand.

Try these out.

#pragma opname [your opname]

#pragma oplabel [your op's label, (the friendly name)]

#pragma opmininputs [min number of inputs]

#pragma opmaxinputs [max number of inputs]

jim.

Share this post


Link to post
Share on other sites
How does a custop VEX OP reads in inputs

and tells them apart?

I don't see anything off the bat that would tell which input the point is coming from. For second place..... you could always append a group SOPs right before each of the inputs. Then use the ingroup() function.

jim.

Share this post


Link to post
Share on other sites
#pragma opname [your opname]

#pragma oplabel [your op's label, (the friendly name)]

#pragma opmininputs [min number of inputs]

#pragma opmaxinputs [max number of inputs]

Just the kind of thing I was looking for.

Thanks.

Share this post


Link to post
Share on other sites

BTW. I wander if you happen to know wether "Quick Function Reference" includes oll of the VEX functions or is there something else?

It seems like this is the case. For instance, I couldn't find "maxinputs" and "mininputs" pragmas in there.

Share this post


Link to post
Share on other sites
Doesn't this work for you?

I think he is trying to do it by hand.

Try these out.

#pragma opname [your opname]

#pragma oplabel [your op's label, (the friendly name)]

#pragma opmininputs [min number of inputs]

#pragma opmaxinputs [max number of inputs]

jim.

You're right. I have missread this topic... (I think it's because of Stremik's reply. It made it look as if he was talking about VOPs).

Please excuse me for the inconvenience :ph34r:

Share this post


Link to post
Share on other sites
It seems like this is the case. For instance, I couldn't find "maxinputs" and "mininputs" pragmas in there.

The quick reference is here $HFS\houdini\vex\html\quickref.html

and the pragmas are here

$HFS/houdini/vex/html/compiler.html#cg_pragma

Those that I listed I found by creating a VOP with multiple inputs then started digging through the vex code. :)

jim.

Share this post


Link to post
Share on other sites
Those that I listed I found by creating a VOP with multiple inputs then started digging through the vex code.

I've tried this with SOPs but it wouldn't show any VEX code. :(

Please excuse me for the inconvenience

Don't be ridiculous man.

There can't be any.

Share this post


Link to post
Share on other sites
I've tried this with SOPs but it wouldn't show any VEX code. :(

Try right clicking VOP and choose "View Code". That should work. :unsure:

Please excuse me for the inconvenience

I'm sorry, I wasn't trying to be mean or anything. I just wanted to make sure we were all on the same page of music. :D

jim.

Share this post


Link to post
Share on other sites

BTW. Could it be that

#pragma opmininputs [min number of inputs]
#pragma opmaxinputs [max number of inputs]

are only available in VOP context?

Or all pragmas can be used with any context?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×