• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Loading cache with maxscript doesn't resize, breaks preview
#1
Heya Folks!

I'm doing a job where I've to add breath to live action footage to make it seem cold. Since there's a lot of shots, I'm using a load of premade caches and then using a maxscript tool to make loading them from a library easily.

In terms of the code, I'm using the following:

Code:
TheFumeGrid = FumeFX() --width:100 length:100 height:100
TheFumeGrid.SetPath TheCacheFile #(#default,#match)
TheFumeGrid.SetPath TheCacheFile #(#match)

So it's loading in the cache properly which is fine, but it's not matching the dimensions of the cache I'm loading in correctly each time. The variable called "theCacheFile" is a string that I make based on options chosen in my maxscript ui and it looks for a path built from the text of those options.

I've tried using the setPath Command twice so I can use the #match flag again and try and give it a second chance to match the original grids dimensions but no good.

The second thing is if I load in a grid in this way, the preview window won't work. If I manually load in the cache, I'll get the window asking if I want to match and the preview looks fine.

Any thoughts or am I doing dumb things with my code?

Cheers!
  Reply
#2
Hello,

In the filename, did you maybe omit the following?

$.SetPath "F:\\temp\\FumeFX\\aa_0000.fxd" #(#default ,#match)
For #match, if you omit _0000 (or any existing frame number), FumeFX and cache won't be checked for grid dimensions and won't be matched if grid and cache have different sizes.

I hope it will work now.

Regards,
Kresimir Tkalcec
  Reply
#3
Yep, my script is :

Code:
TheCacheFile = (theRandomCache + TheCacheString[TheCacheString.count] + "_0000.fxd")

It seems to work sometimes but not all the time. Also I notice that the cache files are written out with the smoke, temperature, velocity and extra detail channels and when I load anything with this method, the fume ui is stating that it's using smoke and fire as it's channels. The preview window doesn't work so would it be worth loading up the fdc file too to set an initial state for the grid with all of the appropriate channels?

The full code I'm using for the fume loading bits is as follows, all of the variables in the first few lines are bits of strings set by maxscript radio buttons so nothing strange.

Code:
TheFumeCacheRoot = (theRootPath + "\\" + TheLetter.selected + "\\" + TheLetter.selected + "_" + TheWindDir + "_" + LoudnessType + "_" + dissipationType + "_" + raiseType + "\\")
            print ("I'm going to load " + theRootPath + "\\" + TheLetter.selected + "\\" + TheLetter.selected + "_" + TheWindDir + "_" + LoudnessType + "_" + dissipationType + "_" + raiseType + "\\")
            TempFumeCachePath = undefined
            TempFumeCachePath = GetDirectories (TheFumeCacheRoot + "\\*")
            
            print ("There are " + TempFumeCachePath.count as string + " subfolders for that cache")
            print TempFumeCachePath
            
            -- Pick a random Cache to load
            
            theRandomCache = TempFumeCachePath[random 1 TempFumeCachePath.count]
            TheCacheString = filterString theRandomCache "\\"
            TheCacheFile = (theRandomCache + TheCacheString[TheCacheString.count] + "_0000.fxd")
            
            TheFumeGrid = FumeFX width:100 length:100 height:100
            TheFumeGrid.SetPath TheCacheFile #(#default,#match)
            TheFumeGrid.SetPath TheCacheFile #(#match)
            TheFumeGrid.offset = slidertime
            
            TheFumeGrid.transform = $.transform
            
            TheFumeRot = eulerangles 90 0 0
            
            Rotate TheFumeGrid TheFumeRot
            in coordsys local move theFumeGrid [0,0,-1.0]
            
            print TheCacheFile

Cheers!

John
  Reply
#4
I popped in the FDC line using TheFumeGrid.LoadSim before pulling in the actual cache to see if that made a difference but alas no! It just seems like maxscript loading doesn't work very consistently. Would I be better off also saving out a preset when I'm simming my files and loading that in too?

Cheers!
  Reply
#5
Hello,

Quote:"Also I notice that the cache files are written out with the smoke, temperature, velocity and extra detail channels and when I load anything with this method, the fume ui is stating that it's using smoke and fire as it's channels".

Yes, that is correct as cache channels loading is not anyhow related to what you have selected for output.
However, you will need to manually setup the rendering settings in a newly created grid, weather by save/load presets or directly via script.

Regards,
Kresimir Tkalcec
  Reply
#6
Ah super, so if I save my presets for each type of sim it and load them first, the cache will at least fit. I notice that doing this still doesn't let the preview work, but at least the grid is the right size now.

Is there any way to load a preset from a network drive rather than your local fume folder?

Apologies for the long delay in responding - the job that I set this up for originally was killed, but then a similar job came up about 6 months later Big Grin
  Reply
#7
Hello,

No problems... the time flies Smile
LoadPresets() will only load preset files from the presets path, sorry - no option to load from any other path via mxs.

Regards,
Kresimir Tkalcec
  Reply
#8
Okay, that's no problem, we can just push presets to peoples computers.

Any idea why the preview isn't behaving? It's not that much of an issue but for newer users it might make them a bit nervous not being able to see that their grid has loaded anything!

Looking forward to seeing all the fun new things in fume 4, apparently there's some nice speed increases!
  Reply
#9
Don't know for sure as setpath should set the path to the caches and FumeFX should just read them from there...just like you have manually pointed to the caches.

As for the version 4.0 - there will be some really nice time saving features in it Smile

Regards,
Kresimir Tkalcec
  Reply
#10
Just curious, I'm trying out simming to field 3d to allow testing of the vray volume grid object. It seems that if you set your preferences to use gzip compression with field 3d files, files submitted to a farm with backburner mode enabled won't respect the setting and sim using fume's custom compression. Is there any chance of this being fixed or is there anything else that I need to do for it to behave?

Cheers!
  Reply
#11
Hello,

It's a local preferences - you should setup you sim machine to save to gzip f3d as well.

Regards,

Kresimir Tkalcec
  Reply
#12
Ah cool, so that's a sneaky edit on the DoZipCompressionF3D=Yes line in our fume.ini then.

Much appreciated for the help kresimir, I'd say this might be a thing that'll catch some others out in future, might be worth noting in the docs.
  Reply
#13
You're welcome !
We might add a FumeFX.ini section to the help file with short descriptions.

Thank you.

Regards,
Kresimir Tkalcec
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)