[SOLVED] From Python RegionView3D to core RegionView3D struct.

As part of a new Python API thing Im implementing, the new function has a bpy.types.RegionView3D as parameter.
What type has this Python RegionView3D when passed into the C function, and how do I get the pointer to the corresponding C struct RegionView3D?

Also how do I get to the other ViewContext members when only the rv3d member is known?

Ive been trying for hours now…

If you grep for “RegionView3D” in the makesrna folder the line that defines it for python also has the C type it’s wrapping.

I would just tell you but I don’t have the blender source on this computer so…

Found the answer!

Need to pass it from Blender to C as a “BPy_StructRNA *pyrv3d”

Then get to the C struct as follows:

RegionView3D *rv3d = (RegionView3D *)(pyrv3d->ptr.data);

Now I still need to get at the other ViewContext members…