Executing multiple instances of 3ds Max with dynamic environment variables

loocas | 3ds Max,technical | Saturday, October 5th, 2013

The title sounds a bit complicated, but basically what I needed to achieve was having multiple installations of 3ds Max on my machines and running them as needed.

The problems started when I needed to also include certain .dlls in the Environment for Max to recognize. I store my plugins and plugin libraries outside of Max’s root folder for easier portability, updateability and maintenance.

So, to sum it up, I needed to add to my %PATH% env var “C:\duber\3ds Max 2014\dlls” when running 3ds Max 2014, or “C:\duber\3ds Max 2011\dlls” when running 3ds Max 2011 and so on.

This sounds easier than it actually is, since we cannot assign various Env Vars to shortcuts in Windows (or as far as I know we can’t, please correct me if I’m wrong), which’d solve this issue rather elegantly.

What I had to do instead was to create a .cmd file (a Windows command batch file) with a few simple commands in it and execute that file instead of 3ds Max directly.

Basically put this text into your .cmd file:

@echo off
SET PATH=%path%;C:\duber\3ds Max\2013_x64\dlls
START "" "C:\Program Files\Autodesk\3ds Max 2013\3dsmax.exe"



This will make sure to copy all the global %PATH% variables to the local, current, %PATH% group and include a special directory where all your .dlls are stored so that 3ds Max can see them when starting up.

The last line calls the 3dsmax.exe with no parameters (the first set of quotes).

Link to this start3dsMax2013.cmd file instead to the 3dsmax.exe and you’re all set.

Enjoy. :)

P.S.: Of course you can apply this very same principle to any other program you like, not just 3ds Max.

Shotgun API 3.0.15 and duberPython, all OK!

loocas | 3ds Max,maxscript,Python,technical | Wednesday, July 24th, 2013

duberpython_shotgun_3.0.15.dev_banner

I updated my Shotgun wrapper for duberPython yesterday to support the latest and greatest Shotgun API ver. 3.0.15.dev. All seems to be working pretty well, without any issues.

I added all the methods available by the API to my MAXScript wrapper, so that everything is fully accessible, through duberPython, from inside 3ds Max!

I will be releasing this wrapper to the public real soon, so stay tuned!

duberPython Shotgun 3.0.15.dev

duberPython is available for download!

loocas | 3ds Max,dotNET,maxscript,Python,software,technical | Saturday, July 13th, 2013

duberPython banner

That’s right! duberPython is finally ready for it’s debut public release.

But that doesn’t mean it’s a fresh newb of a plugin. It has been used in high-end productions at studios such as Pixomondo or Orbit, etc. on feature films, commercials, full CG animations, etc.

duberPython came into life after a long search for a solution that’d allow us at duber studio have 3ds Max communicate and play nicely with other pipeline tools and DCC applications. duberPython was designed, mainly, to bridge 3ds Max and Shotgun (JSON API is fully supported!) and Tactic. I even wrote a dedicated Shotgun wrapper, so that you can call Shotgun methods directly from within MAXScript (available upon request), so that writing your studio pipeline tools is really, really easy and fun.

duberPython

The current version runs on the IronPython engine 2.7.3 and is compatible and has been thoroughly tested with CPython 2.7.3 (though, compiled Python modules are not accessible via IronPython).

Currently you can directly call Python code (via string parsing) from within MAXScript, or you can call Python scripts externally and pass it any number of variables for Python processing. The variables will get automatically translated to and from Python, so that strings are strings, booleans are booleans, arrays are arrays, etc. Even dictionary data types are supported in MAXScript (via Hastable dotNET objects)!

duberPython

So, do not hesitate, head over to python.duber.cz and give your full-featured 30day trial a go and if you find it useful, I’d be very happy if you purchase the full version for only $25 bucks, which is a bargain for what you get! (site licenses are available upon request).

By the way, the full documentation can be read here: python.duber.cz/documentation

dotNet iterables in MAXScript, a pain in the ass

loocas | dotNET,maxscript,Python,technical | Sunday, May 5th, 2013

Autodesk facepalm

Yes, that is true. Stuff that should be inherently and implicitly iterable, is not, when accessed from MAXScript.

I had to find out the hard way, so here I am sharing my findings and solutions so that you don’t have to waste time on this nonsense issue.

The problem I bumped into some time ago was when I tried to access Management Object Searchers in my code (for finding various HW IDs and serial numbers). When you call a dotNET iterable (or a collection) in MAXScript, you automatically assume you can iterate over its contents, just like with an array, for example.

WRONG!

Somebody at Autodesk decided that this isn’t the behavior you’d like and instead made you having to jump through hoops and obstacles to get to the object contents.

Anyways, lets look at this problem on a rather simple example of using Hashtables in MAXScript:

(more…)

Repathing 3ds Max assets externally, command line utility

loocas | 3ds Max,software,technical | Sunday, March 3rd, 2013

Repath Max Assets cmd

