Tag Archives: Pipeline

3ds Max Maxscript Help: Snippets

Here is a list of practical examples for the syntax of scripting in 3ds Max with it’s internal language, maxscript. This isn’t a tutorial and HOWTO script, but more of a reference of how to format commands.

I’ll continue to update this post as I go on as it’s a resource for me as much as anyone else, let me know if there are any useful additions!

Note also that the indenting isn’t necessary but I think it’s a good habit (and I mostly use Python which requires it)

Arrays

Strings

Scene

Objects

Modifiers

Interaction

Macroscript loader

Useful to load at startup, points at an updateable script

Misc

System access

In windows…

LemonRender – Batch Renderer

As a Softimage user, I’m not given any kind of render manager software like the straight forward but useful application that is backburner. I’ve worked at many studios and used many render farms (including backburner) but some of the main ones are Royal Render, Deadline . Anyway these ones are can be quite complex, and if you start beta testing a renderer like VRay in Softimage, you can come up against issues. I’ve now found that while I wait for a new version of Deadline, Softimage 2013 isn’t supported either….. So I’ve gone back to using this wee batch rendering system I made last year.

It involves only a few elements:

  • a plugin/submitter for Softimage
  • a batch file that runs…..
  • the main Lemon Render Python script
  • a simple web interface (run by a simple web server)
From this though, I can print logs of my renders to see how long they have been taking, and queue up jobs. These are all just stored (from the submitter) in simple text files which I can later alter/delete etc.
At the moment there is no priority,  the only thing a user can do is pause jobs in the queue.
I’m sure I could easily write plugins for Maya/Max/Nuke too but have never gotten around to it.
If there is any interest in it then I may do so!

lightbox

3ds Max plugins

Always good to keep your scripts and plugins seperate from the main install IF YOU CAN (max can be a lot of trouble with this, other applications are set up purposely in a much nicer way)

In the plugin.ini file, add a path for your custom scripts, under
[Directories]

The plugin.ini file used to be located in the install directory, I believe it has been moved to the user folder in later releases. ( I use 2010 at work and tend to use Softimage at home so I’m not 100%)
C:\Program Files\Autodesk\3ds Max 2010\plugin.ini

Softimage XSI Custom Menu

The easiest way to access your own, or third party scripts from the UI in Softimage XSI is creating a toolbar. With these you can simple drag & drop text from the script editor onto your own toolbar, then save that in your user or workgroup folders.
That is fine, but they don’t really have place to dock them to the layout.

Instead of that, my much preferred way is to create your own custom menu in the menu bar.

I recall not really finding much information of how to make these custom menus for XSI, the help file has never really provided much information, but the best way to start usually would be to make a custom property from the wizard.
Animate > Create > Parameter > Custom Property Wizard

This isn’t specifically for making a menu, but it creates a plugin script that you can then open and it may help you understand some of the concepts associated with a plugin.

(as it says in the old/not amazingly useful wiki here: http://softimage.wiki.softimage.com/index.php/Custom_Menus).

So to save you all that trouble, here is a basic custom menu template that you can easily use and adopt for your own menus.

The following code should be saved as a Python file (.py) in the Application/Data/Plugins directory.
I would always recommend creating your own workgroup which is software version independent, and others can connect to (potentially very useful for a custom menu where you might be sharing studio tools on a server)

You will see I have saved the version on the script file which aligns with the versioning in the script:

If you use these, XSI will always load the latest version.

I have commented in the example script where you should insert your own code – but if you use as is, it should display the example menu correctly.

I’m sure I had some good help/spying at their menus from Juan Brockhaus (nice website link I found here for him), Andy Nicholas and Peter Agg over the last couple of years in this area to thanks to them!

If you have any comments then ask below!

Nuke Custom Scripts Folder

Keeping custom stuff (scripts/menus/gizmos etc.) outside of an application’s own folder and into a custom folder such as on a server is useful for keeping your things organised, and potentially VERY importaly sharing between more than one user in a work environment.

Also I find it’s useful for backing up, instead of having to go and find lots of different application folders you need to keep, you can keep them all on the server.
I’ll probably use the ‘Workgroup’ quite often as that’s what it’s called in XSI, which is set up really well for this kind of business.

So for Nuke there is a ‘init.py’ file that you can add paths to that nuke will check for scripts.
I’m not going to go into any great detail what it is for, but just what is needed to achieve the point of the post.

In windows, it’s in a folder like this (depending on Nuke version)

Instead of adding to that file, you can create your own blank ‘init.py’ script in your user folder, this is much cleaner and is independent of Nuke versions.
You should create the file in a path similar to this:

Inside the file, all you need to do is add one line, telling Nuke where to pick up the scripts. Be careful to use ‘/’ instead of window’s ‘\’ which causes potential conflicts:

In my Nuke workgroup folder I have a few scripts which I’ll detail in a differnet post.
Namely there is:

  • menu.py – A custom menu in the menu bar.
  • sr_Scripts.py – Contains my custom scripts which the menu references