Return multiple paths with setReturnContent


Is there a way to return multiple path on an incoming-source-path binding with setReturnContent in python? Currently we gather all the sources in the binding, return a single source and set an after-progressive-loading binding which does addSources with the rest of the input sources. While it works, it is a little messy. Is there a better approach ?



Hi Sreenivas,

Thanks for posting in the forum!

Why do you need the incoming-source-path? Have you considered only binding on the after-progressive-loading event and grabbing all the sources then? Technically by the time that after-progressive-loading event runs, you should have all the sources in the session. You can do that via API:

All RVSource nodes (both RVFileSource and RVImageSource):
sources = commands.nodesOfType("RVSource")

RVFileSource nodes:
file_sources = commands.nodesOfType("RVFileSource")

RVImageSource nodes:
img_sources = commands.nodesOfType("RVImageSource")

Also, why are you adding sources after the loading is already complete?



Hi @alexaz, Sorry, I should have given more details upfront.
Hi @Kessler, yes, you are exactly right.
We get a json on incoming-source-path, does some custom voodoo magic and finally end up with a bunch of paths. We return the first path using setReturnContent, and on after-progressive-loading adding the rest of the sources using addSources. It works, there is no complain about that. Just wondering, if we are doing something round or if there is a way to straight away return multiple paths using setReturnContent.

Let me know if I you need more info.


1 Like