Open current project folder from within Softimage

General discussion about 3D DCC and other topics
User avatar
Maximus
Posts: 1121
Joined: 09 Jun 2009, 13:45

Open current project folder from within Softimage

Post by Maximus » 18 Jan 2012, 23:03

Hey guys,
i was wondering if someone could help me with this little thing, i have 0 knowledge of scripting, i want to create a button to put on my custom shelf that let me open the corresponding window folder where all my renders are saved.
Basically when i press the button Softimage read the current project name and path and open up the "Render_Pictures" folder. Is it possible to do? anyone could help me with the code?

thanks a lot :)

p.s. i think i put this in the wrong forum section! sorry

EricTRocks
Moderator
Posts: 754
Joined: 25 Nov 2009, 00:41

Re: Open current project folder from within Softimage

Post by EricTRocks » 19 Jan 2012, 03:11

Linux or Windows? also do you want to open an OS explorer or just an file explorer in the XSI interface?
Eric Thivierge
Lead Kraken Developer, Fabric Engine
http://fabric-engine.github.io/Kraken

User avatar
Maximus
Posts: 1121
Joined: 09 Jun 2009, 13:45

Re: Open current project folder from within Softimage

Post by Maximus » 19 Jan 2012, 04:00

sorry, for windows, and yeah i'd like to open an OS windows :)

thanks Eric!

ps. if its not much of a problem what would change from an os explorer and xsi explorer? just curious, i would use xsi explorer but the preview render for some reason sucks there, its stretched! i always wondered why.

EricTRocks
Moderator
Posts: 754
Joined: 25 Nov 2009, 00:41

Re: Open current project folder from within Softimage

Post by EricTRocks » 19 Jan 2012, 10:06

Quick search online
http://stackoverflow.com/questions/2818 ... -on-a-file
http://support.microsoft.com/kb/314853

Code: Select all

# Windows Explorer in Python

import subprocess

xsi = Application

strProjectPath = xsi.ActiveProject2.Path
strRenderPicPath = XSIUtils.BuildPath(strProjectPath,"Render_Pictures")

subprocess.Popen(r'explorer /root,"' + strRenderPicPath + '"')

Code: Select all

# XSI file browser in Python

xsi = Application

strProjectPath = xsi.ActiveProject2.Path
strRenderPicPath = XSIUtils.BuildPath(strProjectPath,"Render_Pictures")

oView = xsi.OpenView("Browser",False)
oView.SetAttributeValue("targetcontent",strRenderPicPath)

Eric Thivierge
Lead Kraken Developer, Fabric Engine
http://fabric-engine.github.io/Kraken

User avatar
Maximus
Posts: 1121
Joined: 09 Jun 2009, 13:45

Re: Open current project folder from within Softimage

Post by Maximus » 19 Jan 2012, 10:24

Eric thanks so much for this!
Wish i didnt suck at coding, that was exactly what i wanted to do!

a silly question while we are at this, i always wondered why on xsiExplorer the preview images look weird like stretched, they are all jagged for some reason, is there an option somewhere for this? Speaking when you open xsi explorer in render folder and use the "thumbnail preview".


thanks a lot again!!!!

EricTRocks
Moderator
Posts: 754
Joined: 25 Nov 2009, 00:41

Re: Open current project folder from within Softimage

Post by EricTRocks » 19 Jan 2012, 10:27

I think because it tries to squeeze them into square preview images.
Eric Thivierge
Lead Kraken Developer, Fabric Engine
http://fabric-engine.github.io/Kraken