Graphics

 View Only
  • 1.  dropdown menu to select different materials

    Posted 07-13-2017 00:35
    How would I do this?

    So far I have seen this in a project: Select Data Source -> (tickbox) Enable User Input Controls, Type: Combobox, create a list of choices. How do I associate that list with a set of image materials? For example, to choose from a series of weather icons. When you choose one item from the list, the corresponding material is assigned to the quad.

    Thanks!


  • 2.  RE: dropdown menu to select different materials

    Posted 07-13-2017 01:13
    Hey Infineat,

    What I would do is have a hidden text field and then in your list of choices add a new column called "Num" or something similar. Then number each 1, 2, 3 etc and then use "assign coloumn" to tie your selections to the hidden field. Then use visual logic to take that number and feed it to a Input Selector. Attached each material to the input selector and output that to the face of the material.

    If you get stuck I an build you an example.

    Cheers,

    Red
    #XPression


  • 3.  RE: dropdown menu to select different materials

    Posted 07-14-2017 15:22
    Maybe the volatile material script would work for this? You could use the text in your text object to generate a filename, and apply that file as a volatile texture. So if the operator selected "Partly Cloudy", it would apply "partly cloudy.png" as a material.

    You would just have to make sure your icon files are labelled accordingly and placed in the proper folder. Put this script on the text object, on "on set text" and change the items in quotes as needed.

    dim iconQuad as xpbaseobject

    scene.getObjectByName("Weather Icon", iconQuad)

    iconQuad.SetVolatileTextureFile(0, "D:\Your file path here\" & text & ".png")


    Hope that helps!
    #XPression


  • 4.  RE: dropdown menu to select different materials

    Posted 07-15-2017 17:09
    If you are running 6.7-3763 or higher, you don't even need the hidden text object as suggested by Redmile; you can simply publish the material property of a quad object and use the assign columns function to assign a user input control column to the Quad. Simply put the names of materials in the column and they will be assigned to the quad.
    #XPression