Search - User list
Full Version: File Cache node always writing the same file in PDG USD expo
Root » Technical Discussion » File Cache node always writing the same file in PDG USD expo
richardbao
I tried to simplify my issue, so basically. i want to conver some obj file into usd with sopcreate node. and for each of the converted usd file. i wat to store them in a File Cache node for later use.
Inside the sopcreate node, i setup a file node to load obj file, setting up the file path to
`@directory`/`@filename``@extension`

then in the TOPs network. first i use a file pattern to traverse and get all obj file. then i sue a python top to batch processing each work Item(each obj file), inside the python lop. i create File Cache node to connect to the output of Sopcreate Node, and cache them for each work item. i suppose this logic should work fine but the issue is the result cache nodes all caching the same file. i thought it was the sopcreate not recook after wokr_item change. but if i manually click on differnt work item, the sopcreate would load accordingly.
here is the setup and some params details:





and here is the testing demo:
(please see the first MP4 file in the attach file)



though when i manually clicking , each work_item load properly:
(please see the second MP4 file in the attach file)

here is project file:
https://drive.google.com/file/d/10pT4WUd4yPXjOCRCn6d67O6Gj-8id0L0/view?usp=sharing [drive.google.com]
Gatellicited
Yeah, sounds like your File Cache path isn’t getting a unique token per work item try adding something like @pdg_index or @filename in the cache path so each job writes to its own file. Otherwise PDG just keeps overwriting the same one.
richardbao
Gatellicited
Yeah, sounds like your File Cache path isn’t getting a unique token per work item try adding something like @pdg_index or @filename in the cache path so each job writes to its own file. Otherwise PDG just keeps overwriting the same one.
Thanks for reply. I also consulted SideFX team for help and they replied that the python Tops cook asynchronously, which means it's generally not safe to cook other nodes or modify the scene in a Python Script TOP. The results may be inconsistent, out of order.the only way to solve this is to run it in a "in process scheduler" so that it run a single work_item a time on the main thread. and also configure the Python Script itself to run the script when the tasks cook in-process, so that they run on the scheduler instead of during the work item generation step.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB