SOP VOP Variables

   4177   6   1
User Avatar
Member
48 posts
Joined: July 2005
Offline
I've created a SOP VOP network that modifies the Point Color (Cd), as well as some other point variables, and it works fine. The problem is that by connecting any input to the Cd output the Cd variable is created and added to the geometry. Even if I use a switch with null going into it, Cd is always created, which can cause problems later in the network. I know I could always delete the variable by adding another SOP to the network, but the issue also involves other variables too.

So how do I OPTIONALLY have variables added to the geometry??

Hope I'm being clear on the question.

Thanks for you help!
Robert
Adtech Communications Group
User Avatar
Member
1631 posts
Joined: July 2005
Offline
Hey Robert,

After computing the values, connect the result to a Parameter VOP and set the name of the attribute. To create a new attribute, check the “Use Input Value If Parameter Not Bound” & “Export Parameter” toggles in the Parameter VOP.

You need not connect the Parameter VOP to any output parameter, eg Cd & it should appear as an attribute.

I hope the above helps!

Cheers!
steven
User Avatar
Member
48 posts
Joined: July 2005
Offline
Hi Steven,

Thanks for the input, but won't that ALWAYS generate the Cd attribute on the geometry???

I'm looking for a way to toggle the generation (modifation) of the Cd attribute from within the SOP parameter interface. So if I toggle on “Add Cd Attribute” it will, if I toggle off it WON't generate it.

Any further ideas?

Thanks,
Robert
Adtech Communications Group
User Avatar
Member
1631 posts
Joined: July 2005
Offline
Hey Robert,

Doh! I wasn't thinking straight.

Okay, I think I got it right this time, I hope. Create your toggle, pipe it to an If-Then VOP, set the Condition to “True” and go into the If-Then VOP. In the If-Then VOP, put down an Add Attribute VOP which already has Cd set by default.

Now, you can toggle Cd On and Off.

I hope the above helps now.

Cheers!
steven
User Avatar
Member
4140 posts
Joined: July 2005
Offline
Yah beat me to it!

Actually I had a moment to test this earlier today and it didn't work - I'm not sure if it's because Cd is some sort of global reserved attribute. Or maybe I jist screwed up.

Anyway, I'm sure Robert will try this and get back to us…

Cheers,

J.C.
John Coldrick
User Avatar
Member
48 posts
Joined: July 2005
Offline
I got it!

Thanks guys … the If/then VOP did the trick!

Feed two toggle(int) parameter VOPS into the If/then Condition and Next inputs.

Feed a 3 float (vector) into the next input (default color)

Inside the If/then VOP add the Add Attribute VOP inline between the vector input and output. If/Then input goes to adata input on the Add Atttribute VOP. The Newdata output of the Add Attribute VOP feeds the output connector.

Whew!

Thanks for bringing the If/then VOP to my attention, as I hadn't really noticed it before.

In a practical sense this really helps. I have been building a Noise SOP that will add noise to point position, point normals, uv, or point color. For times when I just want to add noise to one of those I didn't want the other attributes getting inserted (and mucking up rendering). So this does it!

Thanks,
Robert
Adtech Communications Group
User Avatar
Member
4140 posts
Joined: July 2005
Offline
Doh! I forgot the Add Attribute - that's it!

Glad it worked out…

Cheers,

J.C.
John Coldrick
  • Quick Links