Popup handeler Syntax

Hi,
Im trying to customise the 3dsmax.py to accomidate for FumeFX scripting shortfalls.
Im trying to script continuing a sim and when you run the script command to continue you get a messagebox asking if you are sure.
The message box has the title “FumeFX”
I would like to press “Yes” to this and then ignore the simulation dialog.

this one ignores the sim dialog nicely:
self.AddPopupIgnorer( “.FumeFX Dynamics:.” )

If i put this in to press yes to the continue dialog it also tries to press yes to the “FumeFX Dynamics:” dialog.
self.AddPopupHandler( “.FumeFX.”, “Yes” )

i tried this:
self.AddPopupHandler( “FumeFX”, “Yes” )
thinking that maybe it would do a non-wildcard match on the window name, but it dosent seem to work

The error im getting is this:
ERR: FumeFX: Stop/Continue data was found after frame 10. Do you want to proceed?

I tried adding this:
self.AddPopupHandler( “.*FumeFX[^: ]”, “Yes” )
so it will only find the FumeFX windows that dont have a " " or “:” after the “FumeFX” part, but im still getting the error:
ERR: FumeFX: Stop/Continue data was found after frame 10. Do you want to proceed?

Is there something weird with the message box or just me?

Hey Jordan,

Try using the following:

self.AddPopupHandler( "FumeFX$", "Yes" )

The ‘$’ tells the Popup handler to only look for “FumeFX” at the very end of the title, which should hopefully solve your problem. If not, let me know and I’ll look into this further :slight_smile:

Cheers,

  • Jon

Hi Jon,
Thanks for the reply. That dosent seem to work either, i still end up with the job failing with the error:
ERR: FumeFX: Stop/Continue data was found after frame 10. Do you want to proceed?

Is there an easier way to test this or see exactly what deadline sees as far as reading the popups. As every time I change the script I have to wait a couple of minutes for deadline to load up the job and error.

Also I was just wondering the logic behind having the .* combo, as in: “.window title.” . Im pretty new to RegEx :slight_smile:

Hi Jordan,

Just to confirm, I think it might be a good idea to make sure that the pop-up dialog title is ‘exactly’ how it looks and doesn’t contain some hidden characters, etc.

You can use WinSpy to drag the “target” icon in its top-left corner when you run the app and drop it onto the FumeFX pop-up dialog.
Can you copy this text into a forum post?
catch22.net/software/winspy

Also, can you provide the error log so we can see what is happening as perhaps there is some STDERR that needs to be handled as well?

HTH,
Mike

Regular Expressions actually look for a match anywhere in the string unless told otherwise, so there technically is no difference between “.window title.” and “window title” (as far as simple matching goes). Putting in the wildcards around it just makes it explicit that the string could be anywhere in the title.

But yeah, Mike’s suggestions are good ones; we should try and figure out if there’s extra ‘hidden’ character in the title. If there’s just extra white-space at the end of the title, this should work:

self.AddPopupHandler( "FumeFX\s*$", "Yes" )

The added \s* will account for any amount of white-space characters between “FumeFX” and the end of the title.

Hope this helps,

  • Jon

Thanks Mike, we were looking for that program!!
So it seems it is just FumeFX, no hidden characters or white space. Here is a screenshot below.

Jon, I also tried your string but I am getting the same error, here is the log:

The “Default output file count (28) doesnt match expected count (80)” is part of the processing script that will error if the sim didnt finish. The interesting thing is that the file count check happens after the FumeFX: Stop/Continue pops up and errors yet it is still processed.

[code]Error Type:

RenderPluginException

Report Message:

Exception during render: An error occurred in RenderTasks(): RenderTask: Unexpected exception (Exception caught in 3ds max: – Runtime error: Default output file count (28) doesnt match expected count (80)
2011/08/11 09:34:45 INF: Loaded C:/Users/illiad/AppData/Local/Prime Focus/Deadline/slave/jobsData/Fumeline_1108090939.max
2011/08/11 09:34:46 WRN: Gamma Correction is Being Enabled
2011/08/11 09:34:46 INF: Job: C:/Users/illiad/AppData/Local/Prime Focus/Deadline/slave/jobsData/Fumeline_1108090939.max
2011/08/11 09:34:49 ERR: FumeFX: Stop/Continue data was found after frame 20. Do you want to proceed?
)
at Deadline.Plugins.ScriptPlugin.RenderTasks(Int32 startFrame, Int32 endFrame, String& outMessage)

Slave Log:

