Access baked lightprobe / irradiance volume data from Python?

Is it possible to access the baked data from a light probe through Blender’s Python API?

In particular I’m hoping to get Spherical Harmonics coefficients for each cell in an Irradiance Volume, but coefficients for a Reflection Cubemap probe would be fine too. I’m assuming that’s stored in a cache somewhere, but digging around in the console (e.g. bpy.context.*) and the source code isn’t getting me anywhere. :thinking:

Thanks!

6 Likes

Closest I could get is:
bpy.ops.scene.light_cache_bake()
bpy.ops.scene.light_cache_free()
bpy.context.scene.eevee.gi_cache_info

It doesn’t look like there are bindings for python, afaik. Would need a patch?
Suppose someone who’s never tried to expose new APIs in blender would try to do this, any pointers? What would be the right way to do it?

4 Likes

I think that’s correct, yes.

Suppose someone who’s never tried to expose new APIs in blender would try to do this, any pointers?

I tried to figure this out, too, but don’t understand C++ well enough to get anywhere with it sorry. There were definitely pointers involved. :sweat_smile:

I’m pretty sure all of that code is C, anyways :stuck_out_tongue:

1 Like

Haha, well, i guess that tells you how far I got on this myself!

By the way, I posted the same suggestion on rightclickselect if anyone would like to upvote it.

3 Likes

Lol. Yes.
I think Don and I are interested in getting that blender lightprobe data into three.js’s three.js docs. I’ve got all the C/C++ experience required. I’m hesitant to try to put a patch together, as i expect I’ll just make the interface wrong way and my PR will get rejected.

I guess I’m looking for a “sponsor” that would be the right person to review the work who could tell me how they would do it, so that we’re all happy in the end.

4 Likes

Has anyone made any headway on this? Recently started to look into this myself and want to make sure I am not duplicating any work.

1 Like

@netpro2k no progress on the Blender portion of this, as far as I know. I did write up a draft PR to three.js for light probe volumes defined by interpolated SH values:

1 Like