Trying to create a project via xisbatch...

Discussions concerning programming of SOFTIMAGE©
Post Reply
El Burritoh
Posts: 151
Joined: 30 Nov 2010, 19:56
Location: Tennessee
Contact:

Trying to create a project via xisbatch...

Post by El Burritoh » 10 Nov 2012, 22:51

I'm working on an automation system for creating our projects. Softimage requires the 'dsprojectinfo' file inside the hidden 'system' directory in order to recognize a directory as a project. The main hurdle is the fact that since there doesn't seem to be away to create this file outside of Softimage, I have to use XSI to make it. But of course, I don't want to have to open XSI to do this. So I'm trying to run some simple Python code to run xsi batch with a command line argument to run my script. Trying to use the subprocess module to do that. But I'm hitting two walls that I'm sure are very silly:

1) If I just run the XSI command prompt and enter the following, I get an error (Syntax Error, it says, and that's literally the whole message). XSI goes through the normal initialization, loading all the plugins, then fails on the script I pass it (the same happens whether I run xsi or xsibatch). The command I'm sending in the command line is this:

Code: Select all

xsi -script F:\path\to\my\script.pys
And the target script contains only one line:

Code: Select all

Application.CreateProject2(r'F:\path\to\my\new\project')
A command that works fine when fired from inside Softimage. So I'm not sure why that's failing.

2) If I try to do all of the above from a script inside Eclipse, I don't even see a console, apart from a brief flash, which probably indicates an error but I can't tell what it is. The code I'm running from inside Eclipse is this:

Code: Select all

import subprocess
script = r'F:\path\to\my\script.pys'
subprocess.Popen(r'C:\Program Files\Autodesk\Softimage 2013\Application\bin\XSIBATCH.exe -script %s' %script )

Anyway, I'm sure it's just my lack of education, so can someone educate me on what I'm doing wrong? Again, the overall goal is to automate the creation of a Softimage project from outside Softimage, without having to directly interact with the command line. I'm working on a PyQt-based project management application for our studio, and the only real hurdle for the project-creation stage is getting a 'dsprojectinfo' file that is unique to that project. Any insight or help is much appreciated!
-Tim Crowson
High Nerd, of the Order of Magnetic Nerds
Personal Website

El Burritoh
Posts: 151
Joined: 30 Nov 2010, 19:56
Location: Tennessee
Contact:

Re: Trying to create a project via xisbatch...

Post by El Burritoh » 10 Nov 2012, 22:56

Well nevermind...

Apparently I can just copy the system folder from one project into an arbitrary directory. For some reason I was under the impression that the 'dsprojectinfo' file had to be truly unique, or else Soft would read the new project as a duplicate of the original. That doesn't seem to be the case.
-Tim Crowson
High Nerd, of the Order of Magnetic Nerds
Personal Website

Post Reply

Who is online

Users browsing this forum: No registered users and 61 guests