MoBu Python Plotting Problem

I’m trying to do a “Plot On Selected” via script, and this is what I’m using.

def plotAnimation(selected):
selected.Selected = True
curTake = lSystem.CurrentTake
plotPeriod = FBTime(0,0,0,1)
curTake.PlotTakeOnSelected(plotPeriod)

I have a function like this, and even when I was testing it without using it in a function, it didn’t seem to work when I called it twice. Does anyone know of this sort of problem? Am I doing it wrong?

It works fine for me. I just removed the first line.

lSystem = FBSystem()
curTake = lSystem.CurrentTake
plotPeriod = FBTime(0,0,0,1)
curTake.PlotTakeOnSelected(plotPeriod)

I think PlotTakeOnSelected takes care of whatever is selected in scene.

I think the first line simply selects the objects passed into the function so I don’t imagine it in itself is what’s causing the issues. However you might want to add a deselect all call first as I’ve had some issues with that.

def clearSelection ():
        ''' Clear selection '''
        # Get selected models
        modelList = FBModelList ()
        FBGetSelectedModels (modelList, None, True)    
        
        # Deselect models
        for model in modelList:
            model.Selected = False
        
        # Return status
        return True

Can you tell me the flow of your entire script?
Because so far all the code you have given works for me without any error. And serves the purpose of plotting on selected objects in scene.

The central government classified the State’s financial budget as a State secret when it introduced the Provisional Regulations on Guarding the State’s Secrets in June wow powerleveling 1951.