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

Hello
I tried to use
https://support.allegorithmic.com/documentation/display/SAT/script_update_with_sbsupdater

But I must do something wrong because it returns SBSIncompatibleVersionError

this is the type of error it returns :

Quote
[INFO][__main__] Parse substance /Volumes/1To/Photometrie_textures/Ground/Country_road_asphalt/SD_export/splatter_1_2.sbs
[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/script_update_with_sbsupdater.py", line 72, in <module>
    scriptUpdatePackagesVersion(aContext, aPreviousVersion, aPreviousUpdaterVersion, aPackagesFolderRootDir)
  File "/Users/macpro/Documents/Allegorithmic/Substance Designer/script_update_with_sbsupdater.py", 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
Quote
aPreviousVersion
aPreviousUpdaterVersion

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?!
Quote
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.