I took a little walk at lunch on Friday. Here’s a few pictures of the old port in Montreal, on a rather dull (but mild -4 C) winter day.
MotionBuilder: Error loading the resource strings at startup
Sometimes I’ll see a case in the queue, and I’ll get curious to see if I can find the answer. In this case, there was the error message “Error loading the resource strings”, so I googled it and then searched through the our old support cases.
I didn’t find a satisfactory answer (suggested resolutions like “creating a new user profile” seem like overkill to me). So I fired up Process Monitor and logged a MotionBuilder startup. When I had the log, I spent a couple of minutes filtering down the results so I could focus on the file activity in user-specific folders like
C:\Users\blairs\AppData\Local\Autodesk\MB2010\
Sure enough, after about a minute of looking for some kind of file that suggested “resource”, I saw this file:
C:\Users\blairs\AppData\Local\Autodesk\MB2010\config\ADLM\res\en-US\AdlmIntRes.xml
So, I opened AdlmIntRes.xml, corrupted it by deleting just enough to make the XML invalid, restarted MotionBuilder, and voila:
How to fix this problem? It the file is missing or corrupted, you can force Setup to recreate the file by removing MotionBuilder, renaming the C:\Users\blairs\AppData\Local\Autodesk\MB2010\ folder (for example, to MB2010.bak), and reinstalling. Otherwise, if the file seems ok, then it could be a permissions problem, or some kind of environment/configuration problem (Process Monitor would help figure it out).
In general, Process Monitor is a great way to learn about an application. In this case, I spent some time learning what files MoBu reads at startup, and what’s in those files (I spent some additional time browsing through the various text files that MoBu opens).
Softimage stops working everytime computer is restarted
Each time the computer was restarted, Softimage couldn’t open scene files. Running runonce.bat after a restart fixed the problem, which suggested that something was happening to the registry.
And sure enough, it turned out that Advanced SystemCare Free was installed on the system. It’s a registry cleaner that runs automatically at startup.
Registry cleaners are XSI killers.
Friday Flashback #3
Instructional Standards for Maya, 3dsMax and Softimage
Instructional Standards for Maya, 3dsMax and Softimage
via Instructional Standards for Maya, 3dsMax and Softimage | AWN | Animation World Network.
Python decorators
Patrick Boucher recently posted a SetValue decorator for Softimage that can temporarily change any value for the duration of a method call and restore it afterward.
So, what’s a decorator?
After glancing at the SetValue decorator code and taking a quick look at the docs at python.org, I needed a simple example to help me wrap my head around the syntax (which turned it to be simpler than what I was expecting).
So, here’s a simple example of a decorator.
func_timer is the decorator function, and all it does is time how long a function takes.
import time
# Define the decorator function
def func_timer(func):
def wrapper(*arg):
t = time.clock()
res = func(*arg)
print func.func_name, time.clock()-t
return res
return wrapper
# Wrap myFunction with the decorator
@func_timer
def myFunction(n):
for i in range(n):
Application.CreatePrim("Cube", "MeshSurface", "", "")
# Call myFunction
myFunction(3)
# Do the equivalent, but without using a decorator:
def myFunction1(n):
for i in range(n):
Application.CreatePrim("Cube", "MeshSurface", "", "")
myFunction1 = func_timer( myFunction1 )(40)
I found this Python Decorators Don’t Have to be (that) Scary article helpful.
And from the python.org glossary, I learned that:
a decorator is “merely synatic sugar” that is a “function returning another function, usually applied as a function transformation using the @wrapper syntax.”
From the Python language reference, I learned that:
A function definition may be wrapped by one or more decorator expressions. Decorator expressions are evaluated when the function is defined, in the scope that contains the function definition. The result must be a callable, which is invoked with the function object as the only argument. The returned value is bound to the function name instead of the function object. Multiple decorators are applied in nested fashion. For example, the following code:
@f1(arg) @f2 def func(): passis equivalent to:
def func(): pass func = f1(arg)(f2(func))
By the next day, it all made sense 😉
Compiling legacy preset-based operators
Preset-based operators are a deprecated feature, but there are still some of them around (Taut for example).
To compile a 64-bit version of one of these preset-based operators, here’s what I had to do:
- Use the SDK Wizard to generate a Visual C++ project for a 64-bit plugin.
- Add the module definition file to the Linker > Input properties (otherwise you get “Unable to locate the initialization entry point named” errors in Softimage).
- Deal with string conversion errors like “error C2664: ‘OutputDebugStringA’ : cannot convert parameter 1 from ‘wchar_t [255]’ to ‘LPCSTR'”.
64-bit version of Taut operator
I compiled a 64-bit version of Taut for the FxNut Andy Nicholas. Download here.
Taut is a C++ modelling operator for straightening edges. It features an intelligent algorithm that searches your current selection for distinct lines, which allows multiple edges to be straightened at once. It also features three modes of operation that provide different ways of distributing the vertices along the lines.
Softimage UI Basics – SoftimageHowTos YouTube Channel
Quick start to command-line rendering with xsibatch
I like to use a batch file to build my xsibatch command lines.
For example:
set SCN=\\EXAMPLE\Support\Project\Scenes\Scene.scn set PASSES=Default_Pass,Depth set XSI_BINDIR=C:\Program Files\Autodesk\Softimage 2011 Subscription Advantage Pack\Application\bin "%XSI_BINDIR%\xsibatch.bat" -render "%SCN%"
Note that I call xsibatch.bat, not xsibatch.exe. That is because xsibatch.bat calls setenv.bat, which sets all the environment variables used by xsi.exe and xsibatch.exe. For example, setenv.bat sets the environment variable that specifies the location of the license server.
This xsibatch command line renders all frames and all passes of the specified scene:
"%XSI_BINDIR%\xsibatch.bat" -render "%SCN%"
Note that I need to provide the full path to the scene file, and I enclose it in quotation marks (just in case the path name includes spaces).
-frames allows me to render specific frames. For example, this renders a frameset (frames 1 throught 10):
"%XSI_BINDIR%\xsibatch.bat" -render "%SCN%" -frames 1-10
This renders frames 1,3,5,7,…,99 using the syntax -frames start,end,step:
"%XSI_BINDIR%\xsibatch.bat" -render "%SCN%" -frames 1,100,2
-pass specifies a comma-separated list of passes to render:
"%XSI_BINDIR%\xsibatch.bat" -render "%SCN%" -frames 1-100 -pass "%PASSES%"
-skip tells xsibatch not to re-render frames that have already been rendered (for example, by another render node):
"%XSI_BINDIR%\xsibatch.bat" -render "%SCN%" -frames 1-100 -pass "%PASSES%" -skip on
-verbose turns on verbose logging during the render. xsibatch will log the renderer diagnostics (Render Manager > mental ray > Diagnostics)
"%XSI_BINDIR%\xsibatch.bat" -render "%SCN%" -frames 1-100 -pass "%PASSES%" -skip on -verbose on
-output_dir allows you to override the output folder specified in the scene file:
"%XSI_BINDIR%\xsibatch.bat" -render "%SCN%" -frames 1-10,22 -output_dir %TEMP%
-mb allows you to enable motion blur from the command line:
"%XSI_BINDIR%\xsibatch.bat" -render "%SCN%" -frames 1-10,22 -mb on
If you need to set other mental ray options for a render job, you can use -script with -render. -script allows you to run a script on the scene before it sent to the renderer.
If you run xsibatch -h in a command prompt, you’ll get the usage:
Continue reading





