EarthObservation / RVT_py

Relief Visualization Toolbox in Python
Apache License 2.0
26 stars 6 forks source link

Blender error #18

Closed NejcCoz closed 1 year ago

NejcCoz commented 1 year ago

Blender doesn't work in QGIS plugin after our latest update. I have isolated the problem to this two lines of code, that I have changed in the last pull request:

blend.py

LN 373 rendered_image = None   # used to be rendered_image = []

LN 592 if not rendered_image:  # used to be if rendered_image == []:

The reason I changed the "empty list" to "None" was the following warning I kept getting in QGIS: WARNING warning:C:\Users/ncoz/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\rvt-qgis\rvt\blend.py:592: DeprecationWarning: elementwise comparison failed; this will raise an error in the future. if rendered_image == []:

I am not sure how to solve this, the solution worked fine when I was testing it in pycharm, but then it crashed in QGIS. one option is to revert back and ignore warning (ok for now, will raise errors in future), or hopefully you have an idea how to fix it? Either way we would need to update the qgis plugin asap as well.

NejcCoz commented 1 year ago

I have now solved it using if rendered_image is None: instead of if not rendered_image:.

Tested on QGIS and works fine, sent you a pull request. Please close the issue after you merge. Thanks!

zm8597 commented 1 year ago

Thank you I merged it :)