Do you remember my post about repathing 3ds Max assets in the .max and .mat files without actually running 3ds Max? Well, I cooked up a little utility that can be run from the command line without any IronPython installed. You can use this simple exe file to repath or simply just list all your external asset paths inside your .max and .mat files, should you need to. And since it’s a command line utility you can run it from within your programs and catch the outputs or batch feed it data for processing etc…

Anyways, the syntax is pretty simple:

You need to call the program and then pass it a .max or .mat scene file. If you provide only that, it’ll list the file’s asset paths. But if you provide a -p parameter followed by a new path, it’ll re-path all the file’s external assets to the new location you provided. Unfortunately, there is no way for me (afaik) to distinguish what is an actual render output or RE output and what are texture or cache data inputs, so everything will be linked to the new directory at once.

Should you need any help, just call the program without any parameters, or with the parameter -h for help.

Download the program from here.

Render Max scenes shortcut

loocas | 3ds Max,technical | Wednesday, February 27th, 2013

Render with Max Shortcut

Another one of those little things that can save up a ton of time in day to day productions.

I’ve added a simple “render with 3ds Max” shortcut to my right-click menu, so that I don’t have to open up Max if I need to render a scene. This actually came in handy on the current project where I was modifying a few scenes and re-saving them. Then I went through a few of them manually and needed to render them out quickly for reference. No need to actually run Max, open the scene, hit F9… it was all setup, I just needed to render them out.

If you want to modify your right-click menu this same way, just modify this registry key (3ds Max 2013 in this case):

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\3dsmax\Shell\Render]
@="Render with 3ds Max 2013"

[HKEY_CLASSES_ROOT\3dsmax\Shell\Render\Command]
@="\"C:\\Program Files\\Autodesk\\3ds Max 2013\\3dsmaxcmd.exe\" \"%1\""

Done. :)

Relighting workflow in Nuke 7 for 3ds Max users

loocas | 3ds Max,Nuke,technical | Monday, December 10th, 2012

Nuke 7 Relighting Workflow

As you may know, Nuke 7 is out and one of its very exciting features are the new re-lighting tools.

However, I’ve bumped into a bit of a problem. Since I’m primarily a 3ds Max user, all my world render passes are Z-up oriented. This is a bit of an issue, since Nuke is, more commonly, Y-up oriented.

Fret not! There is a rather simple solution. The ColorMatrix node, nobody seems to care about. :) All you need to know, if you’re not much into math and shit, is that in order to properly convert the RGB values representing the XYZ space coordinates in Max into Nuke’s world space, just type in these values:

  • In the first row, type in: 1,0,0
  • In the second row, type in: 0,0,1
  • In the third row, type in: 0,-1,0

Or just look at the picture above. :)

Done! This is all you need in order to start re-lighting your renders in Nuke using 3ds Max’s World Point passes.

RV Explorer integration script updated

loocas | miscellaneous,Python,RV,software,technical | Tuesday, November 27th, 2012

Get the Flash Player to see this content.

Just a shout out to those who downloaded my RV Explorer integration Python script.

I’ve updated it so that RV now accepts file sequences with various leading zero lengths as I bumped into this issue myself recently.

Hope I haven’t caused you too much trouble. :)

Here’s the updated script: v0.3

Repathing your assets in .max files without 3ds Max

loocas | 3ds Max,dotNET,maxscript,Python,technical | Friday, August 3rd, 2012

Asset Tracking

Ever since I read this blog post on the Area, I was intrigued to get this working in an IronPython environment (that’s pretty much all I know, in the “serious programming” area). Unfortunately for me, the article mentions C++, OLE and COM. Which are my least favourite technical subjects.

So, now when I finally really needed this solution (more on that some time later), I had to ask on the Autodesk forums.

Luckily I got an answer. But first off, huge thank you goes to Larry Minton, an Autodesk Engineer, without whom I wouldn’t have been able to get this thing going.

Now, about the problem. If your facility has a render farm and you happen to work off of your local storage, you have to point your assets to a UNC path where they’re stored so that all the machines on the network can find and load them when rendering. There are many ways of doing this and usually your pipeline TDs had figured this one out prior you even starting any work on the project. :) Unfortunately for me, I’m the only pipeline TD here. :D So I had to figure out a way of re-pathing my assets in 3ds Max scene files prior to rendering.
(more…)

How to extract contents of a .msi file

loocas | miscellaneous,software,technical | Wednesday, July 11th, 2012

This post is basically just a note to myself, because I keep searching for this every now and then and every time I forget the syntax. :) So, here’s what you need to do in order to extract .msi archives to a specific folder of your choice.

To extract files from a .msi file from the command line, type:

msiexec /a PathToMSIFile /qb TARGETDIR=DirectoryToExtractTo


For example, to extract files from X:\installs\someProgram.msi into C:\someProgram you would type:

msiexec /a X:\installs\someProgram.msi /qb TARGETDIR=C:\someProgram
« Previous Page | Next Page »

Powered by WordPress | Theme by Roy Tanck