Internal Operators... optimized?

I’d love to hear from anyone who’s found internal operators valuable to their workflow… when/how do you like to use them?

Is there an optimized way to reference an iop from the the COMP that holds it? I can get a path for an op by index, referencing me.par['iop1'] but there’s no optimized python way to look up that path as as a dict of iops from the shortcut key.

I’ve found the COMP class method to access this dictionary from a parameter of the COMP with me.internalOPs, but the expression isn’t optimized. Wondering if this could be cached to quickly return an internal operator, from inside or outside of the COMP.

My ideal use case is a practice of making common operators like readme, icon, ext, bg, presetTable etc. that I’m using consistent and templated, ideally accessible as an attribute… ``me.readme’', or op(‘myComp’).presetTable returning the desired iops.

I suppose i could do this programmatically in an extension, perhaps a for loop on init that makes all of my iops a @property somehow, but getting this functionality out of the iop framework that already exists seems like a better solve.

I’m sure there’s some things i haven’t thought of here, so let me know if this is a bad idea and why

This could be made backwards compatible by giving each internal operator a [‘promoted’] parameter that would make that shortcut path an attribute

Not sure I fully understand the issue, but are you aware each internal operator gets a python-optimized shortcut like iop.ShortcutName ? As explained on Internal Operators - Derivative

Isn’t that what you need?

image

yes, I’ve been using iops in this way, but by design they’re only available inside of the comp, meaning I can’t reference them from the container itself, or outside of the container if i needed to.

I’m hoping that if I go through the trouble of setting up iops, I could use them as variables for common features I might want on a lot of components, but that may change based on the structure/hierarchy from COMP to COMP.

Below is an example of how I’d like to use them… really i wish they behaved like an attribute of the COMP, so that I could drill in to op('iopBase').presets or from the op reference me.cues[me.par.Curcue, 'name'] for example. even me.iop.whatever would do what i want it to, and I can kind of get the functionality i want by using internalOPs, but it isn’t an optimized expression.

They were designed exactly for that, primarily for things you want to use inside but do not want the outside user to see or monkey with. Of course they can be manipulated to be used in other ways, but that was the original intention.

The missing optimized expression is probably just an oversight, seems like it could/should be.

1 Like