Graphics

 View Only
  • 1.  Scripting material coordinates?

    Posted 07-21-2012 22:38

    Hello - I'm looking to see if it's possible to adjust the x or y texture coordinate position of a material. And would this script be able to handle every instance of this material within my page? In general terms, using a text object to control the material position...

    If Text = "0" then

    material.posX = 0.0

    end if

    If Text = "1" then

    material.posX = 7.5

    end if



    Can somebody help me fill in the blanks?

    Thanks!

    Brian



  • 2.  RE: Scripting material coordinates?

    Posted 07-23-2012 20:02
    Hi Brian,

    Looking at the API SDK it looks like you can already modify the texture position from the scripting.. Texture coordinates are a property of the object that the material gets applied to (they are not a property of the material itself). Take a look in the helpfile under the xpTexturedObject class and you see .TexturePosX and .TexturePosY.

    I think you would just need to do something like this:



    scene.GetObjectByName("TheQuad1", myQuad)

    myQuad.TexturePosX = 1.3



    #XPression