diff --git a/core/styling.py b/core/styling.py index 288c9d2..04ee08a 100644 --- a/core/styling.py +++ b/core/styling.py @@ -36,7 +36,11 @@ def apply(self, vectorlayer): material = create_material(vectorlayer.renderer().symbol().color()) symbol = QgsPolygon3DSymbol() - symbol.setMaterial(material) + # setMaterial method renamed to setMaterialSettings in QGIS 3.30 and is API breaking + try: + symbol.setMaterial(material) + except AttributeError: + symbol.setMaterialSettings(material) symbol.setEdgesEnabled(True) renderer = QgsVectorLayer3DRenderer() @@ -64,7 +68,11 @@ def apply(self, vectorlayer): material = create_material(colors["diffuse"], colors["ambient"], colors["specular"]) symbol = QgsPolygon3DSymbol() - symbol.setMaterial(material) + # setMaterial method renamed to setMaterialSettings in QGIS 3.30 and is API breaking + try: + symbol.setMaterial(material) + except AttributeError: + symbol.setMaterialSettings(material) symbol.setEdgesEnabled(True) new_rule = QgsRuleBased3DRenderer.Rule(symbol, "\"surface.type\" = '{surface}'".format(surface=surface_type)) @@ -76,7 +84,11 @@ def apply(self, vectorlayer): material = create_material(self._else_color) symbol = QgsPolygon3DSymbol() - symbol.setMaterial(material) + # setMaterial method renamed to setMaterialSettings in QGIS 3.30 and is API breaking + try: + symbol.setMaterial(material) + except AttributeError: + symbol.setMaterialSettings(material) symbol.setEdgesEnabled(True) new_rule = QgsRuleBased3DRenderer.Rule(symbol, "ELSE")