Skip to main content
Participant
March 15, 2022
Question

sbsDoc.writeDoc fails if a mesh is linked to the sbs file

  • March 15, 2022
  • 0 replies
  • 91 views

I'm finding that when using pysbs, the sbsDoc method 'writeDoc' (that is, just saving the file) fails if a mesh is linked in the sbs file.

I've reduced my code down to just reading and writing the file.

from pysbs import context, substance

sbsfile = "D:/sat_error_repro/testfile.sbs"
aContext = context.Context()
sbsDoc = substance.SBSDocument(aContext, sbsfile)
sbsDoc.parseDoc()
sbsDoc.writeDoc()

I've also reduced the sbsfile to an empty package with only an imported cube in it.  sbsDoc.writeDoc() always fails.  The file format of the mesh (fbx, obj) does not matter.  Upon removing the linked mesh, it succeeds. 

 

Even stranger is that if I have pysbs create the linked mesh resource (instead of it already existing in the file), writeDoc succeeds.  While this creates a workaround in some situations, it overcomplicates tools that should be simple.  I'm currently blocked on developing a tool that requires manipulating graphs in a file that has meshes linked in it, and should not be removed.

What is going on?

Traceback error is attached in a .txt file. Designer file and cube fbx are also attached, though that seems silly.  Again, it's just an empty package with only the cube linked as a resource.

 

Designer version is 11.3.1

Pysbs version is 2021.3.0

This topic has been closed for replies.