Hi,
When i try and create detail attributes on a VDB and then save them out using a File SOP, I find the attributes are being saved as primitive attributes rather than detail attributes.
In some case, its really important that the data is save as a detail attribute ( preferable as a party of the header if thats possible ).
Even when I create the attributes as detail with “Save To Info Block” toggled ON, when writing it out as a VDB the data is still saved as primitive variables.
Works fine as BGEO but not as VDB, which is the format that I need!
This seems like a bug to me, any help would be appreciated.
Cheers,
j.
Saving Detail Attributes into VDB
3025 5 1-
- jhiggins
- Member
- 4 posts
- Joined: Feb. 2007
- Offline
-
- edward
- Member
- 8081 posts
- Joined: July 2005
- Offline
I don't think the .vdb file format has the concept of attributes that are global for the file at all(?). In the OpenVDB world, you just have a bunch of “grids” and those are represented as VDB primitives within Houdini. I suggest you try asking on the OpenVDB forum [openvdb.org].
-
- jhiggins
- Member
- 4 posts
- Joined: Feb. 2007
- Offline
Hi edward,
I guess I know this is possible b/c i'm trying to post-process filter a vdb (generated outside of houdini) and the problem i'm having is that the detail attributes are now becoming primitive attributes thus not allowing me to keep the data the same going in and out as the input vdb which is causing me issues.
I will post a similar question to the OpenVDB Forum, but I feel pretty positive there is a way to do it.
This is what I was able to quickly find so far from looking at the docs.
http://www.openvdb.org/documentation/doxygen/codeExamples.html#sHandlingMetadata [openvdb.org]
Specifically, this part
“Metadata of various types (string, floating point, integer, etc.—see metadata/Metadata.h for more) can be attached both to individual Grids and to files on disk. The examples that follow refer to Grids, but the usage is the same for the MetaMap that can optionally be supplied to a file or stream for writing.”
I'm guessing the MetaMap would consist of the detail attributes and can be written to disk independent of being associated with a grid.
Let me know your thoughts, this would be really helpful!
Cheers,
j.
I guess I know this is possible b/c i'm trying to post-process filter a vdb (generated outside of houdini) and the problem i'm having is that the detail attributes are now becoming primitive attributes thus not allowing me to keep the data the same going in and out as the input vdb which is causing me issues.
I will post a similar question to the OpenVDB Forum, but I feel pretty positive there is a way to do it.
This is what I was able to quickly find so far from looking at the docs.
http://www.openvdb.org/documentation/doxygen/codeExamples.html#sHandlingMetadata [openvdb.org]
Specifically, this part
“Metadata of various types (string, floating point, integer, etc.—see metadata/Metadata.h for more) can be attached both to individual Grids and to files on disk. The examples that follow refer to Grids, but the usage is the same for the MetaMap that can optionally be supplied to a file or stream for writing.”
I'm guessing the MetaMap would consist of the detail attributes and can be written to disk independent of being associated with a grid.
Let me know your thoughts, this would be really helpful!
Cheers,
j.
-
- jhiggins
- Member
- 4 posts
- Joined: Feb. 2007
- Offline
Hey edward,
So i've been told the secret sauce to reading/writing out detail attributes into a vdb is along the lines of the following.
for writing:
openvdb::Vec3IMetadata myVec3iDetailAttrib(openvdb::Vec3i(x, y, z));
openvdb::MetaMap:
tr metaMap = file.getMetadata();
metaMap.insertMeta(“myVec3i”, myVec3iDetailAttrib);
for reading:
openvdb::MetaMap:
tr metaMap = file.getMetadata();
openvdb::Vec3IMetadata::ConstPtr myVec3iDetailAttrib = metaMap->getMetadata<openvdb::Vec3IMetadata>(“myVec3i”);
The example is a for vec3i detail attrib, but I'm guessing there would be similar analogs for other data types ( string, float, vector, etc ) and similarly there's decent way to loop all of the MetaMap data similarly which I'm guessing would be something more along the lines of how it would be integrated into the translator.
Let me know if this will work and more so if I need to follow this up with a formal BUG submission.
Again this would be really helpful fix for what I'm currently trying to do. I would hope if it were possible it could go into an h13 build.
Cheers,
j.
So i've been told the secret sauce to reading/writing out detail attributes into a vdb is along the lines of the following.
for writing:
openvdb::Vec3IMetadata myVec3iDetailAttrib(openvdb::Vec3i(x, y, z));
openvdb::MetaMap:
tr metaMap = file.getMetadata();metaMap.insertMeta(“myVec3i”, myVec3iDetailAttrib);
for reading:
openvdb::MetaMap:
tr metaMap = file.getMetadata();openvdb::Vec3IMetadata::ConstPtr myVec3iDetailAttrib = metaMap->getMetadata<openvdb::Vec3IMetadata>(“myVec3i”);
The example is a for vec3i detail attrib, but I'm guessing there would be similar analogs for other data types ( string, float, vector, etc ) and similarly there's decent way to loop all of the MetaMap data similarly which I'm guessing would be something more along the lines of how it would be integrated into the translator.
Let me know if this will work and more so if I need to follow this up with a formal BUG submission.
Again this would be really helpful fix for what I'm currently trying to do. I would hope if it were possible it could go into an h13 build.
Cheers,
j.
-
- edward
- Member
- 8081 posts
- Joined: July 2005
- Offline
You should always follow up with support.
Offhand, I would have expected no detail attributes saved out with the .vdb because what if you had other geometry? Then it's not clear to me if those detail attributes are intended for the VDBs or not. This part of the pipeline was from the OpenVDB team and so any changes here should/will require their input as well.
Offhand, I would have expected no detail attributes saved out with the .vdb because what if you had other geometry? Then it's not clear to me if those detail attributes are intended for the VDBs or not. This part of the pipeline was from the OpenVDB team and so any changes here should/will require their input as well.
-
- jhiggins
- Member
- 4 posts
- Joined: Feb. 2007
- Offline
-
- Quick Links

