how to get all active sources (sources selected on pipeline) in python

hello,

how can i get all the selected sources currently in the pipeline?
i mean if i select box and hold ctr and select sphere, how can i get the two objects on python?
currectly i found GetActiveSource() but this will only return me the last object i clicked, so sphere. is it possible to also get box object? (in the pipeline at least visually it is selected…)

thanks in advance

There is only one active source, the last one that was clicked.

The “selected sources” are not a python concept and cannot be recovered, but you can recover any source by name using GetSources()

and from GetSources() it is not possible to get the ones that are highlighed?no?

I’m afraid not yet, no.

1 Like

okey, for anyone that might come in the future looking for a solution to this. as it is not currently implemented and I want to use this for giving two filters selected to python function without having the python objects,

one can use two times GetActiveSource():

#select filter 0 on pipeline
filter0=GetActiveSource()
#select filter 1 on pipeline
filter1=GetActiveSource()
functionRequiringFilters(filter0,filter1)

another way i found easier is to make the functionRequiringFilters to accept strings for each input object and then use FindSource

def functionRequiringFilters(filter0, filter1):

    if isinstance(filter0,str):

        filter0=FindSource(filter0)

    if isinstance(filter1,str):

        filter1=FindSource(filter1)

this at least helps a littlebit more, one can then call the function using the name of the filters