gaurav Posted July 10, 2014 Share Posted July 10, 2014 Why directly indexing into a given component of a vector field using parm type float doesn't work ? For example volume prim having a named attribute "test.x" isn't accessible with the same name of type float inside volume vop. Some insights will be helpful Thanks, -Gaurav Quote Link to comment Share on other sites More sharing options...
Skybar Posted July 10, 2014 Share Posted July 10, 2014 From the help: Autobind by Name Will use the name primitive attribute to determine which volume binds with which parameter. If the name attribute isn’t present, the first volume is bound to density. A name like “foo” will be bound to the float parameter “foo”. A name of “foo.x” will be bound to the x component of the vector (three float) parameter “foo”. A name like “foo.zx” will be bound to the x,z component of the matrix (three by three) parameter “foo”. Since it's a vector component it is bound as the X of that vector, despite it being a float field on its own. So simply access the vector field as "test" and then Vector To Float VOP or Get Vector Component VOP to access X. Quote Link to comment Share on other sites More sharing options...
gaurav Posted July 11, 2014 Author Share Posted July 11, 2014 Hi David, My question is why direct indexing doesn't work ?AFAIK vector data type in single houdini volume primitive is n't possible yet. since vector fields are 3 separate volume primitives stacked up togather. What prevents volumevop accessing each primitive directly. Thanks, -Gaurav Quote Link to comment Share on other sites More sharing options...
anim Posted July 11, 2014 Share Posted July 11, 2014 it does work for me (in VEX and VOP) unless it is component of merged VDB volume Quote Link to comment Share on other sites More sharing options...
gaurav Posted July 11, 2014 Author Share Posted July 11, 2014 Hi Tomas, Could you share an example hip ? Thanks, -Gaurav Quote Link to comment Share on other sites More sharing options...
anim Posted July 11, 2014 Share Posted July 11, 2014 (edited) I misunderstood you question, thought you are talking about accessing vector volume component directly by name with volumesample() as opposed to getting the whole vector volume using volumesamplev(), which works but back to you original question you can't name vex variable therefore parm using . (dot) , it will get converted to _ (underscore) so your variable would bind to volume named test_x if it would exist, not test.x in wrangle it's much more straightforward v@test[0] but I don't think that creating vector parm/bind vop and extracting component you want is a bad thing, it makes your code work independently of whether you use merged VDB vector volumes or split ones and it's consistent with attributes Edited July 11, 2014 by anim Quote Link to comment Share on other sites More sharing options...
gaurav Posted July 15, 2014 Author Share Posted July 15, 2014 Thanks ! that was helpful 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.