File Cache node always writing the same file in PDG USD expo

   223   2   1
User Avatar
Member
6 posts
Joined: April 2025
Offline
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]
Edited by richardbao - Oct. 11, 2025 04:00:07

Attachments:
1.png (98.5 KB)
2.png (81.8 KB)
3.png (100.0 KB)
20251011-0723-06.2148781.mp4 (6.3 MB)
20251011-0724-59.5993928.mp4 (1.7 MB)

User Avatar
Member
3 posts
Joined: Oct. 2025
Offline
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.
User Avatar
Member
6 posts
Joined: April 2025
Offline
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.
  • Quick Links