Character encoding in MAXScript

loocas | 3ds Max,maxscript,technical | Thursday, April 14th, 2011

Since Max 2008 (I believe) we have the great SciTE MAXScript editor in Max. It’s an awesome IDE. Very flexible, very lightweight, fast and powerful. Sure, there are much more robust or more beefed up IDEs out there, but for an integrated, dedicated, MAXScript IDE, it’s simply awesome. It’s so good I installed SciTE standalone and use it as an IDE for my Python and other scripting tasks.

So, I’ve been trying to unify my code page across the SciTE editors (the standalone and the integrated Max’s editor) and settled on a standard UTF-8 encoding, which seemed to work just great. However, I just bumped into a very strange bug where Deadline reported a “bad syntax” error on my jobs which were using PostLoad scripts to automatically repath all my assets in my scenes.

The worst part was, the scripts were perfectly fine. They worked just fine in my local Max sessions, but they refused to work when run on the farm. I accidentaly discovered that it was related to the file’s encoding. When I resaved the file in Notepad (on my server) using the ANSI character encoding, the jobs suddenly started to work.

So, if you’re using a UTF-8 encoding in your SciTE editors, including and especially in the integrated Pro Editor in 3ds Max, make sure to save the scripts in a different encoding before executing them on the render farm.

Weird behavior of scripted controllers in 3ds Max 2011

loocas | 3ds Max,maxscript,technical | Wednesday, March 30th, 2011

I just bumped into a very weird thing.

I have a master object that stores a Custom Attribute definition with some reserved value containers and a function that gets called from withing scripted controllers (float_script()) that calculates a wheel’s circumference based off of the input data (wheel radius, distance traveled etc…).

Now, I’ve noticed there is a constant call to this CA function when I have a graph editor open and simply move my mouse cursor on screen across the viewports! This is pretty bad for the setup I have since it forces the wheels to update their rotation values many times more often through a single frame than it should! I have no idea why this is or how to stop it, but it’s something you should consider when tweaking your rigs!

This happened on 3ds Max 2011 x64, not sure about other versions, though.

3ds Max 2012 announced

loocas | 3ds Max,miscellaneous,opinions | Sunday, March 6th, 2011

So, I can finally publicly say that I’ve been a part of the 3ds Max 2012 beta testing team. :)

Now that 3ds Max 2012 has been announced, I’d like to comment on the matter.

First off, there aren’t many new features in 2012, however, the ones that got there, namely Nitrous, are great and show where is Max headed in the future. Unfortunately, due to the very short development cycles, the new features aren’t as polished or finalized as they could be, but, that’s something we have to deal with. Another thing is, 3ds Max 2012 addresses a lot of the performance and stability issues. Mainly performance, which is always great. Though, there is always room for improvement.

Overall, I think 3ds Max 2012 is a great release and with the biggest obstacle out of the way (the old Viewport system), the future development of Max seems pretty good.

One feature I do miss a lot is, of course, Python. But even at this front Autodesk finally seems taking some action. You’ll see in the near future.

In the mean time, also check out the new Maya and Softimage 2012 releases! Some very, very nice features in both that I’d love to see in Max ;) as always…

duber training DVDs – Portrait of a Girl

loocas | 3ds Max,miscellaneous,videotutorials | Sunday, February 6th, 2011

duber DVDs

As you might have noticed, I’ve removed all the training DVDs from my main site, duber.cz.

This is another of those things I need to reorganise in order to focus on my key business, which is postproduction, animation and vfx. I will no longer sell or support those DVDs, however, if you wanted to get those DVDs, I’ll be putting the contents up on Vimeo or YouTube in a short time. Well, say by summer. :D I’m very busy right now and thus supporting sales of those DVDs isn’t my number one priority.

Thanks for understanding.

NukeOps. Tools for 3ds Max to Nuke workflow.

loocas | 3ds Max,maxscript,Nuke,software,technical | Sunday, January 2nd, 2011

Get the Flash Player to see this content.

To celebrate a new, fresh year ahead, I sat down and wrote a script that I’ve wanted to write for some time. A simple to use, yet powerful set of tools that’d help out anyone working in 3ds Max and Nuke to get the 3ds Max Cameras and locators (be it geometry, point helpers or anything between) to Nuke, flawlessly and with as little effort as possible.

So I condensed two essential functions into a single-click button in your toolbar. :) Watch the vieo above for a thorough description with examples.

The functionality could be described as Save To File and Copy To Clipboard methods. The first one will take all the selected objects and will generate a .chan file for each of them which can then be imported back in Nuke’s Axis or Camera nodes. The second one is pretty cool and rather powerful. I wrote a set of functions that take the selected objecs and generate a full Nuke script in the memory, which is then stored in the clipboard. A simple Ctrl+V in Nuke’s node editor will then paste in the generated Nuke script with all the Cameras and Axis nodes as they were in 3ds Max’s scene. Very cool, fast and useful for more complex comping in Nuke.

Anyways, the tools are licensed under the Creative Commons License, so, feel free to enhance and share the scripts as you like, as long as you give me credits for it. ;)

DOWNLOAD, install by drag and dropping onto you 3ds Max scene. Don’t forget to copy the import_chan_file.tcl to your Nuke plugins directory.

Enjoy!

