magneto Posted March 30, 2012 Share Posted March 30, 2012 I am using the Transform Matrix VOP, and in the asset level, I have a checkbox for using a custom Translation. I want to hook the Custom Translation if this checkbox is turned on. How can I do this in the VOP level? Do I have to use an If VOP? Because I am not sure if I have to bring my Transform Matrix VOP inside. Thanks Quote Link to comment Share on other sites More sharing options...
anim Posted March 30, 2012 Share Posted March 30, 2012 you can use Switch VOP to switch among several values or if you want to optimize for speed more the If VOP is better since you can do all your conditional calculations inside and they will only be evaluated once condition is true 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted March 30, 2012 Author Share Posted March 30, 2012 Thanks anim. If I use the switch VOP, what should I connect for the "no value"? Basically I want the Translate value in the Transform Matrix to either have the value I supply or nothing connected to it. Kind of like the Null SOP, but Null VOP doesn't seem to have an output only input. Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted March 30, 2012 Share Posted March 30, 2012 (edited) switchVOP ? EDIT: Um, First ? Edited March 30, 2012 by mantragora 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted March 30, 2012 Author Share Posted March 30, 2012 Thanks mantragora, basically I need something like this: Not sure how this translates in the VOP land. Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted March 30, 2012 Share Posted March 30, 2012 Thanks anim. If I use the switch VOP, what should I connect for the "no value"? Basically I want the Translate value in the Transform Matrix to either have the value I supply or nothing connected to it. Kind of like the Null SOP, but Null VOP doesn't seem to have an output only input. If you don't connect your value Transform will have [0,0,0]. Can't you just plug Vector[0,0,0] into second input as default ? 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted March 30, 2012 Author Share Posted March 30, 2012 That makes sense. I didn't realize that was the standard way. But what about VOPs that have more connectable parameters than it shows in the parameters pane like the Lookat VOP? In that case, no connection would mean 0,0,0 vector for From and To Location fields. But what happens to the Up Vector? Would it also be 0,0,0 for no connection? Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted March 30, 2012 Share Posted March 30, 2012 But what happens to the Up Vector? Would it also be 0,0,0 for no connection? You set Up vector for your geometry and you don't want to change it. It's needed for proper geometry orientation. Quote Link to comment Share on other sites More sharing options...
magneto Posted March 30, 2012 Author Share Posted March 30, 2012 Yeah but it's optional, right? I thought it's needed to determine roll, but would still work without it (just like the object level lookat). Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted March 30, 2012 Share Posted March 30, 2012 Yeah but it's optional, right? When in doubt, check documentation lookat Vex function. This function have three overloads. Quote Link to comment Share on other sites More sharing options...
magneto Posted March 30, 2012 Author Share Posted March 30, 2012 The default value is not mentioned in the docs: http://www.sidefx.com/docs/houdini11.0/nodes/vop/lookat But I think it's 0,1,0. It seems to look the same when you use that value. VEX version is better though, more options Quote Link to comment Share on other sites More sharing options...
Ryan Posted March 31, 2012 Share Posted March 31, 2012 Have you tried the Two Way Switch VOP? It's basically a conditional statement. 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted March 31, 2012 Author Share Posted March 31, 2012 Thanks that's also an interesting VOP. I went with the Switch SOP for this case. Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted March 31, 2012 Share Posted March 31, 2012 Thanks that's also an interesting VOP. I went with the Switch SOP for this case. VEX doesn't have switch{} implemented like you can find in C++ or other C-like languages. So if you check the VEX code generated by TwoWaySwitchVOP and SwitchVOP or any other conditional VOP, you can see that they are using "if{}-else{}", conditional operator "?:" or variations of both for checks. No magic there. 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted March 31, 2012 Author Share Posted March 31, 2012 Thanks mantragora, that's good to know Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.