HOM How to retrieve DOP matrix field data

   2434   4   2
User Avatar
Member
81 posts
Joined: July 2010
Offline
I have a DOP object with a matrix field attached to it. How can I access the field's voxel data with Python? I assume there's a Volume object stored there, but I'm not sure how to retrieve it. For example, if my matrix field data is called “vgradient”, I have the following:

data = obj.findSubData('vgradient')
<hou.DopData of type SIM_MatrixField at obj0/vgradient>
data.recordTypes()
('Basic', ‘Options’)

I would like to be able to do something such as:

volume = data.getVolume()
value = volume.voxel(x,y,z)

How do I do the “getVolume()” step?
User Avatar
Member
383 posts
Joined: June 2010
Offline
I think I asked the same question some hours before ..
I guess we want to achive the same thing.

http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=25659 [sidefx.com]

but I didnt receive any answeres till now ..
www.woogieworks.at
User Avatar
Member
81 posts
Joined: July 2010
Offline
Thanks, the main question I have from there is how to access that volume data, as the matrix field does not have any geometry to call geo.prim() to get the volume. What function will return to me the volume data from the DopData?
User Avatar
Member
383 posts
Joined: June 2010
Offline
seth_ro18
Thanks, the main question I have from there is how to access that volume data, as the matrix field does not have any geometry to call geo.prim() to get the volume. What function will return to me the volume data from the DopData?

I dont completely understand your statement. A vectorfield is more or less 3 more attached Volumes, each storing one component of the vectorfield.
One for X component, one for Y and one for Z … Thats for SOP context but I guess it should be the same for DOP context, but I do most of my processing in python SOP context because I lack a lot of knowledge of the Houdini native tools …
www.woogieworks.at
User Avatar
Member
81 posts
Joined: July 2010
Offline
That makes sense, I'll want to get each component of the volume separately. In DopData, I can't see a way to get those though… Thanks for taking a look at this!
  • Quick Links