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)
cubeMotion.start()
if CubeMotion is finished then execute this code:
self._loadCameraMove()
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…
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.
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:
moveCamDef=Func(self._loadCameraMove)
or:
moveCamDef=FunctionInterval(self._loadCameraMove)
Again, note that you do not write:
moveCamDef=Func(self._loadCameraMove())
The extra () after _loadCameraMove is wrong, because that calls the function immediately.