Hi there,
Hey I'm having a bit of trouble with this script that should be pretty straight forward but I'm not very good at navigating order structures outside of xsi through scripting.
I want to save a file in a directory that is outside of the project and I don't really want to use specific directly names (so I can reuse it on other projects).
I'm starting off from within Project_XSI and I want to save into Project_Unity
I can get the project folder with with var ScenePath = Application.ActiveProject2.Path+"" but does anyone have any suggestions on where I could go from there?
Sorry it's a little hard to explain, but if anyone has any suggestions it would be great!
Thanks,
Pete
Need help navigating a folder structure
- csaez
- Posts: 253
- Joined: 09 Jul 2012, 15:31
- Skype: csaezmargotta
- Location: Sydney, Australia
- Contact:
Re: Need help navigating a folder structure
Hi Pete,
I don't have Softimage in front of me, but looks like an easy task for python.
The snippet below should print the path to the parent directory of the current project.
Hope this helps,
Cheers!
I don't have Softimage in front of me, but looks like an easy task for python.
The snippet below should print the path to the parent directory of the current project.
Code: Select all
import os
from sipyutils import si
project_path = si().ActiveProject2.Path
parent_path = os.path.join(project_path, "..")
print os.path.normpath(parent_path) # prints normalized path
Cheers!
Re: Need help navigating a folder structure
yes, ".." for parent directory can be a part of the path, it should work the same in any scripting language if you have a path like
var ScenePath = Application.ActiveProject2.Path+""
do..
var path_pic_in_other_folder = ScenePath +"\\..\\Project_Unity\\hihih.jpg"
var ScenePath = Application.ActiveProject2.Path+""
do..
var path_pic_in_other_folder = ScenePath +"\\..\\Project_Unity\\hihih.jpg"
softimage resources section updated Jan 5th 2024
Re: Need help navigating a folder structure
Ahhh cool! Thanks guys, that's perfect!
Who is online
Users browsing this forum: No registered users and 20 guests