How to access some of the "enable" attributes of Camera and Viewpoint via python

How to access some of the "enable" attributes of Camera and Viewpoint via python

Anonymous
Not applicable
515 Views
0 Replies
Message 1 of 1

How to access some of the "enable" attributes of Camera and Viewpoint via python

Anonymous
Not applicable

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)
0 Likes
516 Views
0 Replies
Replies (0)