ERROR : Permission denied: ‘MakeLocal’ when you create hair from selection


Last week, I had a case where the customer reported a Permission denied: ‘MakeLocal’ when he tried to create hair. I suggested that the material was locked somehow, but he said that he got the same error even if he applied a new material.

// ERROR : 2132 - The object Sources.Materials.DefaultLib.Scene_Material1 is locked by an override.
// ERROR : 2009-PROP-SIMakeLocal - Access denied - [line 3527 in C:\Program Files\Autodesk\Softimage 2011 Subscription Advantage Pack\Application\DSScripts\uixsiscripts.vbs]
// ERROR : Permission denied: 'MakeLocal' - [line 8779 in C:\Program Files\Autodesk\Softimage 2011 Subscription Advantage Pack\Application\DSScripts\uixsiscripts.vbs]

After some back and forth, I got a scene file and found the problem. It was because of overrides on partitions. Even if you applied a different material, you would get the same “locked by an override” error that prevents MakeLocal.

The solution was simply to change to a different pass (one that didn’t have any overrides on the materials) and create the hair there.

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.

Area :: Discussions.

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(): pass

is 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.