Author Topic: Get SBS File Location  (Read 243 times)

Hello,

Apologies for the basic question, but I cannot for the life of me figure out how to get the SBS file location of the file I have open currently in SD2018.3 even after going through some of the API documentation

Code: [Select]
import sd
import sdplugins

from LTools.Tools import Exporter

class ExportToTGAFullSize(sdplugins.Plugin):
    sPluginDesc = sdplugins.PluginDesc(
        aLabel = 'Export To TGA - FullSize',
        aTooltip = 'Exports the TGAs of the current Substance Graph to the Data Folder',
        aPluginLocation = sdplugins.PluginLocationMenu(sdplugins.MenuId.Scripts, 'LTools', 0),
        aIconFileAbsPath = '')

    def run(self, aContext) :
#How to get the current file location so exporter knows where to mirror this in Project>Data?
        Exporter.Export(ArtSourceFileLocation, 100)
        pass

# Register module classes
sd.getContext().getSDApplication().registerModule(__name__)

Basically what I'm looking for is something like: pm.sceneName() in Pymel/Maya which returns a value like-
P:/LTP4/Projects/ArtSource/Environments/Props/Crate_Clean.mb

Something like this but, in SBS format.... So
P:/LTP4/Projects/ArtSource/Environments/Materials/Shared/Wood_Clean.sbs

I also apologies for it being SD2018.3, but it is what our studio is running currently and I do not believe we are upgrading to a newer version of SD just yet :(

TIA


Please see this thread :
https://forum.substance3d.com/index.php/topic,33259.0.html

Thank you for responding Cyrille, but in that post I'm unable to use ui_mgr as its something that was added to newer versions of SD and is not present on 2018.3. I'm looking for something like that ...

Nevermind, the studio has agreed to upgrade Painter and Designer to 2020. Dear diary, today was a good day!