1 hour ago, awit said:I am not entirely sure I understand. Plugins can be executed in the order of them loading, or being executed all at once, when all of them finish loading?
At some point in your code, probably in your __init__ function, you register your postprocessor function like this:
def __init__(self): (....) self._app = Application.getInstance() self._app.getOutputDeviceManager().writeStarted.connect( self._filterGcode )
Instead of making that "connection" in the __init__ function, you can delay it to connect later, after other plugins have connected. The order in which the plugins are executed is the order in which they connected to the writeStarted signal.
def __init__(self): (....) self._app = Application.getInstance() self._app.pluginsLoaded.connect(self._onPluginsLoaded) def _onPluginsLoaded(self): # this will run after all other plugins have connected to the # writeStarted signal, so this plugin will execute last self._app.getOutputDeviceManager().writeStarted.connect( self._filterGcode )
The order scripts in the PostProcessing plugin are executed is directly influenced by the order they are added in the interface. However you cannot change the order of other plugins in that interface.
Edited by ahoeben- 1
- 1
Recommended Posts
Cuq 198
Question seems to be quite similar to this post :
So same answer : The execution of the plugins follow I think the order of loading and the order of loading is according to the alphabetical order.
Try to dhange the names of the plugins to change the order ?
Link to post
Share on other sites
ahoeben 1,951
Have you created plugins, or scripts for the PostProcessing plugin to use?
With plugins you have (slightly) more control over the order of things by delaying when you register your postprocessing callback (eg when the plugin is loaded, or delay until after all loading of plugins has been performed).
Link to post
Share on other sites
awit 0
I have created plugins, I have some post-processing scripts also, but they are not relevant to the current issue.
I am not entirely sure I understand. Plugins can be executed in the order of them loading, or being executed all at once, when all of them finish loading?
I will try the alphabetical workaround, but I would be glad for any information regarding the code modification.
Link to post
Share on other sites