Sitni Sati Forums
Maxscript, setPath and Grid dimensions... - Printable Version

+- Sitni Sati Forums (https://forum.afterworks.com)
+-- Forum: Products (https://forum.afterworks.com/forumdisplay.php?fid=4)
+--- Forum: FumeFX [max] (https://forum.afterworks.com/forumdisplay.php?fid=8)
+--- Thread: Maxscript, setPath and Grid dimensions... (/showthread.php?tid=1093)



Maxscript, setPath and Grid dimensions... - Jordan - 11-16-2010

It seems that when using maxscript to set the path to an existing simulation you can get the following querybox:
---------------------------
Grid dimensions does not match
---------------------------
Do you want to match FumeFX grid to the one in the file?
Usually, Yes means that you want to use existing output files,
No means that you want to overwrite them with the new simulation,
and pressing Cancel will allow you to select another file.
---------------------------
Yes No Cancel
---------------------------

It would be great to be able to specify which option you would like to choose using the function... something like:
$.setpath "C:\Fume\Sim_.fxd" "default" matchGrid:true


Re: Maxscript, setPath and Grid dimensions... - Jordan - 11-17-2010

Actually after a bit more testing I would say having this functionality is quite vital.
I am trying to setup some tools for network simulation via Deadline and maxscript. I need to be able to set simulation cache and the simulation path via a maxscript job that runs on a server running deadline in slave mode.
Simulating is fine and setting paths via script works fine when the dir is empty but when it comes to doing a render pass of that simulation using setpath doesnt change the path properly as there is already fdx files in that dir and im guessing the querybox breaks something.
I have tried adding an entry to the deadline Popup Handler which should detect the popup and press "yes" but its not working.
Is there any way to fix this??
Thanks


Re: Maxscript, setPath and Grid dimensions... - jrand - 11-17-2010

2.0 and greater have added a param to the SetPath function

So it should look like this:

$FumeFX02.setPath "E:\thePath\FumeFX01_.fxd" #match

Although I haven't tried the match parameter until now it doesn't appear to be functioning correctly. It simply returns the boolean false with a non-matching grid. AFAIK it is supposed to match the simulated grid dimensions.

You may also want to look into setSilentMode when calling functions that can throw confirm dialog boxes, this should suppress them.


Re: Maxscript, setPath and Grid dimensions... - Jordan - 11-18-2010

ahh, thanks jrand, I totally overlooked that. I think that will do the trick, although all the extra settings dont get applied in slave mode (spacing, length, width, adaptive grid etc) So ill just have to do it by hand!


Re: Maxscript, setPath and Grid dimensions... - sitnisati - 11-18-2010

Hello,

The syntax should be:
$FumeFX01.setPath "f:\\temp\\ffxSim_0000.fxd" #(#default ,#match)

..if you omit 0000, it won't be checked at all and it won't be matched as well.

Kresimir


Re: Maxscript, setPath and Grid dimensions... - jrand - 11-18-2010

Haha, thanks for the snippet! Now please put that in the manual Big Grin

Don't ask why didn't register to me :$ a single parameter seems to satisfy the function for some reason. I guess it is supposed to work that way, even though it is not encapsulated in an array?


Re: Maxscript, setPath and Grid dimensions... - sitnisati - 11-22-2010

I've put it intot he help file.
SetPath expects array of params, so you can send one or 10.
Note is added to the help file.

Thanks,

Kresimir


Re: Maxscript, setPath and Grid dimensions... - jrand - 11-25-2010

Thanks, I don't know how many times I have copy pasted that particular snippet into a script and threw an error. At least I hopefully figured it out by now. Smile