Graphics

 View Only
  • 1.  Visual Logic and Material

    Posted 01-29-2015 01:37
    Hi, Using Visual Logic, I want to change the material of a Quad object based on the string value of a Text object.

    The text will be a 3-letter ID (not visible) and the Quad should take on a Material of the same 3-letter.

    Is this possible in Visual Logic? None of my attempts has been fruitful so far.

    Thank you.




  • 2.  RE: Visual Logic and Material

    Posted 01-29-2015 02:29
    How many different possibilities of College ID's could there be? If there is a lot you wouldn't really want to add all the logic to the visual logic..

    It could be done with a script OnSetText on the text object that holds the 3 letter ID. It would look like this:

    `

    dim mat as xpMaterial

    dim quad as xpBaseObject

    if engine.MaterialExistsByName(Text) then

    if engine.GetMaterialByName(Text, mat) then

    if Scene.GetObjectByName("Quad1", quad) then

    quad.SetMaterial(0, mat)

    end if

    end if

    end if

    `

    #XPression


  • 3.  RE: Visual Logic and Material

    Posted 01-29-2015 02:46
    There is a lot. Brian, thank you for the script. I will definitely try this and report back on the result.

    #XPression


  • 4.  RE: Visual Logic and Material

    Posted 01-29-2015 02:53
    This worked like a charm. Thank you so much.

    #XPression