GPU Cache not loaded when playblasting

GPU Cache not loaded when playblasting

e_reynaud3XF2J
Explorer Explorer
1,022 Views
3 Replies
Message 1 of 4

GPU Cache not loaded when playblasting

e_reynaud3XF2J
Explorer
Explorer

Hello,

I'm working with a script in Maya, and I've encountered an issue when dealing with scenes containing GPU caches. These GPU caches can take some time to load, and when I try to playblast the scene, the GPU cache geometries don't appear in the playblast until they're fully loaded. Is there a way to set up a callback or a mechanism to detect when all GPU cache geometries are fully loaded (not just their bounding boxes) so that I can initiate the playblast only after they're loaded? Any guidance on how to achieve this in Maya would be greatly appreciated

 

 

 

import maya.standalone
maya.standalone.initialize()
import maya.cmds as cmds
myscene = "myfolder/file.ma"
file_output = "myfolder/out.avi"
cmds.file(myscene , open=True)
cmds.playblast(filename=file_output)

 

 

0 Likes
Accepted solutions (1)
1,023 Views
3 Replies
Replies (3)
Message 2 of 4

brentmc
Autodesk
Autodesk
Accepted solution

Not an expert in this area but you should be able to change the gpuCache preferences for background reading in your script before loading the file?

 

cmds.optionVar(iv=('gpuCacheAllAuto', 0))
cmds.optionVar(iv=('gpuCacheBackgroundReadingAuto', 0))
cmds.optionVar(iv=('gpuCacheBackgroundReading', 0))
cmds.gpuCache(edit=True, refreshSettings=True)

 



Brent McPherson
Principle Engineer
Message 3 of 4

e_reynaud3XF2J
Explorer
Explorer

Thank you very very much!

It worked.

Message 4 of 4

bill.diack
Observer
Observer

When I try to call cmds.gpuCache I'm getting the error:

 

AttributeError: module 'maya.cmds' has no attribute 'gpuCache'

 

This is in Maya 2023.2. Is the cpuCache command only available in interactive mode? In batch mode the command should be available but simply do nothing.

 

0 Likes