Scripted shading network not working in High Quality view

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  01 January 2011
Scripted shading network not working in High Quality view

I apologise if this is in the wrong place. It could be a scripting problem, it could be a maya problem.

I am scripting a simple shading network. It basically multiplies two textures together using a layered texture utility node. When I make this manually I can apply the finished shader to my object and it works fine in High Quality view (which I need it to). However when I use this script it doesn't work in High Quality, I just see black. I can't figure out what is created or happens when I do it manually that I am not creating or connecting or setting in my script.


p.s - sorry for the long dull linear code!

import maya.cmds as cmds  cmds.shadingNode ("file", asTexture=True, name="amb")
   cmds.shadingNode ("place2dTexture", asUtility=True, name="ambPlace2d")
   cmds.connectAttr ("ambPlace2d.coverage", "amb.coverage", force=True)
    cmds.shadingNode ("file", asTexture=True, name="diff")
   cmds.shadingNode ("place2dTexture", asUtility=True, name="diffPlace2d")
   cmds.connectAttr ("diffPlace2d.coverage", "diff.coverage", force=True)
    cmds.shadingNode ("layeredTexture", asTexture=True, name="mult1")
    cmds.shadingNode ("surfaceShader", asShader=True, name="comp")
   cmds.shadingNode ("place2dTexture", asUtility=True, name="compPlace2d")
   cmds.sets (renderable=True, noSurfaceShader=True, empty=True, name="compSG")
   cmds.connectAttr ("comp.outColor", "compSG.surfaceShader", force=True)
    cmds.connectAttr ("amb.outColor", "mult1.inputs[0].color", force=True)
   cmds.connectAttr ("diff.outColor", "mult1.inputs[1].color", force=True)
   cmds.connectAttr ("mult1.outColor", "comp.outColor", force=True)
    cmds.setAttr ("amb.fileTextureName", "C:/Users/Sim/Documents/Uni Year 3/Innovations/Testing/testShaders/test_Amb.jpeg", type="string" );
   cmds.setAttr ("diff.fileTextureName", "C:/Users/Sim/Documents/Uni Year 3/Innovations/Testing/testShaders/test_noAmb.jpeg", type="string" );
    cmds.setAttr ("mult1.inputs[0].blendMode", 6)
    cmds.defaultNavigation (source="comp", destination="pPlaneShape1.instObjGroups[0]", connectToExisting=True);
  01 January 2011
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 11:56 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.