EDIT: If you’re having trouble installing the script using the .mzp installer, just open the NukeOps.mzp file with WinRAR or WinZIP (or directly in TotalCommander for example), extract the files and copy them to the appropriate folders of you 3ds Max installation (in my case it’s the C:\Program Files\Autodesk\3ds Max 2011\ folder):

  • duber_NukeOps.mcr to C:\Program Files\Autodesk\3ds Max 2011\ui\usermacros
  • NukeOps.ms to C:\Program Files\Autodesk\3ds Max 2011\Scripts\Startup
  • all the .BMP files to C:\Program Files\Autodesk\3ds Max 2011\ui\usericons

finalRender Stage-1 R3.5 shipping!

loocas | 3ds Max,finalRender,miscellaneous | Wednesday, December 8th, 2010

finalRender Stage-1 R3.5

Finally, after months of, rather intense, testing, finalRender Stage-1 R3.5 is shipping today! Update as soon as you can, the new features as well as bug fixes and enhancements are amazing! We produce everything with finalRender here at duber and the past few months we’ve been rendering purely in R3.5!

VRay setup for network rendering

loocas | 3ds Max,deadline,technical,videotutorials | Tuesday, December 7th, 2010

Get the Flash Player to see this content.

A short video tutorial for those interested in setting up their VRay, or any other plugin, for flawless network rendering from a centralized repository.

Setting up Environment variables from MAXscript

loocas | 3ds Max,maxscript,technical | Thursday, October 14th, 2010

Just a note on this topic as I just recently needed to set up some Env. variables via MAXScript for certain in-house tools to work correctly and I bumped into a weird behavior of the .NET classes I used. So, for anyone out there with a similar task at hand, read on to save some time figuring it out. :)

Basically, all you need in order to get or set environment variables via .NET are two classes:

  • “System.Environment”
  • “System.EnvironmentVariableTarget”

Then, you simply need to call a method on the “System.Environment” class, called, simply, SetEnvironmentVariable() or GetEnvironmentVariable().

The “System.EnvironmentVariableTarget” class is used to invoke an Enum of:

  • Process – this Enum will get/set the Env. variable for the actual, live, process. The Env. var. will basically die with the process as well.
  • Machine – this one asks for the System Env. variables available to all users and processes
  • User – this one, obviously, only applies to the given user

So, my initial approach was as usual, calling the methods this way:

sysEnv = dotNetClass "System.Environment"
envTarget = dotNetClass "System.EnvironmentVariableTarget"

sysEnv.SetEnvironmentVariable("MyVariable", @"MyValue", envTarget.Machine)



However, this threw an error:

-- Syntax error: at ),, expected 
--  In line: sysEnv.SetEnvironmentVariable("MyVar", @



In such a case, I recommend using the showMethods() method for investigating .NET methods in MAXScript. This partially reveals syntax as well as actual methods available:

showMethods(dotNetClass "System.Environment")
  .[static]<System.Boolean>Equals <System.Object>objA <System.Object>objB
  .[static]Exit <System.Int32>exitCode
  .[static]<System.String>ExpandEnvironmentVariables <System.String>name
  .[static]FailFast <System.String>message
  .[static]<System.String[]>GetCommandLineArgs()
  .[static]<System.String>GetEnvironmentVariable <System.String>variable
  .[static]<System.String>GetEnvironmentVariable
<System.String>variable <System.EnvironmentVariableTarget>target
  .[static]<System.Collections.IDictionary>GetEnvironmentVariables()
  .[static]<System.Collections.IDictionary>GetEnvironmentVariables
<System.EnvironmentVariableTarget>target
  .[static]<System.String>GetFolderPath <System.Environment+SpecialFolder>folder
  .[static]<System.String[]>GetLogicalDrives()
  .[static]<System.Boolean>ReferenceEquals <System.Object>objA <System.Object>objB
  .[static]SetEnvironmentVariable <System.String>variable <System.String>value
  .[static]SetEnvironmentVariable <System.String>variable
<System.String>value <System.EnvironmentVariableTarget>target



So, after doing this, the correct syntax is:

sysEnv = dotNetClass "System.Environment"
envTarget = dotNetClass "System.EnvironmentVariableTarget"

sysEnv.SetEnvironmentVariable "MyVariable" @"MyValue" envTarget.Machine



Hope this helps anyone with similar issues.

Deadline, the render manager of choice.

loocas | 3ds Max,opinions,software | Sunday, March 28th, 2010

Deadline® Render Manager

I’ll elaborate on this topic some more later, but I thought I’d let you know that I’ve successfully deployed, configured and tested Prime Focus’ Deadline®, the render manager of choice for duber studio. ;)

duberPython features demonstration!

loocas | 3ds Max,maxscript,Python,software,technical | Thursday, March 4th, 2010

duberPython banner

I’m trhilled to be able to finally showcase, at least, some of our very own Python implementation into 3ds Max!

First off, our primary reason for writing our own, proprietary, Python connection to 3ds Max is Tactic by Southpaw Technology. An awesome asset management system entirely written in Python that I decided to invest in and integrate our tools and software packages into. Another reason for this connection, later came up, was the need for writing much more complex scripts with complex GUIs, since, as you probably know, a few functional lines of code are hardly enough in a modern, efficient, VFX production of today. ;)

The heart of our Python integration is dotNET from Microsoft. I can’t express myself enough how much I appretiate this framework! The brain of our Python integration is IronPython. Also a product from Microsoft, completely open source and free, which are two very important aspects for any pipeline tool in any production facility of any size. Not the price as much as the availability of the software. And with IronPython and Microsoft, I am certain that this piece of software will be around for years!

(more…)

« Previous Page | Next Page »

Powered by WordPress | Theme by Roy Tanck