I wrote this onto a text object that's connected to the vis of all three added together so any time 1 of the turns invisible it will trigger the others to animate.
Here is the script however I have also attached the project for you to look at.
dim q1, q2, q3 as xpQuadObject
dim sd as xpSceneDirector
dim track as xpSceneDirectorTrack
dim cp as xpSceneDirectorClip
dim anim as xpAnimController
scene.GetSceneDirectorByName("Mover", sd)
sd.Position = 0
scene.GetAnimControllerByName("MOVE", anim)
scene.DeleteAnimController(anim)
scene.CreateAnimController(anim)
sd.GetTrackByName("Track1", track)
track.CreateAnimClip(0,anim,cp)
anim.Name = "MOVE"
scene.GetObjectByName("Quad1", q1)
scene.GetObjectByName("Quad2", q2)
scene.GetObjectByName("Quad3", q3)
if q1.Visible = true
else
dim q2Pos as integer
q2Pos = q2.PosX
dim q3Pos as integer
q3Pos = q3.PosX
anim.Duration = 50
anim.SetKeyFrameValueTCB(q2, 0, "Position.X", q2Pos, 0, 0, 0)
anim.SetKeyFrameValueTCB(q2, 50, "Position.X", 580, 1, 0, 0)
anim.SetKeyFrameValueTCB(q3, 0, "Position.X", q3Pos, 0, 0, 0)
anim.SetKeyFrameValueTCB(q3, 50, "Position.X", 1340.000, 1, 0, 0)
sd.Play()
sd.AutoStop = true
end if
if q2.Visible = true
else
dim q1Pos as integer
q1Pos = q1.PosX
dim q3Pos as integer
q3Pos = q3.PosX
anim.Duration = 50
anim.SetKeyFrameValueTCB(q1, 0, "Position.X", q1Pos, 0, 0, 0)
anim.SetKeyFrameValueTCB(q1, 50, "Position.X", 580, 1, 0, 0)
anim.SetKeyFrameValueTCB(q3, 0, "Position.X", q3Pos, 0, 0, 0)
anim.SetKeyFrameValueTCB(q3, 50, "Position.X", 1340.000, 1, 0, 0)
sd.Play()
sd.AutoStop = true
end if
if q3.Visible = true
else
dim q1Pos as integer
q1Pos = q1.PosX
dim q2Pos as integer
q2Pos = q2.PosX
anim.Duration = 50
anim.SetKeyFrameValueTCB(q1, 0, "Position.X", q1Pos, 0, 0, 0)
anim.SetKeyFrameValueTCB(q1, 50, "Position.X", 580, 1, 0, 0)
anim.SetKeyFrameValueTCB(q2, 0, "Position.X", q2Pos, 0, 0, 0)
anim.SetKeyFrameValueTCB(q2, 50, "Position.X", 1340.000, 1, 0, 0)
sd.Play()
sd.AutoStop = true
end if
------------------------------
Simon Redmile
Senior Graphic Programmer & Designer
Ross Video
Bristol United Kingdom
------------------------------
Original Message:
Sent: 10-09-2022 22:42
From: alan
Subject: Equal distribution of quad
Hide any quad,Not just quad3.
When one of the quads is hidden, the remaining two quads will have a moving animation
that is evenly distributed on the canvas
------------------------------
alan
------------------------------
Original Message:
Sent: 10-09-2022 12:20
From: Simon Redmile
Subject: Equal distribution of quad
Do you mean that when you hide quad 3 it animations to the new position or is a jump ok?
------------------------------
Simon Redmile
Senior Graphic Programmer & Designer
Ross Video
Bristol United Kingdom