Managing scripts and paths in larger projects

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  05 May 2008
Managing scripts and paths in larger projects

Hi all,

I've never really found a good way to manage scripts as they get bigger in 3dsmax.
The most annoying thing is that max keeps changing it's current script directory, so just having a filein "" is dangerous, as the live directory will change the next time another script is accessed.

As well, I'm creating some scripts for clients at the moment that need a file here, and a file there, and it would be nice to be able to package them up and send them as something they can just run.

I've been reading about mzp and mse files, and they seem like they might do (parts of) the job, but if my memory serves me well, last time I played with them, I had very mixed results so I didn't continue.

Does anyone have any good workflows / tips etc to make breaking down bigger scripts, or packaging multiple smaller scripts, easy and most importantly to have them actually work?

Should I be using absolute paths? Should I start using a versioning system like Subversion?

Many thanks,
Portfolio | Keyframes and Code
  05 May 2008
Hi Dave,

We use one big MZP for our stuff and haven't really hit any problems with that. You do have to make use of known paths, but you can use path literals and the getDir() function to always get the folder-du-jour for a given 3ds Max installation.

E.g. if you extract all your files to '$scripts\Dave\' in the MZP run file, then '(getDir #scripts) + "\\Dave"' should yield the same folder - users changing paths around between installation and their running your script aside.

I've run into a lot of problems with using the .run file to actually take care of extracting things where I want them, running scripts, etc. - mostly to do with not having any control over which commands get run in which 3ds Max versions and such, so I've taken to using the file to only...
1. Extract the files (to a fixed location in $scripts)
2. Run a single maxscript file that then takes over the task of actually distributing the files from there (icons to the appropriate location, etc.), and running them according to the max version in use.

The only problem I've run into was an assumption problem on my own end - that nothing would clear the max $temp (either system temp as pre-R9 or max-temp in R9+) while in a max session. Something actually did on one client's machine, so now everything goes in $scripts , and another script takes care of cleaning out temp files from there on shutdown.

P.S. forgot to note... MSE is the same as an MS, except that it's encrypted. I wouldn't rely on it for anything but preventing cursory glances (it's easily hacked from within maxscript itself) and makes any archive (ZIP or MZP - which is just a ZIP anyway) of the file larger as it can't compress it down as nicely.
  05 May 2008
Hey Richard,
Thanks for the info! I'll check out some of the things you recommend.
Anyone else, feel free to chip in too.
Portfolio | Keyframes and Code
  10 October 2008
Script "installation"


maybe too late. But this might just be what you were looking for.
I've written a script to install scripts using an .mzp-file. It gives the user an interface and some information about the script they're installing. It gives the scriptwriter a way to distribute scripts (and supporting files) with more confidence.
The script is copied to a folder in the #userscripts directory. An .ini-file is also created. the user has to customize the ui to incorporate the installed script in the interface. That's about it.

This is what you get after dropping the .mzp on your viewport.

It kind of grew into an installer while i was working on it. I also was looking for a secure way to distribute small scripts across my office.


Example 1
Example 2
Article on website
  10 October 2008
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 12:26 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.