Announcement

Collapse
No announcement yet.

MAxscript -> how to add item in a list from a .mat ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MAxscript -> how to add item in a list from a .mat ?

    Hello,
    I want to create a list of all the materials include in a library.mat.
    I've to apply a specific material on a lot of objects quickly and I want a small dialog Box with a list of materials (only the name). When I choose a name of material (from a .mat) in this listbox, this material is apply to my selection.

    In fact, I want to download the names of the materials included in a .mat instead to write the names in the code like that :​

    ------------------------------------------------------------------------------------------------------------------------------------------------------
    rollout Appli_Material "Appli Materials"
    (
    dropdownList List_Materials items:#("BLANC 001", "NATUREL 016", "BLANC N01", "JAUNE N14", "ORANGE N07", "ROUGE N11", "BLEU N02", "VERT CLAIR N37") pos:[10,20]

    on List_Materials selected i do
    (
    classOf selection
    nbre_object = selection.count
    if nbre_object <= 0 then
    (
    messageBox "Sélectionner au moins un objet."
    )
    else
    (
    nom_material = List_Materials.items[i] as string
    $.material = sceneMaterials[nom_material]
    )
    )

    )
    createDialog Appli_Material
    ------------------------------------------------------------------------------------------------------------------------------------------------------

    I'm a newbie with maxscript, like you can see.

    An idea ?

    Thank you,


  • #2
    I've found a simple solution

    Comment

    Working...
    X