354
« on: May 02, 2019, 04:55:14 PM »
It worked great once i fixed my mistake.
I changed what Craig wrote a little just because it is easier to understand for me.
Unfortunately when I do that it usually results in an oops.
Here is the completed code.
--check for manual cut and wait if manual cut on
local hregC = mc.mcRegGetHandle(inst, 'iRegs0/ManCut')
local ManualCut = mc.mcRegGetValue(hregC)
while (ManualCut == 1) do
wx.wxMilliSleep(100)
ManualCut = mc.mcRegGetValue(hregC)
ManCutWasOn = 1
end
if (ManCutWasOn == 1) then
mc.mcRegSetValue(hregC, 1)
else
mc.mcRegSetValue(hregC, 0)
end
My mistake was that instead of getting the Register value in the While loop like Craig showed me I did it with a variable.
Well at first I did not have it getting the register value inside the loop so of course the variable never changed in the While loop.
Worked great after I added the "ManualCut = mc.mcRegGetValue(hregC)" inside the loop.