Graphics

 View Only
  • 1.  How to Script Quad material change from text input?

    Posted 05-31-2023 18:49

    Hi All,

    I was asked how to use a text object to select a material in a quad, and that material needs to exist in the material manager already.

    The different syntax for this has stumped me. I can structure a material change with text input for images or videos not already existing in the project but I don't know how to point to a material in the material manager.

    Thanks All



    ------------------------------
    Tai Newman
    Xpression operator/designer
    Melbourne Australia
    ------------------------------


  • 2.  RE: How to Script Quad material change from text input?

    Ross Staff
    Posted 06-01-2023 05:18

    For materials you can just type their name into dynamic material directly

    so you could just use a text macro?



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



  • 3.  RE: How to Script Quad material change from text input?

    Posted 06-01-2023 16:53

    Ah, unfortunately the workstation is a Graphite 8.5 4567 build. Otherwise this option would be ideal



    ------------------------------
    Tai Newman
    Xpression operator/designer
    Melbourne Australia
    ------------------------------



  • 4.  RE: How to Script Quad material change from text input?

    Ross Staff
    Posted 06-01-2023 17:23

    Dang.

    So you want to assign a material from the material manager to an object face? 

    You have to get the material from the engine as it is project base. 

    dim mat as xpMaterial
    dim quad as xpQuadObject
     
    engine.GetMaterialByName("materialname", mat)
     
    self.GetObjectByName("quad1", quad)
     
    quad.SetMaterial(0, mat)



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



  • 5.  RE: How to Script Quad material change from text input?

    Posted 06-05-2023 20:56

    Thanks Simon,

    I ended up using 

    Self.Project.GetMaterialbyName ("name".Text."textname")

    However I could not have gotten to that point without your assistance. 

    Thanks for your time!



    ------------------------------
    Tai Newman
    Xpression operator/designer
    Melbourne Australia
    ------------------------------