Author Topic: Need help with a script for updating the file format  (Read 1608 times)

I tried to use

But I must do something wrong because it returns SBSIncompatibleVersionError

this is the type of error it returns :

[INFO][__main__] Parse substance /Volumes/1To/Photometrie_textures/Ground/Country_road_asphalt/SD_export/
[ERROR][pysbs.api_decorators] Exception of kind SBSIncompatibleVersionError in pysbs.substance.substance, line 182: SBSDocument.parse()
[ERROR][pysbs.api_decorators] Exception of kind SBSIncompatibleVersionError in pysbs.substance.substance, line 204: SBSDocument.parseDoc()
[ERROR][__main__] !!! [demoUpdatePackagesVersion] Failed to update a package
Traceback (most recent call last):
  File "/Users/macpro/Documents/Allegorithmic/Substance Designer/", line 72, in <module>
    scriptUpdatePackagesVersion(aContext, aPreviousVersion, aPreviousUpdaterVersion, aPackagesFolderRootDir)
  File "/Users/macpro/Documents/Allegorithmic/Substance Designer/", line 69, in scriptUpdatePackagesVersion
    raise error
NameError: global name 'SBSIncompatibleVersionError' is not defined
[Finished in 2.9s with exit code 1]

I understand the script tries to load the .sbs, under a certain error (versionerror) it continues but I don't get where the actual error happens.
I don't understand how the aPreviousVersion, aPreviousUpdaterVersion variables operate.
And which form they have...

Thank you for your help.
Last Edit: May 30, 2018, 11:25:40 pm

I don't get what should be

also the no-dependency is a bit strange, does it means it will update the files without going through the dependencies and updating them also?!
aCommand = [aUpdaterPath, '--no-dependency', '--output-path', '{inputPath}', '--output-name', '{inputName}_updated', '--presets-path', aPresetPackagePath]
I brute forced it removed a few if and try and it worked.
But I still don't understand the logic behind it. For educational purposes I would gladly understand.