-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a frame range plug to Dispatcher, allowing for batched dispatching #878
Comments
Do we even need to provide these utility methods if every dispatcher is going to have to call them anyway? What if we just do all that work privately in |
Perhaps we should have two plugs for frame range - an enum-style |
I have a local commit that adds a framesModePlug with those enum values, and a frameRangePlug, and a convenience function |
I've been thinking about this, and I think Dispatcher is leaving too much work to the derived classes - and providing utility methods that they all end up having to call anyway only really part way solves that. It seems to me that the argument to Does that seem reasonable, or are there concerns about losing flexibility there? |
Yeah, I agree, and I've done that already (locally) as I thought that's what you discussed in your comment a few days ago. I'm not using Now, I still think |
Well, So is the problem actually that you want |
Yeah, I guess that sums it up. Up till now we haven't required that the nodes passed to If we're going that way, what are your thoughts on my public |
I think a script is a pretty reasonable requirement, since most (all?) dispatchers will need to serialise it to work on it elsewhere. Making that a bit more explicit as you suggest sounds good. My inclination is more just to keep |
Just to expand on that last message, since I don't think I was very clear. It's not clear to me what the semantics of On the "must have a script" front, I notice that LocalDispatcher already checks for that and outputs an error message (but returns cleanly). How about we move that check to |
Sure thing. I wasn't sure what the preference was, throwing or reporting errors. Since the DispatcherWindow was eventually going to be tracking messages, I went for that approach. But I guess that's not as useful when dispatching outside the UI. As a side note, throwing does kind of suck in Gaffer right now. Any exceptions I've caused have generated a large/intimidating list of dangling widgets on shutdown. We should really clean that all up before users start seeing them. Otherwise their bug reports aren't going to contain any useful info. |
The preference is mostly to think in terms of an API layer which is useful in and of itself, and then a UI layer on top of that. Generally that implies exceptions are to be preferred, as they're the natural way of communicating errors to a caller, and they can always be caught and turned into messages by a UI layer. Messages just kindof shoot out the side, so an API caller wouldn't know anything was wrong... Python stores the last exception thrown indefinitely (until another exception is thrown). And that exception keeps all the stack frames at the point it was thrown alive, which in turn keeps all the variables alive. It's not very convenient. The argument is that you shouldn't use object lifetimes to manage resources in python anyway, instead preferring explicit calls to Those shutdown messages are very much just a diagnostic tool to help me make things as clean as possible and with as little use of garbage collection as possible though. A lot of the things they detect can be brute-forced-under-the-carpet at shutdown if necessary, by clearing sys.exc_info(), clearing the contents of any existing ScriptNodes and performing a full garbage collection cycle. But I would much rather fix things so we run lean and clean with as little garbage collection as possible. Your point about confusing users and muddying up bug reports is a good one though. Maybe we run with shutdown-diagnostics for developers and brute-force cleanup for users? |
We decided to use an IECore.FrameList style for this, so it should be a string plug. Some open questions:
static void contexts( const Context *prototype, vector<ContextPtr> &contexts )
static void tasks( vector<const Node*> &nodes, ExecutableNode::Tasks &tasks )
The text was updated successfully, but these errors were encountered: