forked from katiemorrisfx/KMFX-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkmfx_cycleRGB.py
38 lines (27 loc) · 866 Bytes
/
kmfx_cycleRGB.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import fx
from fx import *
cycleRGB = None
previousRGB = None
class KMFXcycleRGBchannels(Action):
"""Overrides the shortcuts ro cycle rgb modes using a single key shortcut"""
def __init__(self,):
Action.__init__(self, "KMFX|Cycle RGB channels")
def available(self):
pass
def execute(self):
beginUndo("Cycle RGB channels")
global cycleRGB
if cycleRGB == None:
cycleRGB = fx.Color(1, 0, 0, 0)
fx.viewer.setChannelMask(cycleRGB)
elif cycleRGB == fx.Color(1, 0, 0, 0):
cycleRGB = fx.Color(0, 1, 0, 0)
fx.viewer.setChannelMask(fx.Color(cycleRGB))
elif cycleRGB == fx.Color(0, 1, 0, 0):
cycleRGB = fx.Color(0, 0, 1, 0)
fx.viewer.setChannelMask(fx.Color(cycleRGB))
else:
cycleRGB= None
fx.viewer.setChannelMask( fx.Color(1, 1, 1, 0))
endUndo()
addAction(KMFXcycleRGBchannels())