gs:
0: INFO: >V-Ray detected as current renderer.
0: INFO: +Enabled VRay silent mode
0: INFO: >Performing XREF workaround…
0: Plugin rendering frame(s): 0
0: INFO: Render Tasks called
0: INFO: Executing script: C:\Users\illiad\AppData\Local\Prime Focus\Deadline\slave\jobsData\deadline_maxscript.ms
0: INFO: Starting MAXScript Job…
0: INFO: Success Disableing Fume Simulation Loop mode
0: INFO: AnimationRange.Start: 1f
0: INFO: AnimationRange.End: 80f
0: INFO: frameRate: 24
0: INFO: Unhiding FumeFX dependent nodes
0: INFO: Unhiding FumeFX
0: INFO: Success running Fumeline_netFunctions
0: INFO: Success setting $‘FumeFX01’.gridSpacing = 0.3
0: INFO: Success creating Default network simulation directory: Y:\RnD\Jordan\fxd_temp\fumelineTest\FumeLine_1108090939_0001_gridSpacing_0.3
0: INFO: Success setting Default fume output to Y:\RnD\Jordan\fxd_temp\fumelineTest\FumeLine_1108090939_0001_gridSpacing_0.3\FumeFXsh_
0: INFO: Success selecting Default cache for Default simulation
0: INFO: Found Contine Data. Attempting to Continue Sim
0: INFO: Continuing Default simulation
0: INFO: Ignoring popup “FumeFX Dynamics: Status”
---- August 11 2011 – 09:35 AM ----
Scheduler Thread - Render Thread 0 threw an error:
Scheduler Thread - Exception during render: An error occurred in RenderTasks(): RenderTask: Unexpected exception (Exception caught in 3ds max: – Runtime error: Default output file count (28) doesnt match expected count (80)
2011/08/11 09:34:45 INF: Loaded C:/Users/illiad/AppData/Local/Prime Focus/Deadline/slave/jobsData/Fumeline_1108090939.max

2011/08/11 09:34:46 WRN: Gamma Correction is Being Enabled

2011/08/11 09:34:46 INF: Job: C:/Users/illiad/AppData/Local/Prime Focus/Deadline/slave/jobsData/Fumeline_1108090939.max

2011/08/11 09:34:49 ERR: FumeFX: Stop/Continue data was found after frame 20. Do you want to proceed?

)

at Deadline.Plugins.ScriptPlugin.RenderTasks(Int32 startFrame, Int32 endFrame, String& outMessage)

Error Stack Trace:

at Deadline.Plugins.Plugin.RenderTask(Int32 startFrame, Int32 endFrame)
at Deadline.Slaves.SlaveRenderThread.RenderCurrentTask()


------------------------------------------------------------------------------------------[/code]
FumeFX_Popup.jpg

So from that error log it doesn’t look like Deadline itself is failing out on the popup; we print out a message with a dump of the message box if it does.

It looks like the “ERR: FumeFX: Stop/Continue data was found […]” error is coming directly from FumeFX, which then fails the render. Can you confirm for sure that the popup is showing up on the Slaves when rendering? I’m wondering if FumeFX is running in some kind of slave/network render mode that auto-fails if user input would ever be required (instead of actually displaying the dialogs).

It might be that FumeFX has some kind of “continue on error” option that might be useful here, I’ll do a bit of digging to see if I can find something like that.

Cheers,

  • Jon

Ill ask the fume guys about it. Really the best solution would be for fume to have script option to suppress the popup but it seems some of the scripting stuff in FumeFX isnt added thoughtfully enough.
I have mentioned this as a bug/wish list in the past.

Ive watched a slave start the job but cant see if the popup turns up. I think something flicks up but its pretty quick.

Hi Jordan,

Yep, good call. I noticed your FumeFx support forum post yesterday about this issue :slight_smile:

Is there any difference when you run the same job locally without Deadline? Ie: do you get the poup dialogs? If not, how about you submit the FumeF job to Deadline with “workstation mode” enabled and then your slave will act just like. Your workstation? If this still doesn’t work, then it must be a difference in the Full and Simulation install package from FumeFX.

If you think a popup is appearing but being suppressed to fast for you to see it, then you could temporaily disable any popup ignorers & handlers in the 3dsmax.py file and start effectively from the beginning to see what happens. Maybe, there is another pop-up dialog appearing, which is totally unrelated to FumeFX but is causing the instability?

HTH,
Mike

So running it in workstation mode with all the popup handlers on works fine.
self.AddPopupHandler( “FumeFX\s*$”, “Yes” ) catches the window and presses Yes and the simulation continues.

If I remove all the FumeFX popup handlers I get the Continue sim popup error, but in a way that recognizes that it exists!

