Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - wcrouch

Pages: [1]
1
One of the sbs files that I am writing automation code for throws an error when I attempt to save it.  I have reduced my code to simply opening & saving the file and the error persists, implying something is wrong with the sbs file.

For example, running this:
Code: [Select]
sbsDoc = substance.SBSDocument(aContext, sbsfile)
sbsDoc.parseDoc()
sbsDoc.writeDoc()

Results in a 160+ line traceback error that loops through the same 4 modules in pysbs.  Below is the end of it.  ([toolsdir] does not appear in the traceback, that is my edit)

Code: [Select]
  File "[toolsdir]\python\3.7\Lib\site-packages\pysbs\sbscommon\values.py", line 625, in write
    aSBSWriter.writeSBSNode(aXmlNode, element, 'treelist')
  File "[toolsdir]\python\3.7\Lib\site-packages\pysbs\api_decorators.py", line 54, in wrapper
    return function(*args, **kwargs)
  File "[toolsdir]\python\3.7\Lib\site-packages\pysbs\sbswriter.py", line 90, in writeSBSNode
    aSBSObject.write(self, aNewNode)
  File "[toolsdir]\python\3.7\Lib\site-packages\pysbs\api_decorators.py", line 54, in wrapper
    return function(*args, **kwargs)
  File "[toolsdir]\python\3.7\Lib\site-packages\pysbs\sbscommon\values.py", line 569, in write
    for element in self.mElements:
TypeError: 'NoneType' object is not iterable

It's like the class SBSTreelist in values.py gets handed a bunch of empty data and cannot handle it.

As I mentioned I think something is wrong with the sbs, but I'm unsure what to look at.  What's stranger is that running the command line tools, such as sbsmutator, have no problem editing the file.  It's just pysbs that has an issue.  Any advice or wild guesses are appreciated!

2
Hello,

I am writing some SAT tools to generate textures automatically using template graphs.  Normally, when applying a preset file to a graph, I would use sbsmutator to apply the preset file to the sbs before rendering.

However this time I have to apply a preset to a node within the graph.  That node being an instance of another .sbs file.  This can be done through the Designer UI, by simply selecting the node and loading a preset from the 'instance parameters' menu.

The only solution I have right now is to use sbsmutator to edit the file the sub-graph is sourced from.  This is not ideal, as that file is an exclusive checkout in our version control. Meaning only one instance of the code could ever run at a time, since it requires possession of an exclusive file.

Do you have an example of applying a preset file to a sub-graph through SAT?

Pages: [1]