Ancestors

Toot

Written by Wojciech Jarosz on 2024-09-09 at 13:13

Anyone familiar with #Blender #development know whether its possible to access a volume’s #OpenVDB data in an export plugin written in #python? For instance, if I simply wanted to write out the bounding box of the vdb file? Even better: convert the OpenVDB file to #NanoVDB and write it out? Poking around python docs hasn’t yet been fruitful.

=> More informations about this toot | More toots from wjarosz@mathstodon.xyz

Descendants

Written by David on 2024-09-09 at 13:39

@wjarosz

bpy.context.object.bound_box() method gives the bounding box of the current selected object.

https://docs.blender.org/api/current/bpy.types.Object.html#bpy.types.Object.bound_box

P. D: I suspect it is for meshes. Doing a search on the docs for OpenVDB did not show to much info available.

=> More informations about this toot | More toots from DBG3D@masto.es

Written by Wojciech Jarosz on 2024-09-09 at 13:47

@DBG3D Thanks. Yes, I found this shortly after posting. It does seem to give me values corresponding to the dimensions of the volume in blender, so that’s a good start. Though ideally I’d like access to the actual VDB data, so I can use pyopenvdb functionality to inspect it and possibly convert it.

=> More informations about this toot | More toots from wjarosz@mathstodon.xyz

Written by David on 2024-09-09 at 13:58

@wjarosz

The OpenVDB that you want to convert is generated inside blender?

Or it is imported from a external OVDB file?

If its the first case as far as I can remember, there is no access to OpenVDB data with blender API. 🧐

In the second case you could use Blender Scripting workspace and try pyopenvdb to open and convert the external file.

You need to install pyopenvdb as a module in Blender first, I do not think is included.

=> More informations about this toot | More toots from DBG3D@masto.es

Written by Wojciech Jarosz on 2024-09-09 at 14:21

@DBG3D Thanks. Yes, it’s an imported OVDB file. I’ll play around in the scripting workspace. Does blender’s python API provide access to the externally referenced files? (I do see that volume.data.filepath = //bunny_cloud.vdb, but am not sure how to get at that data from the python script yet)

=> More informations about this toot | More toots from wjarosz@mathstodon.xyz

Written by David on 2024-09-09 at 15:08

@wjarosz

If you have the OVDB "outside" Blender you must treat as an external file. Like you will do from vanilla Python.

As I said I think blender doesnt allow you to read or write of an imported ovdb file. 🙄

=> More informations about this toot | More toots from DBG3D@masto.es

Written by Brian Savery on 2024-09-09 at 14:39

@wjarosz Take a look at this code from the ProRender exporter for blender. https://github.com/GPUOpen-LibrariesAndSDKs/RadeonProRenderBlenderAddon/blob/325eb7f9aa5328a02e097266e0c86b36fa6937ea/src/rprblender/export/volume.py#L104

=> More informations about this toot | More toots from bsavery@mastodon.gamedev.place

Written by Wojciech Jarosz on 2024-09-09 at 14:50

@bsavery This is very close to what I want. Thanks for the pointer!

=> More informations about this toot | More toots from wjarosz@mathstodon.xyz

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113107772099742315
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
304.441647 milliseconds
Gemini-to-HTML Time
1.300952 milliseconds

This content has been proxied by September (ba2dc).