obpax.blogg.se

Maya python ls in group
Maya python ls in group













maya python ls in group

Obviously to build a tool like this, you would likely want to implement additional checks, perhaps some automation in selection of items for adding to your render layers - maybe even create the shaders as well while you're at it. Its fairly straightforward to create renderlayers, and now that you know about the mel command, you've seen its pretty simple to also apply shader overrides as well. Print "Shaders need to be imported first" Print "Nothing selected - nothing created" # Pay attention to all those " characters! # Test that something is selected BEFORE doing this # Do this next step as long as all of the shaders were imported

maya python ls in group

I did of course make sure that I tested the artist had loaded them first by using cmds.objExists I kept the shader names in a list in the script that I could refer to and apply as I needed. While my final script is a lot more complex, the steps I went through to do what I needed are covered in the following code snippets.

maya python ls in group

Once these are loaded, I could then run a script and create the render layers with their own shader overrides as needed. When importing, make sure that you deselect Use namespaces and set the Resolve option to Clashing nodes so that the shaders come in with their names only (and not the scene name as its name space) But there is one important tweak you need to make to the Namespace Options. When a new scene is loaded, bringing these back in before rendering is as simple as a general file > import (as you would with objects, etc). This is relatively simple to do (in Hypershade, select all your shaders and use file > export selected networks) and make sure that they have clear and unique names that match what you are going to use. All the shaders I created, then exported from the hypershade as a file everybody could access. I had a few shaders I wanted to apply to a selection, each as a separate render layer.















Maya python ls in group