Home Technical Talk

Does Maya have a multi/subobj material MatID equivalent workflow?

Ghogiel
greentooth
Offline / Send Message
Ghogiel greentooth
Is the standard here just having a load of loose materials and then doing face selections and applying the mat that way?

And in working with those materials and their faces you have to create selection sets matching the those face selections to act as a pseudo select by ID function?

If that is indeed the case do Maya users have a go to script or something to replicate a multisubobj mats and matIDs?

I skipped trying selection sets as I was still modelling and wasn't sure of the entire array of materials I was going to need for the project, and didn't know if selection sets break if you modify the geometry (do they go ballistic if you cut into the geo?). I didn't want to waste time doing them as I'm a Maya noob, but I probably wasted some time remapping faces to different mats as it took shape about 4 times.

Replies

  • oglu
    Options
    Offline / Send Message
    oglu polycount lvl 666
    In vfx you go straight to hell if you assign materials to faces. If something has a different material its a different object. 

    Everything moving to USD is not making that better. USD is able to store per Face data but i wont recommend that.


  • poopipe
    Options
    Offline / Send Message
    poopipe grand marshal polycounter
    Dealing with this in scripts is a pain in the arse. 

    To select faces on a single object with a specific material assigned you need to go through every material and every face in the scene and then filter out the ones on the object you're interested in.

    This makes it really, really slow so any script you write is a bad one.  I did consider trying it with openMaya but never bothered actually doing it. 

    The short answer is no, avoid getting into this situation

    Selection sets are pretty useless since faces get new IDs if you make mesh edits that affect face/vertex count
  • oglu
    Options
    Offline / Send Message
    oglu polycount lvl 666
    Selecting faces on one object isnt that slow.

    import maya.cmds as mc


    b = mc.ls(sl=1)[0].split("[")[0]

    mc.hyperShade(smn=1)

    s = mc.ls(sl=1)[0]

    sg = mc.listConnections(s+".oc", s=0, d=1)[0]

    l = []

    for o in mc.sets(sg, q=1):

    if b not in o: continue

    l.append(o)

    mc.select(l)

  • Ghogiel
    Options
    Offline / Send Message
    Ghogiel greentooth
    poopipe said:


    Selection sets are pretty useless since faces get new IDs if you make mesh edits that affect face/vertex count
    Thanks, I was anticipating that. :(

    But yeah, the best way seems to be avoiding some material experimentations in these early concept stages as it's more problematic to work on blockouts and concepts if you break them up just to experiment with materials in engine.
Sign In or Register to comment.