Geometry Nodes: Add Active Camera input node #113431

Merged
Hans Goudey merged 3 commits from Douglas-Paul/blender:active-camera-node into main 2023-12-12 19:11:15 +01:00

3 Commits

Author SHA1 Message Date
64d388bad9 Remove 'Has Active Camera' output 2023-12-09 19:34:55 -05:00
7cc1057cba Merge branch 'main' into active-camera-node 2023-12-09 19:32:30 -05:00
b6440ae992 Geometry Nodes: Add Active Camera input node
This adds a new "Active Camera" input geometry node, per #105761.

The node has two sockets:
* An object socket labeled "Active Camera" that retrieves the scene's
  current active camera
* A boolean socket labeled "Has Active Camera" that retrieves whether
  or not the scene has an active camera

The node is available from Input > Scene > Active Camera in the
geometry nodes Add menu.

Typical usage would be to connect this node to an Object Info node to
obtain its transform. This works as expected when the camera's
transform is animated, and also when there are markers on the timeline
that change the active camera.

In order to support the aforementioned changes in the active camera,
this implementation adds depsgraph relations for all cameras referenced
by timeline markers. This eliminates the complexity of updating the
depsgraph whenever the scene switches to a different active camera,
but of course it comes at the cost of including more objects than
strictly necessary in the depsgraph for scenes that switch cameras.
Dynamically updating the depsgraph upon camera changes could be a
future improvement if there proves to be sufficient need for it.
2023-10-20 19:47:51 -04:00