Bullet solver not starting when cooking start by a timer

Hi There,

I am working on a project, with multiple bases. The bases start to cook, based on a timer which ends up in a null.
My problem is that one of the base contains a bullet solver, and the simulation is not starting with the cook. Could you please help me? How should i initiate the simulation start together with the cooking.

ATM the timer is based on a null and a chopexecute. I think i should call the start function of the bullet solver but i am not sure how shoud i do it.

PS: currently that is in the chopexecute:

def onOffToOn(channel, sampleIndex, val, prev):
return

def whileOn(channel, sampleIndex, val, prev):
op(‘base2’).allowCooking = True
return

def onOnToOff(channel, sampleIndex, val, prev):
return

def whileOff(channel, sampleIndex, val, prev):
op(‘base2’).allowCooking = False
return

def onValueChange(channel, sampleIndex, val, prev):
return

Thank you in advance.
Rudi

You’re right that you need to start the simulation with the start pulse parameter. The start parameter is a pulse parameter, which can be triggered using its pulse() method: Pulse - Derivative

In the off to on method it might look something like this:

def onOffToOn(channel, sampleIndex, val, prev):
    op('base2/bsolver1').par.start.pulse()
    return

In your on to off method you might also want to consider resetting the simulation by using the init parameter, but that depends on if you intend to resume the simulation where you left off or start anew.

def onOnToOff(channel, sampleIndex, val, prev):
    op('base2/bsolver1').par.init.pulse()
    return
1 Like

Thank you a lot! It is exactly what i need!