<div dir="ltr">Hi Martin<div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 18, 2014 at 3:35 AM, Martin Landa <span dir="ltr"><<a href="mailto:landa.martin@gmail.com" target="_blank">landa.martin@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
is it possible in QGIS to change transparency for all rasters in the<br>
group? Or is there any plugin for that?</blockquote><div><br></div><div>Not sure if there is any plugin for that - but the code to do it is simple (in QGIS >= 2.4).</div><div><br></div><div>Assuming your group is the first item in the layer tree:</div><div><br></div><div><div>root = QgsProject.instance().layerTreeRoot()</div><div>group = root.children()[0]</div></div><div><br></div><div>for ch in group.children():</div><div>  if isinstance(ch, QgsLayerTreeLayer) and isinstance(ch.layer(), QgsRasterLayer):</div><div>    ch.layer().pipe().renderer().setOpacity(0.3)<br></div><div><br></div><div>(opacity should be in range 0-1)</div><div><br></div><div>Cheers</div><div>Martin</div><div><br></div></div></div></div>