How to loop the scenechanger comp?

Hello everyone, let me introduce myself: Andrea!

I have been enjoying TD for a couple of years with relatively simple systems. I have no training on python so excuse me if I might be off-topic or if a similar topic has been covered in some other post.

Currently I would like to be able to include within the COMP “SceneChanger” the ability to loop the videos that I am going to upload as scenes.

Current vain attempts involved these steps:

  1. add um button (toogle) named Loop in the Scene Changer container.

  2. inside the Scene Changer container modify the code of “parexec1” by enabling Enable Change and defining inside it the code "def onEnableChange(par, val, prev): if par.name == ‘Loop’: parent.SceneChanger.Loop() "

  3. inside the Scene Changer container modify the code of “SceneChangerExt”, where in the “def init(self, ownerComp)” I (A) added “self.sceneLoop = self.ownerComp.par.Loop” (B) defined, at the end of the whole code, "def Loop(self):

     current_scene = self.ownerComp.par.Currentscene.eval()
     num_scenes = len(self.ownerComp.op('sceneGate'))
     for i in range(current_scene, num_scenes):
     	self.SwitchToScene(i)
     for i in range(0, current_scene):
     	self.SwitchToScene(i)"
    

However, even with other attempts, the code does not work. Do you kindly have any suggestions on this?

Honestly I would like to occasionally know how to get my hands into these “Parameter Execute” dat to expand some of their functions, but I just don’t know where to start.

Scenes will run until they are switched to another scene, and the internals of each scene follow their own logic so I am not sure why you need to modify the sceneChanger extension to add a ‘loop’ function.

Currently I would like to be able to include within the COMP “SceneChanger” the ability to loop the videos that I am going to upload as scenes.

If you want the videos to loop inside scenes, then setup the movie file in TOPs to be looping. This should be the default for the movie file in TOP, in fact you would need to change things to make them stop playing after 1 playthrough. Which brings up the question what would you want the movie and scene to do if they did not loop? There is no built-in logic to change scenes when a movie finishes.

Maybe you could further explain what is happening now and what you want it to do differently.

Hi Ben!
Now the scenes will run until they are switched to another scene.
I need the possibility to switch to another scene with the integrated UI from SceneChanger AND I want an automatic switch to another scene (from scene x to the last scene) if no button in the UI is pressed. Like MoviePlaylist operator

You didn;'t specify what is triggering the ‘automatic switch’? If you want it to happen at the end of one of your scenes, you will have to start using the length parameter and/or a Timer CHOP (or some similar other logic) to switch the scenes after the time or event you want occurs. The Timer CHOP has callbacks that make this easy to setup.