0: WARNING: Detected popup dialog "FumeFX". 0: WARNING: ---- dump of dialog ---- 0: WARNING: Button: &Yes 0: WARNING: Button: &No 0: WARNING: Static: 0: WARNING: Static: Stop/Continue data was found after frame 20. Do you want to proceed? 0: WARNING: ---- end dump of dialog ---- ---- August 16 2011 -- 09:40 AM ---- Scheduler Thread - Render Thread 0 threw an error: Scheduler Thread - Exception during render: An error occurred in RenderTasks(): RenderTask: Unexpected exception (Dialog popup detected: Title "FumeFX", Message "Stop/Continue data was found after frame 20. Do you want to proceed?")

When putting it back to slave mode and disabling all the fumefx popup handlers i get an error on the sim window, not the Continue Sim popup:

0: WARNING: Detected popup dialog "FumeFX Dynamics: Status". 0: WARNING: ---- dump of dialog ---- 0: WARNING: Button: Hold open 0: WARNING: Button: End beep 0: WARNING: Button: Stop 0: WARNING: Button: Pause 0: WARNING: Button: Cancel 0: WARNING: msctls_progress32: 0: WARNING: Static: 0: WARNING: Static: 0: WARNING: Static: 0: WARNING: Static: 0: WARNING: ListBox: 0: WARNING: Static: 0: WARNING: Static: Elapsed: 0: WARNING: Static: Estimated: 0: WARNING: Static: 0: WARNING: ---- end dump of dialog ----

BUT the Continue Sim pop up is not handled this way, If i add back the ignore popup for the above (self.AddPopupIgnorer( “.FumeFX Dynamics:.” )) I get the same old error, no mention of a popup or its details, just this:

[code] Scheduler Thread - Render Thread 0 threw an error:
Scheduler Thread - Exception during render: An error occurred in RenderTasks(): RenderTask: Unexpected exception (Exception caught in 3ds max: – Runtime error: Default output file count (28) doesnt match expected count (80)
2011/08/16 09:34:01 INF: Loaded C:/Users/illiad/AppData/Local/Prime Focus/Deadline/slave/jobsData/Fumeline_1108090939.max

2011/08/16 09:34:01 WRN: Gamma Correction is Being Enabled

2011/08/16 09:34:01 INF: Job: C:/Users/illiad/AppData/Local/Prime Focus/Deadline/slave/jobsData/Fumeline_1108090939.max

2011/08/16 09:34:06 ERR: FumeFX: Stop/Continue data was found after frame 20. Do you want to proceed?

)

at Deadline.Plugins.ScriptPlugin.RenderTasks(Int32 startFrame, Int32 endFrame, String& outMessage)
[/code]

So there must be a difference between the way its working in slave mode.

We were thinking that we could get the 3dsmax.py to convert the job to a workstation task if our maxscript job detects that it needs to but we are having trouble setting “useslavemode” to false through 3dsmax.py. We could edit the job info file directly but can seem to get the job directory on the repository or even just the job ID inside the 3dsmax.py. Any ideas?

Thanks for debugging this. That definitely implies that FumeFX doesn’t show this popup in slave mode. It just suppresses it and defaults to failing the render, so there is nothing for Deadline to “handle”. We’ll add the “self.AddPopupHandler( “FumeFX\s*$”, “Yes” )” popup handler to 3dsmax.py in the next release so that it can catch it in workstation mode though.

How are you currently submitting the maxscript jobs? I think the detection would need to be done on the submission side…

Im submitting through a modified version of SMTD functions and and submitting a .ms file that does most of the work.

As far as the logic of the “Use Workstation Mode” method goes we would have to have the job submit in slave mode, then the .ms would check for simulation continue data (which it would not find the first time it sims) and if all goes well it will just finish the job. If it fails then then next time the job starts up it should find the continue data, this is where I’d like to change the mode to Workstation mode and perhaps do a few other things like change the limit group or priority, then re queue the job so when it restarts it goes to workstation mode. We are just not sure the best way to change the job settings.

Hmm, I’m not sure how this would work, since by the time the maxscript determines if there is continue data, Max has already launched and it’s too late to switch to workstation mode. I guess you could set the job setting then, and then the third attempt would run in workstation mode.

There really isn’t a “good” way to change job settings from a maxscript. However, you might be able to hack something together. In maxscript, you should be able to call this to get the job’s ID:

With the job Id, you can now build up the path to the plugin info file in the job folder in the repository:

\your\repository\jobs[JobId]\max_job_info.job

You can tweak the UseSlaveMode setting in this file and save it, then fail the job from the maxscript so that the third attempt starts in workstation mode.

I hope that works… :slight_smile: