- Home /
Command line error
I am attempting to run the unity editor in batchmode from a python script in order to import and bundle assets automatically. I am running into a very early problem though. I use the command line to create a temporary project, the arguments are as follows...
['C:\Program Files (x86)\Unity\Editor\Unity.exe', '-quit', '-batchmode', '-nographics', '-createProject c:\build\GAM\Vehicles\Cars\WW\05TennisCLK\SrcAsset\unityBuilder']
It runs for a while and then aborts with the complaint that Multiple Unity Instances can't open the same project. It then identifies an older project with the same name (but different path) as being the root of the issue.
I have verified the following
1) In process explorer throughout the entire scripts execution only 1 unity process is running.
2) The old project has been deleted and no longer exists.
3) I restarted the machine in case unity had a handle to an old file of some sort.
4) I have tried both pre-creating the path for the temporary project, and ensuring that it doesn't exist, I get the same result regardless.
The part of the python script that is running is very simple, it just executes this command line and then exits.
I was wondering had anyone else experienced this message being generated, apparently erroneously and if so how did they resolve it?
Answer by Dave Hawes · Jun 15, 2010 at 08:10 AM
Having spent some time looking at this, I have found the error was to do with how the string for the project location is passed in python to the subprocess module. Essentially you need to make sure it gets passed as a string not a list item, and that it does not have quotes around it. It seems that these specifications vary between operating systems (as this is essentially a path issue that makes sense), so for future reference I am using winXP 64.
Whilst working with this problem I also got an error about changing the working directory to apparently an identical path. This turned out to be because I had a path with mixed slash and double slash i.e. "c:\folder1\folder2\folder3\file.ext" changing the double slash to a single slash resolved this issue.
You should mark this answer so the question is flagged as complete :)
Your answer
Follow this Question
Related Questions
Build Asset Bundle for a different target Platform 1 Answer
Running 5.6.2 via Editor Command Line leaves out VR SDK's 1 Answer
How to Disable Unloading of Assets During Bundling 0 Answers
Multiple game instances Assetbundle cache file cannot be opened due to file lock 0 Answers
Update to 5.3.4f1 executeMethod couldn't be find in Command line arguments 0 Answers