Driver Variables: document camera.location vs camera.matrix_world. #104513

Merged
Alexander Gavrilov merged 1 commits from angavrilov/blender-manual:pr-camera-matrix into blender-v3.6-release 2023-07-17 17:28:51 +02:00

Blender 3.6 introduced context property variables for drivers, which
allow context-dependent access to the active scene or view layer
without an explicit reference to a specific scene. This also allows
access to the active camera via a Scene property.

One major use case for this is accessing the camera transformation
for various potential uses like automatic level of detail. However,
the documentation isn't completely clear on how to access the true
transformation, as opposed to the raw animation channels before
constraints and parenting.

This aims do fix that oversight by making some wording more clear,
and providing an easily understandable explanation of world_matrix.


Since context properties is a new 3.6 feature, I suggest adding this to the 3.6 manual branch to help users apply the new feature robustly.

Blender 3.6 introduced context property variables for drivers, which allow context-dependent access to the active scene or view layer without an explicit reference to a specific scene. This also allows access to the active camera via a Scene property. One major use case for this is accessing the camera transformation for various potential uses like automatic level of detail. However, the documentation isn't completely clear on how to access the true transformation, as opposed to the raw animation channels before constraints and parenting. This aims do fix that oversight by making some wording more clear, and providing an easily understandable explanation of world_matrix. ----- Since context properties is a new 3.6 feature, I suggest adding this to the 3.6 manual branch to help users apply the new feature robustly.
Alexander Gavrilov added the
Module
Animation & Rigging
label 2023-07-17 01:46:57 +02:00
Alexander Gavrilov requested review from Sybren A. Stüvel 2023-07-17 12:04:46 +02:00
Alexander Gavrilov requested review from Sergey Sharybin 2023-07-17 12:04:46 +02:00
Sergey Sharybin requested changes 2023-07-17 12:24:45 +02:00
@ -190,0 +190,4 @@
.. tip::
Although the values of the x/y/z animation channels for the camera location can be accessed
via ``camera.location[0/1/2]``, retrieving its true location and orientation after parenting

"true location" -> "location in the world space"

"true location" -> "location in the world space"
@ -190,0 +197,4 @@
* ``matrix_world[0][0/1/2]`` is the *Screen Right* direction vector (camera local X).
* ``matrix_world[1][0/1/2]`` is the *Screen Up* direction vector (camera local Y).
* ``matrix_world[2][0/1/2]`` is the **opposite** of the direction the camera is pointing.
* ``matrix_world[3][0/1/2]`` is the true world space *location* of the camera.

"is the true world space" -> "is the location in the world space"

"is the true world space" -> "is the location in the world space"
Sybren A. Stüvel requested changes 2023-07-17 12:38:25 +02:00
Sybren A. Stüvel left a comment
Member

Thanks for the improvements @angavrilov , it certainly helps to clarify things.

the documentation isn't completely clear on how to access the true transformation, as opposed to the raw animation channels before constraints and parenting.

I agree with Sergey. In Blender terminology, this would be 'the evaluated transformation' or 'the visual transformation'. Using "the true transformation" is not a Blender term, and thus can cause confusion. Furthermore, the evaluated transform can be expressed in various coordinate systems, so world vs. local is perpendicular to original vs. evaluated.

It's just a small nitpick, overall I think these additions are very welcome.

Thanks for the improvements @angavrilov , it certainly helps to clarify things. > the documentation isn't completely clear on how to access the true transformation, as opposed to the raw animation channels before constraints and parenting. I agree with Sergey. In Blender terminology, this would be 'the evaluated transformation' or 'the visual transformation'. Using "the true transformation" is not a Blender term, and thus can cause confusion. Furthermore, the evaluated transform can be expressed in various coordinate systems, so _world vs. local_ is perpendicular to _original vs. evaluated_. It's just a small nitpick, overall I think these additions are very welcome.
Alexander Gavrilov force-pushed pr-camera-matrix from 6ae49fe75c to 4d4b2800d1 2023-07-17 12:52:47 +02:00 Compare
Alexander Gavrilov force-pushed pr-camera-matrix from 4d4b2800d1 to e727ffbadc 2023-07-17 13:47:05 +02:00 Compare
Sergey Sharybin approved these changes 2023-07-17 14:32:24 +02:00
Sybren A. Stüvel approved these changes 2023-07-17 17:01:42 +02:00
Alexander Gavrilov merged commit 9a2175144f into blender-v3.6-release 2023-07-17 17:28:51 +02:00
Alexander Gavrilov deleted branch pr-camera-matrix 2023-07-17 17:28:52 +02:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-manual#104513
No description provided.