Graphics

 View Only
  • 1.  Quad Options, Auto resize and aspect ratio

    Posted 07-18-2024 17:43

    Hi,

    I'm working on a project with many flags with differente sizes, I first wanted to use Dynamic Material : E:\MyProject\FLAGS\@Txt_Member1@_flag.png

    Where Txt_Member1 is the 2 letters of the country ex : JP__flag.png UK_flag.png CH_flag.png and so on Txt_Member1 is Datalinqed to an Excel file.

    But because Dynamic Material is only changing the image it doesn't affect the Quad itself so all the flags have the same size.

    To make it work I need to apply the flags from the Material Manager and not from a Folder.

    Any idea on how to make it Dynamic from the Material Manager, maybe a piece of Sript ?

    Regards.



    ------------------------------
    Karim Lakehal
    VIDELIO - AMP VISUALTV
    Paris France
    ------------------------------


  • 2.  RE: Quad Options, Auto resize and aspect ratio

    Posted 07-19-2024 03:52

    First question have you tried this setting

    Second part, yes you can use this script to apply a material 

    dim box as xpBaseObject

    dim mat as xpMaterial

     

    Scene.GetObjectByName("Quad1", box)

     

    if text = "D" then

    engine.GetMaterialByName("blue", mat)

    box.SetMaterial(0, mat)

    end if

     

    if text = "R" then

    engine.GetMaterialByName("red", mat)

    box.SetMaterial(0, mat)

    end if

     

    if text = "I" then

    engine.GetMaterialByName("white", mat)

    box.SetMaterial(0, mat)

    end if



    ------------------------------
    Simon Redmile
    Senior Graphic Programmer & Designer
    Ross Video
    Bristol United Kingdom
    ------------------------------



  • 3.  RE: Quad Options, Auto resize and aspect ratio

    Posted 07-19-2024 04:42

    Hi Simon,

    I tried your Quad options settings but unfortunately it's not working.

    I'm gona try both options VL and Script.

    Karim,



    ------------------------------
    Karim Lakehal
    VIDELIO - AMP VISUALTV
    Paris France
    ------------------------------



  • 4.  RE: Quad Options, Auto resize and aspect ratio

    Posted 07-19-2024 03:56

    You can also use Visual Logic



    ------------------------------
    Simon Redmile
    Senior Graphic Programmer & Designer
    Ross Video
    Bristol United Kingdom
    ------------------------------



  • 5.  RE: Quad Options, Auto resize and aspect ratio

    Posted 07-19-2024 10:30

    Sometimes coding is not the solution.

    I would set a standard image size and batch it in photoshop so that those that don't fit the ration has a transparency in the dead area.

    Or, batch all images to have a 1 or 2 transparent pixel edge. Have the quad set to "best fit" and "maintain aspect ratio". In texture coords, Misc. - Mode set to border or clamp.

    This way the texturing process does the heavy lifting.



    ------------------------------
    Azathoth
    Son of Cthulhu
    ------------------------------



  • 6.  RE: Quad Options, Auto resize and aspect ratio

    Posted 07-20-2024 10:09

    I must say I agree with Azathoth here. While finding a script or VL solution is nice from a nerdy tech standpoint, operationally, assuming these are flags as you say and there isn't a specific reason why sizing needs to happen in Xpression, sometimes simplicity is the best solution, and resizing these in an editor like photoshop is probably most efficient and reliable solution. I have had to do this for large tournaments regularly, and yes it takes some time to conform all countries' flags, crest etc, but it's a done once solution with 100% predictable output in Xpression. 



    ------------------------------
    Carlito Chippy
    ------------------------------



  • 7.  RE: Quad Options, Auto resize and aspect ratio

    Posted 07-19-2024 10:49

    Are the flag sizes close enough in resolution that you can just select the Auto Size "On Material Assign Only" option in the Quad?

    You can also call on Project Materials in a dynamic material path by referencing a Material by name in the string.



    ------------------------------
    Jeff Mayer
    Ross Video
    ------------------------------