pane.placeOPs(...), is there a way to have code that executes after the placement has completed?
As part of RayTK’s palette, I’m transitioning to using placeOPs. There are cases where it needs to set up some parameters and such with relative paths to existing operators. But those relative paths become invalid after placement, since they were relative to where they were initially created (
One option would be to use absolute paths, but that’s not ideal for use in comps that could be loaded in different places in different toe files.
It would be great to be able to provide a callback to
placeOPs that gets called once the user has placed the operators.
For that specific example, it could just use the target operator name instead of the path since it can assume that they’re going to be in the same parent. But there are other cases where it would be useful to be able to initialize the operator once it’s in its final location.
Oh boy, I know your pain here.
I tried quite a lot of stuff, but the components being created in /sys/quiet first (and also being cooking disabled) can make stuff a little iffy.
I use a little proxy-component first, and replace it after it for place.The proxy-component has a OP-Style Parameter that is evaluating the
me expression. I then have a parameterExecute to react to the change of the parameter to replace the proxy with the actual component I want to place.
This way I have full control and the placed components als get initialised correctly.
Yeah… that makes sense.
So you have the placeOPs() instantiate a component which replaces itself once it lands in the final location.
I’m hoping that maybe Derivative could just add a callback option to placeOPs()…
But until then we’ve got weird hacks
/sys/TDTox/dropSurrogate if you want to see my weird hack for this