Home Technical Talk

Maya - Assign Materials by Layers (like Rhino)

My first official, to business Polycount post! Woooo!

I'm wondering if there is any way in Maya to assign materials to objects that are on specific layers in the outliner?

If you are familiar with how Rhino layers work, that is the sort of functionality I'm looking for. So if you have a bunch of bolts on one specific layer, they will automatically be assign a "bolt" material unless the objects are moved to a different layer.

Looks like this in Rhino -

2014-11-05_0856.png


Now the outliner may not even be what I'm looking for because as far as I can tell the only way to get objects on the same layer is to group or attach them together. I'm not looking to do that! I know 3ds Max has a nice layering system, but unsure about Maya. Anyone have any ideas? If I'm not being clear let me know and I'll revise my sexy question.

Cheers folks!

Replies

  • GlowingPotato
    Offline / Send Message
    GlowingPotato polycounter lvl 10
    I think i understand the question... but i don't think you can do this in Maya. Like you said, the only way i know to assign a material to many different objects is by grouping them.

    But you can put all objects you want in a layer. And them use select all objects in layer to assign the material to them, without grouping.
  • rube
    Offline / Send Message
    rube polycounter lvl 17
    You could just add them to display layers as Potato says, or create selection set which will show up in the outliner and then use that to select and add materials.. but it still won't be an automatic add to the set and get the material solution. You can get that with render layer overrides but then you'd have each element on a separate render layer and I don't think that's what you're looking for
  • 9krausec
    Alright! Thanks guys! I'll just go with the Potato on this one. Although.. I'm very interested in Maya's render layer ability too! I'll play with both suggested methods. Just wanted to check with you guys.

    Thanks for the quick replies too!
  • passerby
    Offline / Send Message
    passerby polycounter lvl 12
    no defualt way to do so, but could be scripted in.
  • 9krausec
    I'm saving learning Python for next year :D

    So much to do. Layers will work fine though! I didn't realize that Maya had a layer system like 3ds (I only thought it had render layers... Which I keep on reading get broken frequently at render-time which scares me. Need to figure out what that's all about).

    So yeah, Python (and MEL) next year, get a good foundation in Maya this year.

    Cheers though!
  • rube
    Offline / Send Message
    rube polycounter lvl 17
    Render layers work fine but there are some things you have to beware of. Mainly you don't want to override materials from referenced scenes where a single object has multiple materials on it. Maya can get confused when switching between layers and blow up, and then you cry.
  • 9krausec
    So just wanted to give an update.

    I ended up doing some scripting in MEL to automatically create layers (so I have aluminium layer, a chrome layer, a rubber layer... breaking things up by material). These are not render layers, but display layers.

    Then I wrote up some MEL to give me a window with a few sets of buttons on it that automatically pushed any selection to the layer linked to the specific button.

    I'm going to then write up some MEL that applies materials from my material Library to the specific layers (not sure how well MEL is going to be able to pull externally saved vRay materials.. I hope the script dialog displays the script doing this so I can copy and modify).

    So that's what I ended up doing! Streamlined and efficient.

    Next up is to figure out if there are any naming conventions to the CAD I'm importing that dictate material (hopefully there is something for product hardware, or frame parts, etc.. that are consistent). If there are I'll figure out a way to automate the process of sorting the product parts by layer using snippets from the product name upon import too!

    Then script a batch importer. Then work myself out of a job. Haha.

    Cheers.
Sign In or Register to comment.