name of material

Home Forums General discussions name of material

Tagged: ,

This topic contains 1 reply, has 2 voices, and was last updated by  Péter Baksa 1 month ago.

  • Author
    Posts
  • #3396

    antoine JULLIEN
    Participant

    Hi, i want to find the name of material MaterialAttribute_1, this a variable can be modify by a user object
    i want to write in the objet the name of material that as been choosed

    ! TEXTURE NAME
    _nomcolor = REQUEST (“Name_of_material”,”MaterialAttribute_1″, name)

    DEFINE STYLE text arial, 3, 5, 1
    STYLE text
    text2 A/2,B/1.5, _nomcolor

    Tonio

  • #3397

    Péter Baksa
    Participant

    Hi,

    The result of the REQUEST command is the number of successfully retrieved values (integer). The name of the material will be in the variable name in your example.
    This request expects a material index, unquote ”MaterialAttribute_1″.
    In define style use quotes: DEFINE STYLE “text” “arial”, 3, 5, 1

    _nResult = REQUEST (“Name_of_material”, MaterialAttribute_1, _nomcolor)

    DEFINE STYLE “text” “arial”, 3, 5, 1
    STYLE “text”
    if _nResult then
    text2 A/2,B/1.5, _nomcolor
    else
    text2 A/2,B/1.5, “undefined”
    endif

    Péter Baksa
    Software Engineer, Library Team
    GRAPHISOFT SE

You must be logged in to reply to this topic.