Back to Blog
Maya ai standard surface5/17/2023 ![]() ![]() ![]() MyShaderSG = ts(renderable=True, noSurfaceShader=True, empty=True, name=myShader + "SG")Ĭmds.connectAttr('%s.outColor' % myShader, '%s.surfaceShader' % myShaderSG) MyShader = cmds.shadingNode('PxrSurface', asShader=True, name=shaderName + "_Mtl") Raise RuntimeError("render engine not supported")ĭef rendermanAssign(shaderName, selection_list, texture_dir): RendermanAssign(shaderName=shader_name, selection_list=selection_list, texture_dir=texture_directory) ![]() Print("User aborted the assign operation")Īrnold_create_network(shaderName=shader_name, selection_list=selection_list, texture_dir=texture_directory) Shader_name = cmds.textFieldGrp(self.tf_shader_newname, q=True, text=True) Self.tf_shader_newname = cmds.textFieldGrp(label="Shader Name:", editable=True, parent=mainLayout)Ĭmds.columnLayout(columnAttach=('both', 5), rowSpacing=10, adjustableColumn=True)Ĭmds.button(label="Arnold", c=partial(self.shader_assign, "arnold"))Ĭmds.button(label="Renderman", c=partial(self.shader_assign, "renderman"))ĭef shader_assign(self, render_engine, texture_dir): Self.main_window = cmds.window(title="UI", widthHeight=(200, 150), sizeable=True)Ĭmds.columnLayout(adjustableColumn=True, rowSpacing=5)Ĭmds.text(label="Shader Template", font="boldLabelFont", height=25)Ĭmds.text(label="Select your mesh or group first,", align="center")Ĭmds.text(label="then click on your desired renderer", align="center") """ Open a file dialog to query a directory pathĭirectory_path = cmds.fileDialog2(fm=2, okc="Set") If you have any ressources it would be amazing! Here is my code first. But I'm struggling on where to begin with and how can I proceed correctly. Now what I want to do is to be able to plug the texture maps from the textures on the sourceimages folder and import them alongside the nodes, it's basically an Auto Shader script. I've created a script for Maya where the user can assign a shader (aiStandardSurface, etc.) to his selected object, once the user clicks the button a shader is created with all the nodes connected that he needs (ex: file nodes connected directly). I'm a bit new to Maya Python but I'll try to explain my question as detailed as possible. ![]()
0 Comments
Read More
Leave a Reply. |