[Qgis-developer] How to provide a Processing model in a plugin ?

Victor Olaya volayaf at gmail.com
Mon Jun 8 07:28:50 PDT 2015


You can use the instance of ModelerAlgorithmProvider that is stored in
the Processing object.

Like this:

model = ModelerAlgorithm.fromFile("Path/to/your/model/file")
model.provider = Processing.modeler
Processing.modeler.algs.append(model)

That will add your model to the list of available ones

I guess you are the first one asking for this...and this is the best
solution i can think of so far :-)

Let me know if that works...

I hope it helps



2015-06-08 15:35 GMT+02:00 Etienne Trimaille <etienne.trimaille at gmail.com>:
> Hi,
>
> I'm working on a plugin and I need to use my own model inside.
> I know how to add a new algorithm in processing but I didn't find something
> on how to add a model to processing.
>
> Is there a way to ship my model with the plugin ?
> Or do I need to copy manually my model into the processing models folder
> with Python ?
>
> I saw the ModelerAlgorithmProvider (like the AlgorithmProvider) but I not
> sure if I can do what I want with it.
>
>
> Thanks,
> Etienne
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the Qgis-developer mailing list