It is currently 18 May 2013, 16:41

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Open current project folder from within Softimage
PostPosted: 19 Jan 2012, 01:03 
Offline
User avatar

Joined: 09 Jun 2009, 15:45
Posts: 812
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


Top
 Profile  
 
 Post subject: Re: Open current project folder from within Softimage
PostPosted: 19 Jan 2012, 05:11 
Offline
Moderator
User avatar

Joined: 25 Nov 2009, 02:41
Posts: 472
Linux or Windows? also do you want to open an OS explorer or just an file explorer in the XSI interface?

_________________
===================
Eric Thivierge
ethivierge@gmail.com
http://www.ethivierge.com
http://www.exocortex.com/products/species/


Top
 Profile  
 
 Post subject: Re: Open current project folder from within Softimage
PostPosted: 19 Jan 2012, 06:00 
Offline
User avatar

Joined: 09 Jun 2009, 15:45
Posts: 812
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.


Top
 Profile  
 
 Post subject: Re: Open current project folder from within Softimage
PostPosted: 19 Jan 2012, 12:06 
Offline
Moderator
User avatar

Joined: 25 Nov 2009, 02:41
Posts: 472
Quick search online
http://stackoverflow.com/questions/281888/open-explorer-on-a-file
http://support.microsoft.com/kb/314853

Code:
# 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:
# 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
ethivierge@gmail.com
http://www.ethivierge.com
http://www.exocortex.com/products/species/


Top
 Profile  
 
 Post subject: Re: Open current project folder from within Softimage
PostPosted: 19 Jan 2012, 12:24 
Offline
User avatar

Joined: 09 Jun 2009, 15:45
Posts: 812
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!!!!


Top
 Profile  
 
 Post subject: Re: Open current project folder from within Softimage
PostPosted: 19 Jan 2012, 12:27 
Offline
Moderator
User avatar

Joined: 25 Nov 2009, 02:41
Posts: 472
I think because it tries to squeeze them into square preview images.

_________________
===================
Eric Thivierge
ethivierge@gmail.com
http://www.ethivierge.com
http://www.exocortex.com/products/species/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group