Tuesday, June 16, 2009

Bugs in the node soup

Yet another day wasted (and by day I mean 14 hours) trying to work around yet another fucking Maya bug.

Today, I tried to trace the source of this message:

Warning: line 1: Node 'test_JR02004_layout:shot04_v07_pCubeShape12.instObjGroups[0]': cannot make assignment to 'initialShadingGroup' shader.

This warning is misleading. It's actually hiding a more serious error: shader assignments don't stick. When a Maya scene gets into this state, changes you make to shader assignments are not persistent. Why this isn't an error is beyond me.

So, a lighter creates a bunch of shading nodes, assigns them to holdout objects from animation, saves the scene, and launches a render. But when the scene is opened and RIB is generated, no shaders are attached to the objects -- they render in plasticene grey. The lighter comes back the next morning, re-opens their scene, and BAM! Why aren't the shaders attached? Damn, must have forgot. Re-attach, re-launch. Still bad frames.

How does a Maya scene get into this state? I have no idea. Maya adds crap to a scene every time you export or import, and lighting is where all the crap comes together. If anything is going to break, it's going to break in lighting.

Why is this so hard to track down? I blame Maya's complete lack of encapsulation. Any Maya node can (and will) connect to any other Maya node. There is no abstraction or protection. It's a bit like the old days of DOS and Windows 3.1, where any application could corrupt any other application's memory space. Compare that to Windows XP, where each application is isolated in its own space, preventing a single badly behaved program from taking down the whole system.

Maya is the Windows 3.1 of 3D applications.

And worse than that, the problem is essentially that Maya cannot correctly read files it itself generated! Unacceptable.

And how are we going to solve this problem? By working around it. This is production -- we can't afford to wait 6 months for Autodesk to fix a bug. So, we're doing a complete end-run around shader attachment and exporting compiled shaders. Thank fuck we have that option -- if we were using Mental Ray we'd be truly buggered.

So now I have to write a tool to export and manage individual shaders. Those tools will inevitably have bugs, too, so we're stuck supporting a hack around something that software celebrating its 10th anniversary should have figured out long ago.

1 comment:

  1. It is 2019 and we still have this bug. I found extracting the faces and recombining them fixes the error, but temporarily. It'll eventually come back.

    ReplyDelete