magneto Posted August 23, 2012 Share Posted August 23, 2012 Hi, I am making a digital asset that allows users to specify the attribute name they want to use for the operation. I have a VOPSOP inside, with an Inline VOP, that uses the import VEX function: vector v; import($attribute, v, 0); But since I have to specify the type of the attribute being imported, do I have to have a different version for each type? Is there a way to query the type of an attribute? Or do I have to create a menu parameter at the asset level that requires the user to specify the type? I don't know which SOPs do this, but I found that Smooth SOP allows you to use any attribute without specifying the type. So then there is a slick way to do this, right? Thanks Quote Link to comment Share on other sites More sharing options...
DanBode Posted August 24, 2012 Share Posted August 24, 2012 In vex you would need to specify the attribute type. You could query the type of the user selected attribute in python pretty easily though, and have the python tell your vop which type to use. 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted August 24, 2012 Author Share Posted August 24, 2012 Thanks, the python trick should help for sure. I will look into it today. Do you know what python function does that from memory? Quote Link to comment Share on other sites More sharing options...
DanBode Posted August 24, 2012 Share Posted August 24, 2012 The way python and vex view attributes in Houdini is a bit different so there's no one function that will tell you which vex type your attribute is. Usually I use hou.attrib.dataType(), first to identify strings and integers, then if hou.attrib.dataType() is a float I use hou.attrib.size() to check if the float is really a vector or a matrix. 1 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.