Why isn’t my material showing in the 2016 Hypershade? (UPDATED)
UPDATE – This issue has been fixed in SP2 that just shipped 8/11/15. For anyone who can’t update to SP2 for whatever reason, read on.
So we’re about to switch to Maya 2016 here at work, and one of the features is the new Hypershade, and while it’s mostly good, it’s a little buggy. Earier today, I found one that had me scratching my head a bit. For some reason, whenever I was opening scenes and opening hypershade, the cool new material viewer wasn’t working, just displaying nothing. It was odd because whenever I had been messing around with it in empty scenes it always worked fine. I even referenced another problematic scene in to my empty scene, and it was working.
So I started to test what was different between the two scenes. I saved the existing asset in 2016 (it was created in 2014) and re-opened, that didn’t work, then tried a few other things. Along the way, I noticed a few things that suggested that maybe the viewer was affected slightly by scene conditions, and thought, “It can’t be as obvious as scene units being different, can it?” Turns out it can be.
We use Meters in our scenes and not the Maya default centimeters, so I switched it back to centimeters, and voila. At first, I was thinking it was that they had hard-coded some camera transformations for some reason, but tested the other units and found they all worked, with the only other exception being yards, the second largest measurement. So I’m thinking it’s some sort of precision error making the render camera shoot off in to the stratosphere, I dunno, that’s their problem (I submitted a bug report to Autodesk) but in the meantime, how do we solve it?
Turns out, if you simply set to centimeters, then set back to meters after opening hypershade, that fixes it. So at some point, I might try poking around the actual hypershade script (last time I did that though, it was kind of a mess, maybe they cleaned it up with this new version) but in the meantime, calling this to open hypershade fixes it:
import pymel.core as pm old = pm.currentUnit(q=True, linear=True) pm.currentUnit(linear='cm') pm.Mel.eval('HypershadeWindow') pm.currentUnit(linear=old)
I’m writing this because I couldn’t even find a mention of this problem when I was googling it, so just in case anyone else runs in to this problem, this is what’s causing it, and here’s a quick solution until Autodesk patches it. I’ll probably try and just find a way to hotswap some commands and shelf buttons to use this command so our artists can use it properly.