Home Technical Talk

[Maya] Material List... Now with Menus

1
polycounter lvl 12
Offline / Send Message
Bartalon polycounter lvl 12
Hey guys, I posted a while back on a MEL script interface tool for materials I created. I have completely revamped it and it's a hundred times better now! For those who might have missed my last post, this tool is designed to eliminate the annoying RMB radial menu for assigning/creating new materials and choosing material attributes. Coincidentally it's a spectacular tool when used in conjunction with dDo's materials.

I've incorporated a menu system as well as a multi-select mode. The list also collapses into a small rectangle when not actively in use to save screen space.

dDo.png

You can try it out here:

Version 3.0.0 is out! check it out here

Installation instructions come with your download.

Please let me know any specifics if you find bugs or if a tool is flat out broken.

Replies

  • FlynT
    Offline / Send Message
    FlynT polycounter lvl 8
    Let me be once again the first to say, thank you for this magnificent script! It proved itself already to be a massive timesaver and the changes you made, made it better every time.

    Keep up the good work :)
  • Money
    Offline / Send Message
    Money polycounter lvl 8
    Good job, assigning new mats feels much faster now. :)
    I get an error in 2012 with multi select mode, when I turn it on and check on some checkbox it says // Error: Cannot find procedure "intArrayInsertAtIndex". // . Also one for intArrayRemove for clicking select or delete button.
  • Boonta
    Offline / Send Message
    Boonta polycounter lvl 13
  • Bartalon
    Offline / Send Message
    Bartalon polycounter lvl 12
    Money wrote:
    I get an error in 2012 with multi select mode, when I turn it on and check on some checkbox it says // Error: Cannot find procedure "intArrayInsertAtIndex". // . Also one for intArrayRemove for clicking select or delete button.

    That's strange. I took a look at the 2012 MEL command reference and there doesn't appear to be any "intArray" commands, which explains the error. You may not be able to use Multiple Select mode until you get 2013.
  • Money
    Offline / Send Message
    Money polycounter lvl 8
    OK, not a problem, just gave it a try; i was perfectly fine with standard layout already.
  • haiddasalami
    Offline / Send Message
    haiddasalami polycounter lvl 14
    Awesome. Nice to see this working. I think you can get the refresh working with scriptjobs and listen for selection change as when you create a new material, Maya automatically selects it. Probably just check and see if the selection is the material.
  • Toast
    Offline / Send Message
    Toast polycounter lvl 11
  • sculptn
    Offline / Send Message
    sculptn polycounter lvl 7
    Nice one thanks again :)
  • throttlekitty
  • CheeseOnToast
    Offline / Send Message
    CheeseOnToast greentooth
    Perfect timing. Got a scene with a ton of materials in it just now, and this script is really helping. Great work, thanks for sharing.
  • Bartalon
    Offline / Send Message
    Bartalon polycounter lvl 12
    Thanks for the feedback everyone. Truth be told, this tool is actually part of a larger tool: ultimately a one-stop shop for texturing. The biggest part will be the largely automatic selection, deletion, assigning, and renaming of materials and their respective nodes (such as "place2dtexture1" or shading groups, etc.) so there's never any doubt about which node belongs to which material/file/etc.

    This tool will be tailored to how I work mostly (game art), so there may not be as much support for more complex materials such as cgfx or other mental ray specific materials. Just a screen shot for now, but if you guys think of anything that might be useful (features or tools) just say so and maybe I'll find room for it.

    Again I'll be trying to cram in as much useful stuff as I can without hogging too much screen space. I expect the layout to change a lot as you give feedback.

    <EDIT>

    This tool has been merged with the Material List.
  • Saf
    Offline / Send Message
    Saf polycounter lvl 11
    awesome stuff, thanks!
  • Johnm3D
    This looks really good, I look forward to using the full tool when you are finished !
  • MortalMechanica
    Offline / Send Message
    MortalMechanica polycounter lvl 4
    Are you a wizard?!

    Can't wait to play with this later.
  • battlecow
    Offline / Send Message
    battlecow polycounter lvl 12
    I will never thank you enough for this handy script.
    I've used it for a pretty big arch viz project this week with over a hundred materials and it made the workflow so much better and faster. (and yes I use Maya for archviz and I think it's fantastic :) )

    The script is on my usb flash drive and will never leave me...my precious....

    It only misses one feature i think : the ability to drag and drop the materials into the attributes editor (or maybe it doesn't but I don't seem to be able to)
  • Bartalon
    Offline / Send Message
    Bartalon polycounter lvl 12
    battlecow wrote: »
    It only misses one feature i think : the ability to drag and drop the materials into the attributes editor (or maybe it doesn't but I don't seem to be able to)

    Yeah like I said in my last post these tools are more for enhancing my own work flow, so because I don't work with advanced material connections in the hypershade it doesn't support that. Maybe after I finish the material center I'll rework the window again :)
  • throttlekitty
    2 cents: I typically don't like large panels for common (for me) tasks, like hypergraph, hard/soft edge, etc in lieu of marking menus. (Unless it's relatively painless to pull that stuff out of the script file myself) Still, looking quite useful!
  • Bartalon
    Offline / Send Message
    Bartalon polycounter lvl 12
    This one will clock in at 500w x 250h. Collapsed it will be something like 200x40
  • carlobarley
    Offline / Send Message
    carlobarley polycounter lvl 9
    wow...10 pts for gryfindor many thanks! you are loved.
  • switz
    Offline / Send Message
    switz polycounter lvl 10
  • Fingus
    Offline / Send Message
    Fingus polycounter lvl 11
    Cool! I've wanted something like this for a long time.

    But I'm getting an error when I try to run it I get this error.


    line 238.67: Cannot cast data of type int[] to int.

    It seems to be a problem with this line.

    $smmAdditions = intArrayRemove($smmSubtractions, $smmAdditions);

    It works fine in 2012, so I guess it just doesn't play nice with 2013.
  • Bartalon
    Offline / Send Message
    Bartalon polycounter lvl 12
    Fingus wrote: »
    Cool! I've wanted something like this for a long time.

    But I'm getting an error when I try to run it I get this error.


    line 238.67: Cannot cast data of type int[] to int.

    It seems to be a problem with this line.
    $smmAdditions = intArrayRemove($smmSubtractions, $smmAdditions);

    The intArrayRemove command (and others) I believe was added in Maya 2013 and therefore doesn't work with earlier versions of Maya... That's strange you are having issues in 2013 but not 2012?

    I wrote it in 2013 so it works on my end. If anyone else is having the same issue please let me know what line the error is happening on as well as your version of Maya.
  • Bartalon
    Offline / Send Message
    Bartalon polycounter lvl 12
    Hey everyone,

    Sorry for the double-post but I've made some major updates since yesterday.


    Content removed: outdated information. Original post should be up to date.

  • Mikael P.
    Offline / Send Message
    Mikael P. polycounter lvl 14
    Thank you for sharing! This looks like a very handy tool.
    Your dDo list of preset materials how do I go about accessing that? When I create the predefined materials here I get a bunch of primary colours. It would be fantastic if you gave the option to choose which of the two the user would like. Once again, thanks a lot for sharing!
  • Bartalon
    Offline / Send Message
    Bartalon polycounter lvl 12
    The dDo material presets come with Quixel's dDo software and can be found inside the Swatches directory. The file you are looking for is dDo.fbx. The dDo materials are separate from my tool and are shown here just to illustrate how the tool works.

    Additionally, if you own dDo, the Material List tool (but not the Material Center) should come with it now and be located in the Swatches directory.
  • Mikael P.
    Offline / Send Message
    Mikael P. polycounter lvl 14
    I see. Yes, I just bought it. That's how I found out about your tool. Thanks for pointing me in the right direction!
  • hervus2
    Offline / Send Message
    hervus2 polycounter lvl 5
    Hi.
    I'm working with a 2013 x64 pack 2. Just to tell you that I have an error message for the material center. The other works fine.
    Cheers.

    // Error: source materialCetner.mel; //
    // Error: Line 1.26: Cannot find file "materialCetner.mel" for source statement. //
  • Bartalon
    Offline / Send Message
    Bartalon polycounter lvl 12
    Content removed: out of date information. Refer to the main posting.
  • Cathodeus
    Offline / Send Message
    Cathodeus polycounter lvl 14
    The script worked perfectly for me until today. But now when i try to launch it i got this error message : //Error : Cannot cast data of type int to int

    Any idea ?
  • Bartalon
    Offline / Send Message
    Bartalon polycounter lvl 12
    I assume you are using Maya 2012 or earlier? That seems to be where the majority of issues are stemming from. Unfortunately I do not have that version of Maya on which to test my script. I'll see what I can do to fix it.

    If you can PM me more detailed information it will help me resolve the problem (software version, line number that the error occurred, what you did to cause the error, etc.).
  • Cathodeus
    Offline / Send Message
    Cathodeus polycounter lvl 14
    I use 2013 --> I just put source materialList.mel; into the Mel script editor and hit enter !
  • Cathodeus
    Offline / Send Message
    Cathodeus polycounter lvl 14
    source materialList.mel;
    // Error: $smmAdditions = intArrayRemove($smmSubtractions, $smmAdditions);
    //
    // Error: Cannot cast data of type int[] to int. //
    // Error: $smmAdditions = intArrayRemove($smmSubtractions, $smmAdditions);
    //
    // Error: Cannot cast data of type int[] to int. //
    createModelPanelMenu modelPanel1;
    createModelPanelMenu modelPanel2;
    createModelPanelMenu modelPanel3;
    createModelPanelMenu modelPanel4;
    buildPanelPopupMenu hyperShadePanel1;
    buildPanelPopupMenu scriptEditorPanel1;
    evalDeferred "showWindow scriptEditorPanel1Window;";
    showWindow scriptEditorPanel1Window;
  • Cathodeus
    Offline / Send Message
    Cathodeus polycounter lvl 14
    Today i updated ninja dojo and yesterday i installed maya 2014 but don't use it actually (i have a work to finish before)
  • Bartalon
    Offline / Send Message
    Bartalon polycounter lvl 12
    That's very odd indeed. I wrote the script in 2013 and everything works just fine for me. It's got something to do with that intArrayRemove command for sure, but I'm curious whether anyone else is having a similar issue in 2013?

    Again, I'll work on it soon and get back to you.
  • Cathodeus
    Offline / Send Message
    Cathodeus polycounter lvl 14
    Thanks Bartalon. I was doing an art test for a good company and your script helped me quiet a lot. I'll be using hypershade in the meantime.
  • MeshModeler
    Offline / Send Message
    MeshModeler polycounter lvl 11
    i cant seem to find the materialcenter.mel file?
  • MeshModeler
    Offline / Send Message
    MeshModeler polycounter lvl 11
    also what exactly is the graphing button supposed to do? nothing really happens when i click it..
  • Bartalon
    Offline / Send Message
    Bartalon polycounter lvl 12
    Hey, make sure you have the latest version. There have been significant updates over the last week or two.

    <EDIT>

    I have released another update which you can download from the main posting.
  • MeshModeler
    Offline / Send Message
    MeshModeler polycounter lvl 11
    are you not providing the materialcenter.mel file anymore?

    have those features been integrated into the materiallist.mel?

    the dropbox link you provide redirects you to only the materiallist.mel
  • Bartalon
    Offline / Send Message
    Bartalon polycounter lvl 12
    That is correct. I decided having two windows to work with was too much of a hassle so I merged the materialCenter into materialList. If you still have a version that is asking for the materialCenter.mel, download the latest version above. If you did that and you are still for some reason getting materialCenter errors, try deleting your userPrefs.mel from the Prefs folder.
  • throttlekitty
    I was gonna post a bug, but looks like you've an update that probably nulifies that. :D
    I was also going to say that having a unified window makes more sense too, but looks like you've done that too, yay and thanks again! Loving it so far.
  • Bartalon
    Offline / Send Message
    Bartalon polycounter lvl 12
    I'd like to hear the bug anyhow, there's tons of stuff that I'm working on right now that's making me pull my hair out haha. I want to make sure I fix as much as I can while breaking as little as possible...
  • Bartalon
    Offline / Send Message
    Bartalon polycounter lvl 12
    dDo.png

    Hey everyone! Thanks for all your feedback with helping me develop this tool! I've managed to get a lot of the kinks worked out and should be generally more compatible now.

    Here's a list of changes and known bugs:
    Bartalon wrote:

    Changes
    • Both Versions
    1. To reach as many versions of Maya possible, I have divided the tool into two versions.
    2. Help menu updated and added version information.
    3. Objects should remain selected when generating checker materials.
    4. When applying the checker pattern with the Quick Checker material, the active viewport now automatically enables texture rendering to display the checker pattern.
    5. Added a new option under the Cleanup menu: Clear Unconnected Nodes.
    6. New hotkey option: Focus Material. Automatically takes you to the selected object's material in the Attribute Editor.
    • Maya 2013 and newer
    1. Objects left with no shading groups after deleting materials should be automatically selected and assigned lambert1 to avoid see-through meshes.
    • Maya 2012 and older
    1. This version is confirmed to work with both Maya 2012 and 2011. Earlier versions may or may not be compatible.
    2. This version is limited to the floating window.
    3. The Assign/Delete Material Channels section of the tool (seen at the bottom of the image above) is currently not supported.
    4. Multiple Select Mode should now work.
    Bartalon wrote:

    Known Bugs

    • Both Versions
    1. The Focus Material hotkey sometimes needs to be pressed twice to display the material.
    2. There have been instances of erroneous sourcing even after updating. Ensure the old materialList.mel is not in the Scripts directory. If sourcing errors still occur, you may have to delete your userPrefs.mel file from your Prefs directory. (Sorry for any inconveniences this causes!)
    3. Help menu may not appear on the initial load. Refreshing the window should fix this.
    4. Clear Unused Nodes only removes Utility nodes if they are connected to a Texture node.
    • 2013
    1. The docked window may sometimes stop updating. Switch between floating and docked to fix. In the event this issue is not resolved, the floating window will always work.
    2. Floating window position resets if switched to and from docked mode.
    • 2012
    1. Superfluous error messages when performing certain commands. Tool should still work as advertised.
    2. Deleting materials leaves Texture and Utility nodes behind. Use the new Clear Unused Nodes menu option to keep your scene tidy.

    Get the latest versions here:

    Material List v1.2 for Maya 2013 and NEWER

    Material List v0.9 for Maya 2012 and OLDER


    Installation instructions are with your download. Enjoy!
  • MeshModeler
    Offline / Send Message
    MeshModeler polycounter lvl 11
    graph materials on selected objects still doesn't seem to be working... im on maya 13.5
  • Bartalon
    Offline / Send Message
    Bartalon polycounter lvl 12
    If you are referring to the icon across from lambert1, that button only opens the Hypershade. It might be confusing at first because it shares the same graphic as "graph materials on selected objects" but you'll get used to it.
  • MeshModeler
    Offline / Send Message
    MeshModeler polycounter lvl 11
    ah ok makes sense now. id be cool if you could actually get it to graph the materials... ;)
  • throttlekitty
    Bartalon wrote: »
    I'd like to hear the bug anyhow, there's tons of stuff that I'm working on right now that's making me pull my hair out haha. I want to make sure I fix as much as I can while breaking as little as possible...

    Sure, I still had the post saved, this was from the two-windowed version. (might be handy to name version up in the initial comments)

    In Maya 2012, when clicking Assign File for Diffuse, Normal, etc, I get this error:

    Error: file: /maya/2012-x64/scripts/materialCenter.mel line 64: Number of arguments on call to AEfileTextureBrowser does not match number of parameters in procedure definition.

    Nothing major there, the connections are still created properly. But if you then close the Material Center, and then do Tool>Go to the Material Center from Materials List, it refuses to open and gives this error until Maya is restarted:

    Error: file: /maya/2012-x64/scripts/materialCenter.mel line 194.97: Wrong number of arguments on call to AEfileTextureBrowser.
  • Bartalon
    Offline / Send Message
    Bartalon polycounter lvl 12
    But if you then close the Material Center, and then do Tool>Go to the Material Center from Materials List, it refuses to open and gives this error until Maya is restarted:

    Error: file: /maya/2012-x64/scripts/materialCenter.mel line 194.97: Wrong number of arguments on call to AEfileTextureBrowser.

    Ah, yes. A couple things: The most useful aspects of the Material Center have been merged into the Material List, so materialCenter.mel is obsolete. Additionally, there have been updates! Check out a few posts up for the latest version (or click here http://www.polycount.com/forum/showpost.php?p=1843643&postcount=44)
  • Cathodeus
    Offline / Send Message
    Cathodeus polycounter lvl 14
    Bartalon i was asking myself if you could (i don't know if it's possible but it seems so) make an option : --> generate dDo material list.

    Like this user will not have to import the fbx. All shaders informations should be saved into the code. And those materials will be generated smoothly with a single user click.

    What do you think about that ?
  • Bartalon
    Offline / Send Message
    Bartalon polycounter lvl 12
    Yeah I could do that, but I would first need to make sure it's okay with the people over at Quixel to put their stuff inside my tool. I don't want to rip off their work or anything :)
1
Sign In or Register to comment.