-
Notifications
You must be signed in to change notification settings - Fork 0
/
correctRotation.lua
86 lines (70 loc) · 1.93 KB
/
correctRotation.lua
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
------------------------- correctRotation v1.66 --------------------------
-- martin [at] klangbild [dot] lighting --
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
function correctRotation()
local FirstFixture = 001 -- first fixture to modify
local LastFixture = 199 -- last fixture to mofify
local cmd = gma.cmd
local sleep = gma.sleep
local fixId
local nodRotX
local modRotY
local modRotZ
local found
sleep(0.1)
cmd('Clear All')
sleep(0.1)
for fixId = FirstFixture, LastFixture do
gma.feedback("reading fixture " .. fixId)
if(gma.show.getobj.handle("Fixture " .. fixId .. ".1"))then
sleep(0.1)
local handle = gma.show.getobj.handle("Fixture " .. fixId .. ".1")
sleep(0.1)
local fixName = gma.show.property.get(handle,3)
gma.feedback('FixtureType is ' .. fixName)
found = 1
if string.match(fixName, "GD0001") then
modRotX = 0
modRotY = -90
modRotZ = 0
--copy these lines and change for your needs--
elseif string.match(fixName, "GD0002") then
modRotX = 0
modRotY = 45
modRotZ = 0
--copy these lines and change for your needs--
elseif string.match(fixName, "GD0003") then
modRotX = 0
modRotY = 0
modRotZ = 180
--copy these lines and change for your needs--
elseif string.match(fixName, "GD0004") then
modRotX = 90
modRotY = -45
modRotZ = 0
else
found = 0
gma.feedback("NO MATCH")
end
if found == 1 then
sleep(0.1)
gma.feedback("MATCH")
sleep(0.1)
cmd('Fixture ' .. fixId)
sleep(0.1)
cmd('Rotate3D At ' .. modRotX .. ' 0 0 /relative')
sleep(0.1)
cmd('Rotate3D At 0 ' .. modRotY .. ' 0 /relative')
sleep(0.1)
cmd('Rotate3D At 0 0 ' .. modRotZ .. ' /relative')
sleep(0.1)
cmd('Clear All')
sleep(0.1)
end
else
gma.feedback("no fixture")
end
end
end
return correctRotation;