-
Notifications
You must be signed in to change notification settings - Fork 208
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
ExecuteButton (and Ctrl+E/R shortcuts) should use the current despatcher #866
Comments
I think there should be a concept of "the current despatcher" (in the UI, not the API) which is what the Ctrl+E/R shortcuts use. It should default to the LocalDespatcher, but could be set to a FarmDespatcher of some sort if that's what the user wants. I think "execute in background" should be the default for the LocalDespatcher - I just looked and was surprised to find it didn't operate that way already... |
Note that Ctrl+R is broken currently, as script._executeUILastExecuted doesn't seem to stick outside the _execute call in DespatcherUI. |
Yep - that's an unintended consequence of ScriptNode using the new leaner Cortex wrappers. There are ways we could work around it in DespatcherUI, but I'm trying to come up with a way of dealing with it better on the Cortex side. So for now I've been keeping it as a little thorn in my side to encourage me to do better... |
I'm about to add this current dispatcher concept, and it seemed natural to do it the same way as _executeUILastExecuted. Given the deadlines, I'm tempted to just get both working in DispatcherUI. Do you have a preferred way of doing that? Or do you think the Cortex side fix isn't far off? |
Also, any advice on how to execute in the background? Is that going to have to be a system call or some QThread magic? How should we go about saving the scene before starting the background execution (#310)? |
I think we should include a basic launcher UI as well. So pressing Execute (or Ctrl+e) would launch the Dispatch UI, where the dispatcher plugs, like executeInBackground and frameRange (#878), would be exposed. Should this UI just be the NodeEditor for the Dispatcher node launched as a popup? When the UI is first launched, it should set the frame range to match the script frame range. After that, it should respect the plug value. Ctrl+R shouldn't launch the UI but rather re-dispatch with the existing settings. |
Do you think the current dispatcher would be a per-script thing then? I kindof think it might be a global or per-app thing. I think I'd find it strange to open a new script, and find that the current dispatcher had changed. For background execution I think I'm in favour of ExecutableNode::execute() getting called in a separate process for a couple of reasons :
There's already an app called "execute" which will execute a set of nodes over a range of frames. I was thinking that that would be the low level tool that dispatchers would use to execute something in a separate process. If that seems reasonable, then I think it implies that we should use a background thread in the main gui app to control the process, but have it launch
I think the launcher UI should be a NodeUI for the current despatcher, rather than a full blown NodeEditor. The NodeEditor displays some irrelevancies like the node name and type, and also expects the node to live on a script. Making our own Window and putting a NodeUI in it let's us achieve the same thing without the extra gumph. |
So should currentDispatcher be stored in the app preferences then? Maybe with a dropdown based on registered dispatcher names? The Popen/execute bit sounds fine to me. Are there any good examples of maintaining a background thread which reports feedback to the main thread? Or should I check Jabuka for that? For the default serialseToFile location, what do you think about as subdir it in the script dir? |
I'm not sure where currentDispatcher should be stored right now - maybe we can decide that at a later date when we have the luxury of more than one dispatcher implementation? The There's one wrinkle in the threading stuff though, and that is that For the |
So are you thinking a plug called About squirreling away the temp script files, users of other apps do often want access to the farm scene directly, and might find it annoying to have to go digging around for it, which is why I thought at least specifying that path explicitly would be better. |
Yes, I was thinking of a plug to define a generic temp directory for dispatcher related stuff. But I don't think the base class should necessarily automatically call serialiseToFile() automatically - it seems reasonable that some Dispatcher implementations might just operate directly without needing the script saved at all. I was thinking the derived class would call serialiseToFile(), but using the location defined by the base class. I don't think I don't want this discussion to be a blocker on making progress though - any location is better than the current behaviour of |
Actually, immediately after writing that, I realized the LocalDispatcher needs control over the serializing, to avoid it when running in blocking mode ( |
I think the Dispatcher base class should probably just have a protected |
Oh, and |
And which gui app config to set it from? |
For executeInBackground, I'm wondering if we've under-thought this... If the UI starts the thread (regardless of which dispatcher is being used), then does
Using the execute app frames parameter limits us to whole frame execution (since FrameLists only accept ints). Again, passing the real context might be better. |
I arrived at the same conclusion about Good point about the execute app - do you think it's reasonable to extend that with a parameter to deal with arbitrary contexts or did you have some other mechanism in mind? I think my preference is to extend the execute app - for certain farm dispatchers (Tractor from what I remember) everything will have to be expressed as a command line anyway, so we might as well get that functionality in now rather than invent two separate mechanisms. Since the LocalDispatcher is going to be implemented in Python, it's pretty easy to convert context entries to human readable text with When we support clumping and must-execute-all-at-onceness, do you anticipate clumping together Contexts which differ in more than just the frame? If not, then we can just have a parameter for specifying a constant base context, and use the existing frames parameter to vary on top of that. Since the frame range the user selects before dispatch is a FrameList, let's work on the assumption that the FrameList parameter is sufficient for now - it won't be too hard to add an alternative means of specifying frames later, but let's not complicate things until it's actually necessary. So I think the command line format would basically look like this :
The op app has an example of how to set up a parameter to accept multiple flag arguments as the context argument does above. |
I have this mostly wrapped up, but I'm running into an issue with the -context args. Most of them work fine, but some of them are more complex and fail. Is it expected that any entry in the context should be serialisable with It seems the context from any of the image related ExecutableNodes (renders and writers) includes
|
This was extracted from #109, since the scope of that issue has been limited.
Currently the Execute button just calls execute() directly on the node, without using a Despatcher of any kind. It should use the LocalDespatcher instead, so that preDespatchSIgnal() and postDespatchSignal() can be relied upon in all cases.
We should also add an option to the LocalDespatcher - "execute in background", so that it's possible to execute either in the current session in a blocking way, or in a background process.
The text was updated successfully, but these errors were encountered: