Hi there,
I’m currently trying to implement a parameter bind workflow within my GUI by using the external Drag/Drop Callback function implemented in Container COMPs. I certainly managed the drag kind of part but I’m a little stuck with the drop functionality.
That’s the current code within the ‘onDropGetResults(comp, info)’ area:
nameDrop = comp.parent().name
module = comp.parent(3)
if any(par.name == str(nameDrop[:-1] + '1') for par in module.customPars):
locationDrop = [module.par.str(nameDrop + '1'), module.par.str(nameDrop + '2')]
else:
locationDrop = [module.par.nameDrop]
print(locationDrop)
locationDrop = info['dragItems']
#debug('\nonDropGetResults comp:', comp.path, '- info:\n', info)
return {'droppedOn': comp}
With this I’m getting an error when declaring ‘locationDrop’ within the if statement as the object ‘module’ (which is a Base COMP with a bunch of custom parameters) has no attribute/parameter ‘nameDrop’. When I print(nameDrop) though I’m getting back the correct parameter name as shown in the Textport.
Is it possible to use variables after op(‘x’).par. at all?
I’m really new to Python so please forgive me any dumb questions… Any help would be greatly appreciated!
Greetings