Graphics

 View Only
  • 1.  Setting Swatch Properties to Matials in Scene Layout

    Posted 04-02-2020 19:28

    Hi Community,

    Working on a custom graphic for a sports package.I want to set the material color of the object to match the swatch color value for a given team. So far I have created 3 objects:

    1) A quad with a Generic Logo image (Logo Away LOGO)

    2) A quad with ESPN_INSERT_Image (Logo Away SWATCH) - (a swatch graphic containing the swatch properties of the team)

    3) Quad1 (a quad that I want to take the primary color value of the team from the swatch graphic)

    4) A Text object (where I type in the name of the team)

    I have edited the text object's script to say:

    dim logo, swatch as xpBaseObject
    dim logopath as string

    scene.GetObjectByName ("Logo Away LOGO", logo)
    scene.GetObjectByName ("Logo Away SWATCH", swatch)
    logopath = "D:\IMS Images"

    if scene.iscopy then
    logo.SetVolatileTextureFile(0, logopath & "\Primary\" & ucase(Replace(Replace(text," ","_"), "&", "")) & ".png")
    swatch.SetVolatileTextureFile(0, logopath & "\Swatches\" & ucase(Replace(Replace(text," ","_"), "&", "")) & ".png")
    end if

    When I type the team abbreviation into the text field, the generic logo image is replaced with the team's primary logo - PERFECT!

    However, rather than turn the quad into the primary color of the team, it changes the color values on the swatch file, keeping the entire swatch graphic rather than just pulling values from it.

    How do I get the quad to pull the values from the swatch rather than display the swatch image with all of its values?

    P.S. I have attempted to do this in Visual Logic:

    Logo Away SWATCH (Faces.Face) ---> Quad1 (Faces.Face)

    Didn't work. Any thoughts?



  • 2.  RE: Setting Swatch Properties to Matials in Scene Layout

    Posted 04-07-2020 17:38

    Hi Paul, 

    Many swatches (including ESPN) combine multiple colors onto the same image. You have to adjust the Texture Coordinates of the object itself (scale & position) to show only a portion of the applied texture. 

    Let me know if that gets you on the right track. 


    #XPression


  • 3.  RE: Setting Swatch Properties to Matials in Scene Layout

    Posted 04-07-2020 19:35

    Yes this absolutely gets me on the right track...thank you!

    The question I have left is: how to program/code the text object so that when I enter a given numeric value it changes the texture coordinates?

    ex. 1 (I want it to pull the primary color's coordinates)

    2 (I want it to pull the secondary color's coordinates)

    Any ideas?


    #XPression


  • 4.  RE: Setting Swatch Properties to Matials in Scene Layout

    Posted 04-07-2020 20:00

    You can do something as we have below. Just change the positions and scales to what you want and put this script on the text object you're using to do the color selection. 

     

    dim quad as xpBaseObject

    Scene.GetObjectByName("Color", quad)

    if text = "1"

         quad.textureScaleX = 1
         quad.textureScaleY = 1
         quad.TexturePosX = 0
         quad.TexturePosY = 0

    else if text = "2"
         quad.textureScaleX = .05
         quad.textureScaleY = .05
         quad.TexturePosX = 5
         quad.TexturePosY = 0
    end if


    #XPression


  • 5.  RE: Setting Swatch Properties to Matials in Scene Layout

    Posted 04-07-2020 20:43

    Yes! This works perfectly! THANK YOU!

    Also, is there a way to overlay images or other objects over a color material so the image takes on the color properties of the material?

    For example, if I have a quad and make the material red, can I blend that material with an additional material image so the image takes on the red (or blue, etc. as I change the colors)?

    Hopefully this makes sense and thank you again!


    #XPression


  • 6.  RE: Setting Swatch Properties to Matials in Scene Layout

    Posted 04-09-2020 17:04

    You can try adjusting the blending modes in the material.  You can adjust these at the layer and texture levels of the material.  Also, put your color and logo in a Layer Object before doing this.  

    Let me know if this helps, if not I can take a look at the scene and try to help dial it in. 


    #XPression


  • 7.  RE: Setting Swatch Properties to Matials in Scene Layout

    Posted 04-10-2020 16:29

    Yes this worked!

    1) I created a layer object and placed the material and swatch within it (material on top, swatch below it)

    2) I only needed to make a change to the swatch quad in the layer section: ADD --> DESTCOLOR --> INVDESTALPHA --> ON

    And that did it! My last question relating to this thread is: 

    I have a "Swatch Selector" text object where you can input 0, 1, 2, 3 for different colors. The graphic defaults to empty so we see the swatch graphic (fluorescent green with different sections). Is there a way to script it so that it defaults to one of the numbers?

    I tried inserting: 'if no swatch is selected, use default swatch

    to the top of the script, but I'm assuming it didn't work because it had nothing to point to. 

    Also, I noticed that, when I change the blend mode for this swatch layer, it affects every scene that the swatch is in. Do I have to duplicate the swatch each time I put it into a new scene or this a settings issue?

    Thank you for the relentless help!


    #XPression