Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load automatically 3d:tessellate #41310

Closed
Dan-Eli opened this issue Feb 2, 2021 · 2 comments · Fixed by #41435
Closed

Load automatically 3d:tessellate #41310

Dan-Eli opened this issue Feb 2, 2021 · 2 comments · Fixed by #41435
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms

Comments

@Dan-Eli
Copy link

Dan-Eli commented Feb 2, 2021

Describe the bug

Last spring I submitted QGIS issue 3661 concerning the tool 3d:tessellate that cannot be accessed in standalone QGIS script. The bug was corrected but to make it work we still need to manually load the algorithm with the following command:

from qgis._3d import Qgs3DAlgorithms
QgsApplication.processingRegistry().addProvider(Qgs3DAlgorithms(QgsApplication.processingRegistry()))

To my knowledge, all the other algorithms of QGIS are loaded by default and we do not need to load them manually. In order to harmonize the behavior between the different QGIS algorithms, I suggest to modify the code so that 3d:tesselate is automatically loaded.

QGIS and OS versions

The test was performed using QGIS 3.16 with Ubuntu

@Dan-Eli Dan-Eli added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Feb 2, 2021
@gioman gioman added the Processing Relating to QGIS Processing framework or individual Processing algorithms label Feb 2, 2021
@roya0045
Copy link
Contributor

roya0045 commented Feb 5, 2021

Supposed to occur there

QgsApplication::processingRegistry()->addProvider( new Qgs3DAlgorithms( QgsApplication::processingRegistry() ) );
maybe the flag is wonky

@nyalldawson
Copy link
Collaborator

@Dan-Eli is referring to custom standalone scripts, not the qgis_process tool

nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Feb 9, 2021
when a script calls Processing.initialize() if they are not
already loaded

This means the following ugly code can be avoided:

    Processing.initialize()
    QgsApplication.processingRegistry().addProvider(QgsNativeAlgorithms(QgsApplication.processingRegistry()))
    QgsApplication.processingRegistry().addProvider(Qgs3DAlgorithms(QgsApplication.processingRegistry()))

and instead the call to Processing.initialize() is sufficient to load
ALL providers

Fixes qgis#41310
nyalldawson added a commit that referenced this issue Feb 9, 2021
when a script calls Processing.initialize() if they are not
already loaded

This means the following ugly code can be avoided:

    Processing.initialize()
    QgsApplication.processingRegistry().addProvider(QgsNativeAlgorithms(QgsApplication.processingRegistry()))
    QgsApplication.processingRegistry().addProvider(Qgs3DAlgorithms(QgsApplication.processingRegistry()))

and instead the call to Processing.initialize() is sufficient to load
ALL providers

Fixes #41310
github-actions bot pushed a commit that referenced this issue Feb 9, 2021
when a script calls Processing.initialize() if they are not
already loaded

This means the following ugly code can be avoided:

    Processing.initialize()
    QgsApplication.processingRegistry().addProvider(QgsNativeAlgorithms(QgsApplication.processingRegistry()))
    QgsApplication.processingRegistry().addProvider(Qgs3DAlgorithms(QgsApplication.processingRegistry()))

and instead the call to Processing.initialize() is sufficient to load
ALL providers

Fixes #41310
nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Feb 19, 2021
when a script calls Processing.initialize() if they are not
already loaded

This means the following ugly code can be avoided:

    Processing.initialize()
    QgsApplication.processingRegistry().addProvider(QgsNativeAlgorithms(QgsApplication.processingRegistry()))
    QgsApplication.processingRegistry().addProvider(Qgs3DAlgorithms(QgsApplication.processingRegistry()))

and instead the call to Processing.initialize() is sufficient to load
ALL providers

Fixes qgis#41310

(cherry picked from commit b402544)
nyalldawson added a commit that referenced this issue Feb 19, 2021
when a script calls Processing.initialize() if they are not
already loaded

This means the following ugly code can be avoided:

    Processing.initialize()
    QgsApplication.processingRegistry().addProvider(QgsNativeAlgorithms(QgsApplication.processingRegistry()))
    QgsApplication.processingRegistry().addProvider(Qgs3DAlgorithms(QgsApplication.processingRegistry()))

and instead the call to Processing.initialize() is sufficient to load
ALL providers

Fixes #41310

(cherry picked from commit b402544)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants