In order to simulate a specific production process in Blender I need to ensure that the scene's gravity "down" is aligned with the viewport's angle.
In other words in this case:
"Down" should be along the x-axis, like this:
I know I can get the view matrix and decompose it like this:
t, r, s = bpy.context.space_data.region_3d.view_matrix.decompose()
and I can get/set the scene's gravity like with
bpy.context.scene.gravity
How do I combine the two so that things always fall "from" the viewpoint and "towards" the point being looked at?