Refresh Hypershade?! my shader doesn't appear :[

For workflow-purposes I first wrote a script wich creates a new lambertshader and just opens up a dialogue for browsing for a texture, when the textue is chosen, the script assigns the texturefilename to the new shader. Now I had a new Idea! : I just pick an object, run the script and the object has got the chosen texture on it.

Now my only problem is:
If you got your Hypershade minimized like I always do, this new shader doesn't arise when created with that script. You either have to select "textures" and "materials" again or close and open up the HyperShade again to see the new shader.

I crawled for a simple funktion that just refreshes the panel, but it all doesn't seem to work.

Any Ideas?

You can find the script here:
createNewLambertWithTex.mel

But use it at your own risc! I think thats a bug that prevents me to release it, even if its quite cool so far.

No reply so far?!? Not even Joojaa has got something to say?!?

sorry im working!

Whatdoyou mean it doesent show up in the work area? (well not supprising, as you never said you wanted it there) or it odes not shou up in the materials tab.

Anyway to regraph it to workarea

try

{
string $materialsInQuestion[]={"blinn1","lambert1"};//list your materials
$sel=ls -sl;
select -r $materialsInQuestion;
hyperShadePanelGraphCommand("hyperShadePanel1", "showUpstream");
}

Yea! Thanks a lot so far! That does something!

I mean: If You got the HyperShade minimized and you create a Material (eg a Lambert
"string $newShaderName = shadingNode -asShader lambert;")
via script. You will not see the Material there where the others are in Materials-Tab
(lambert1, shaderGlow1, particleCloud1, .... lambert2!? where is my lambert2!?).

I never said something about work area. :]

Hmmm but that command you said
(hyperShadePanelGraphCommand("hyperShadePanel1", "showUpstream")
changes the HyperShade. Usually I don't got only the Top Tab shown. After the command both Top and Bottom Tabs are visible...
But I mean.. better than to not see the new shader!!

I tryed to find something other useful in "hyperShadePanel.mel"... but nothing better found.

I'll upload the new version of "createNewLambertWithTex.mel"

Thank you again!