Graphics

 View Only
  • 1.  Looping script question

    Posted 07-09-2015 17:19
    Hi,

    I have a scene that includes 60 elements I need to check whether or not they are turned on (ie: Container.visible = "1"). If any one of these elements is visible, I need to turn on an animation track. I have written this script the long way but was hoping to find a more efficient way.

    Thanks!

    Brian


  • 2.  RE: Looping script question

    Posted 07-09-2015 21:31

    Here is an example that checks if any of Text1 through Text4 are enabled and sets the animation track on or off.

    You can adapt as needed for your situation.



    `dim obj as xpBaseObject

    dim i as integer

    dim anything_visible as boolean

    anything_visible = false

    for i = 1 to 4

    if self.GetObjectByName("Text" & i, obj) then

    if obj.Visible then

    anything_visible = true

    exit for

    end if

    end if

    next

    dim track as xpSceneDirectorTrack

    if Self.SceneDirector.GetTrackByName("MyTrack", track) then

    track.Enabled = anything_visible

    end if

    `

    #XPression


  • 3.  RE: Looping script question

    Posted 07-10-2015 13:29
    Thanks Brian!

    #XPression