I was studying how py modules work, and it is the enought fast to load entire file simultaneously (all the methods or functions).

The intervals are animations, i like to know how do i must to do to pause the script execution after an interval finish animating, for example, if i have one interval of moving an object, and after that interval i call to another function that will move the camera to left, in that case, i preffer to finish first the object movement interval and one time is finished moving, then execute the next function, but seems to be that no matter if object interval finish the script execute the next function fastly…

Pseudocode could be like this :

def _objectMov(self):
     cubePosInterval1 = interval
     cubePosInterval2 = 2` interval
     cubePosInterval3 = 3` interval
     cubeMotion = Sequence(intervals, name)

     if CubeMotion is finished then execute this code:

but actually, the “self._loadCameraMove()” is executed even if before interval is not finished yet… so, one manner could be a condition like posted above, or submit a line pause(3) that could indicate 3 seconds of pause script…

what is the way to do it…
thanks !

The easiest way is to append one more interval to the end of your Sequence: a Func(self._loadCameraMove). This will call the function when it reaches that point in the interval. Note that you don’t apply the () to _loadCameraMove, since you don’t want to call the function right now; you just want the address of the function.


i see…

understood what you mean… but how can i write that the last mov interval is a func…

i imagine like this :

intPos1=self.x.posInterval(3, Point3(10,0,0), startPos=Point3(0,0,0))
intPos2=self.x.posInterval(2, Point3(0,50,0), startPos=Point3(10,0,0))
intPos3=self.x.posInterval(5, Point3(0,0,60), startPos=Point3(0,50,0))

action=Sequence(intPos1, intPos2, intPos3, moveCamDef, name = "x")

is right like this?
thank you…

No, “Func” is the name for the interval type that calls a function. It’s short for “FunctionInterval” which you can use instead if it helps you remember that it’s an interval.

You would write:




Again, note that you do not write:


The extra () after _loadCameraMove is wrong, because that calls the function immediately.


completely clear…
will try thanks…