Drive from viewport resolution, other *viewport* details?

I’m learning animation nodes and am creating a tree to create fast edge line objects, displaced according to distance from camera, fov, and render resolution to create a single pixel thick edge line.

Obviously, something like that isn’t going to show up right in my viewports, which may have different resolutions even if I’m in camera view.

I know that I might not be able to make things work for multiple viewports, but is there any way that I can find out the resolution, eye position, and zoom of, say, viewport[0] and use that to drive a custom property?

If I can do that, is it also possible to drive on the basis of “am rendering” so that I can use viewport values when previewing, but render values when rendering?

Hi man,
Not an expert here but i got this on my stuff
hope that point you in the right direction XD

#  bpy.context.area
#  .area.type	       THE NAME , outliner, view3D, text editor		
#  .area.heght          H
#    for area in bpy.context.screen.areas:             	 view 3D  H		 !!!! Use a for to loop all area
#  .area.spaces.active.region_3d.view_matrix			
#  .area.spaces[0].region_3d.view_rotation	               #  view 3D  R                           	
#  .area.spaces[0].region_3d.view_location	              #   view 3D  L
1 Like