Hi there,
I’m trying to make a little patch to control DMX lights with TD.
In this patch I’ve made a container for each cue, called: cue0, cue1 etc.
Now I made a little system that lets you create a new fixture and automatically copy this to all the cue containers using a CHOP execute. The cue containers are automatically listed with an opfind DAT and a for loop runs to copy the new fixture to each individual cue container.
The script for this is the following:
def onOffToOn(channel, sampleIndex, val, prev):
n = op(‘opfind1’)[1,0]
name = parent().par.Name
i = op(‘numCues’).col(0, val=True)
numCues = op(‘numCues’).numRows - 1
op(n).name = name
op(n).par.Footprint = parent().par.Footprints
for copy in i:
w = op('../../'+ (copy)).copy(op(n))
w.nodeY = w.nodeY - int((op('listFixtures').numRows - 1) * 150 - 150)
return
that’s finally working! hoooray!
Now I want to make the same construction, but to be able to delete a specific fixture.
So I used an opfind DAT again to list all the fixtures, with a dropdown menu you can select the desired fixture and a button triggers a CHOP execute to delete the selected fixture from all cue containers. the problem now is that it only deletes the fixture from cue0 and not the other cue containers. With the system to create new fixtures I solved this by using a for loop. But now that doesn’t seem to work… Hopefully and very likely I’m making a silly mistake, but could really use some help trying to work this out!
The script for deleting a fixture is:
def onOffToOn(channel, sampleIndex, val, prev):
n = op(‘null2’)[1,0]
i = op(‘../numCues’).col(0, val=True)
for delete in i:
OP.destroy(op('../../../' + (delete) + '/' + (n)))
return
Thanks!