Graphics

 View Only
  • 1.  Changing material based on Text layer using visual logic

    Posted 10-15-2017 00:19
    I'm trying to use visual logic to change the material applied to a quad based on a text layer.

    For example, if the text layer says D, I want the material of a quad to change to a blue material.
    If the text layer says R, I want the material of the quad to change to a red material.
    If the text layer says G, I want the material of the quad to change to a green material.

    Is this possible?


  • 2.  RE: Changing material based on Text layer using visual logic

    Posted 10-15-2017 03:01
    I'd recommend using numbers in your text layer as they are a little bit easier to work with (just add into the name of the text object 0=blue, 1=Red, 2=Green). To do this in VL you do the following: From your text layer, use the text block and output it to the base of an input selector. Then, with three separate materials for each color, use each color's material block and output them to 0,1, and 2 respectively. From the input selector, take the output and input it into the face block of the quad object you are manipulating. With this, you make your text object invisible since you don't want anyone seeing it, but still publish it. You'll be able to change the number in the template data and the colors will change accordingly.
    #XPression


  • 3.  RE: Changing material based on Text layer using visual logic

    Posted 10-18-2017 22:13
    I agree with drew, numbers in logic are much easier to work with. However, I have a hidden text field that is attached to a list and each item on that list, when clicked assigns a material to a given quad. Let me know if you want help with this. (our operator changes sponsor logos with a click and the material replaces automatically, the list is alphabetical and growing day by day.)
    #XPression


  • 4.  RE: Changing material based on Text layer using visual logic



  • 5.  RE: Changing material based on Text layer using visual logic

    Posted 10-22-2017 21:52
    Hey, I answered this here;
    https://discussions.rossvideo.com/forum/default-forum-gc1/xpression-cg-and-graphics-system-gc12/13761-default-material-color-with-coding



    "‹Sorry about that @redmile, I forgot to check that thread. Thank you very much. It works great!
    #XPression