How to selectively cook geos based on TDAbleton locator?

Gurus please help. Apologies for the bother but I am going batty on this one for hours…I am pretty bad at python and DATS and have been trying to figure out how to turn on different geos at every new locator in Live 12 with TD Ableton. I am trying to use abletonSong callbacks and can print the cuepoint to a text TOP with this excerpt from callback, and it is getting the cues ok from Ableton Live 12:

def onCuePointPassed(info):
“”"
A cuePoint (aka locator, aka marker) has been passed. This is
based on the last_cuepoint_passed channel. The “Include Time/Cue-Point
Data” parameter must be on for this to work.
info:
‘cuePointNum’: index into cuePoint output table
‘cuePoint’: cuePoint name
“”"

this section should change text in text2 comp based on cuePointNum

print()
print(‘I passed a cue point!’)
print()
print('Cue Point Number is ’ + str(info[‘cuePointNum’]))
op(‘text2’).par.text = str(info[‘cuePointNum’])

now I need to figure out how to change which geo is rendered based on that…

I know I need something like op(‘geo1’).allowCooking = True

but how can I switch it by getting this cuePoint from TDAbleton?

Or is there a good way with chops or something easier for me?

I would rather use the render parameter on the geos.
First you check wich cuePoint you are in, then you disable all geos, then you enable only the ones you want for that cue.

something like this :

geos = ops('geo*')

if cuePointNum == 1
   for geo in geos:
        geo.par.render = 0
   op('geo1').par.render = 1

Thank you @GauthierDewez . I will give that a try. But since I intend to have some very large geos in there I was thinking turning off cooking might save cycles or does turning off render do that as well?

turning of cooking will free memory, but also will result in stalling when re-enabled as all memory and ressources need to be re-allocated and loaded.

Regarding “saving cycles”: TD is smart enough to only use what is actually required. This means that if there is nothing requesting the geo to be displayed/used in any way, then TD will not do that.
This is called pull based. Instead of elements pushing to an output, the output will check which elements are actually required for the final output.

@plusplusone Thank you Wieland. I can see the wisdom in avoiding stalling. I still can’t get my python code quite right in this callback but I will study more and move to the stop-rendering approach. Much appreciate your advice and your many years of helping this community.