Message 1 of 1
How to access some of the "enable" attributes of Camera and Viewpoint via python
Not applicable
11-07-2018
06:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
In the camera settings there are several on/off settings, you can manually toggle in the UI, but won't find in the Node Editor of the python docs.
The VRED developers decided to store the following single bit (boolean) values in a 64 bit value called "flags".
# 000000000000X000 (transition animation)
# 00000000X0000000 (show as wireframe)
# 0000000X00000000 (enable depth of field)
# 000000X000000000 (enable motion blur)
# 00000X0000000000 (dolly zoom)
# 0000X00000000000 (loop animation)
# 00X0000000000000 (display Camera)
# 0X00000000000000 (display Aim)
# X000000000000000 (evaluate navigation mode)
# So to enable the viewpoint transition animation you can call this:
camNode = getActiveCameraNode()
camNode.fields().setReal32('viewpointTransitionDuration', 2.0)
flags = camNode.fields().getUInt64('flags')
flags |= 1 << 3 # set bit to enable transition animation
camNode.fields().setUInt64('flags', flags)