magneto Posted May 29, 2016 Share Posted May 29, 2016 Hi, Is there a way to read/write attributes in Volume Wrangle? For example if your volume primitive had a count attribute? Or if you want to get the name of the currently processed volume and store it? It feels a little like a black box. Also when you don't bind every volume to density and change each volume, is it the same as using Bind Each Volume to Density in terms of performance? I just don't know if doing this: @density = 1; @heat = 1; @temp = 1; ... is the same as (when Bind Each Volume to Density): @density = 1; Because if it was in Attribute Wrangle, it would be different as the first method would be run for each element. Thanks Quote Link to comment Share on other sites More sharing options...
pezetko Posted May 29, 2016 Share Posted May 29, 2016 VolumeWrangle is just HDA with Volume VOP inside. To my quick test with VolumeVOP (4xfloat VDB, bind/bind export node and multiplied by AA noise), Bind Each Volume to Density is slower then Autobind by Name. Try to think about volumes as different type of primitives. Name is just another primitive's attribute. 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted May 30, 2016 Author Share Posted May 30, 2016 Thanks pezetko. If I do something like this in a Volume Wrangle, I don't see any new attribute though. For example I have a prim attribute called count with a value of 5 for everyone: i@mycount = i@count; I don't get a new attribute on the volumes. I just wanna see if I am able to access i@count properly which also doesn't seem to be the case. Quote Link to comment Share on other sites More sharing options...
edward Posted May 30, 2016 Share Posted May 30, 2016 There are no attributes for voxels in Houdini. 1 Quote Link to comment Share on other sites More sharing options...
Skybar Posted May 30, 2016 Share Posted May 30, 2016 If you want an attribute on the primitives, use the Primitive Wrangle? Quote Link to comment Share on other sites More sharing options...
magneto Posted June 5, 2016 Author Share Posted June 5, 2016 On 5/30/2016 at 7:08 AM, Skybar said: If you want an attribute on the primitives, use the Primitive Wrangle? I can't because I need to modify voxel values. Quote Link to comment Share on other sites More sharing options...
anim Posted June 5, 2016 Share Posted June 5, 2016 if you need to get/set primitive attributes from Volume Wrangle, use prim(), addprimattribute() and setprimattribute() functions, since binding in Volume Wrangle binds to volume data not primitive attributes Quote Link to comment Share on other sites More sharing options...
magneto Posted June 5, 2016 Author Share Posted June 5, 2016 Thanks anim. What do you use for the @primnum? Do you get the @primnum from the volume name, which might actually have a duplicate? Quote Link to comment Share on other sites More sharing options...
anim Posted June 5, 2016 Share Posted June 5, 2016 there is no @primnum or @ptnum as Volume Wrangle doesn't iterate over volume primitives in the same way as in Attrib Wrangle, what are you trying to do? Quote Link to comment Share on other sites More sharing options...
magneto Posted June 5, 2016 Author Share Posted June 5, 2016 I just want to modify volumes using prim attributes. For example divide voxel values by a value stored in a prim attribute on that volume. But doing this for multiple volumes that each have their own prim attributes. Quote Link to comment Share on other sites More sharing options...
anim Posted June 5, 2016 Share Posted June 5, 2016 not sure how you can do it in just Volume Wrangle/VOP for arbitrary number of input volumes maybe use ForEach to loop over volume primitives, then you can always get attribute from primitive 0, bind to density and alter it, you would need to make sure all volumes are just float volumes 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted June 5, 2016 Author Share Posted June 5, 2016 Thanks anim, I understand. That's the problem with volumes, they could be floats but also VDB vec3s, but overall I will use your ForEach idea. Quote Link to comment Share on other sites More sharing options...
anim Posted June 5, 2016 Share Posted June 5, 2016 well, I said that mostly for simplicity as you can always have just float volumes even to represent vector or matrix fields but of course you can make it to work with mix of vec3, float vdbs and houdini volumes then in foreach just switch between Volume Wrangle/VOP bound to vector field and Volume Wrangle/VOP bound to float field based on type of the volume 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted June 5, 2016 Author Share Posted June 5, 2016 Thanks anim that would be a good technique but if you want to cover all types of volumes, I imagine you will have to have a dozen volume vop/wrangles, right? int32, int64, bool, matrix volumes etc? Quote Link to comment Share on other sites More sharing options...
anim Posted June 5, 2016 Share Posted June 5, 2016 well, not really all houdini volumes are composed of float volumes, no matter what data type they represent and most used VDBs are either float or vec3 (personally I have never used int or bool, but they would probably both bind as int, so in the end you would end up switching max 3 types) 2 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.