<div class="gmail_quote">On Wed, Feb 24, 2010 at 5:49 AM, Giancarlo Amati <span dir="ltr">&lt;<a href="mailto:ilferraresebono@hotmail.it">ilferraresebono@hotmail.it</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">




<div>
hello VtkUSERS,<br><br>is there any way to set the opacity of a vtkAssembly object?<br><br>Many thanks.<br>Giancarlo<br>                                               </div><div><br></div></blockquote><div class="gmail_quote"><br></div><div class="gmail_quote">
It doesn&#39;t look like you can set properties for the entire assembly, but you can set the opacity of every object in the assembly like this:</div><div class="gmail_quote"><br></div><div class="gmail_quote"><div class="gmail_quote">
<br></div><div class="gmail_quote">  vtkSmartPointer&lt;vtkAssembly&gt; assembly = </div><div class="gmail_quote">      vtkSmartPointer&lt;vtkAssembly&gt;::New();</div><div class="gmail_quote">  assembly-&gt;AddPart(actor1);</div>
<div class="gmail_quote">  assembly-&gt;AddPart(actor2);</div><div class="gmail_quote">  </div><div class="gmail_quote">  vtkSmartPointer&lt;vtkPropCollection&gt; collection = </div><div class="gmail_quote">    vtkSmartPointer&lt;vtkPropCollection&gt;::New();</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">  assembly-&gt;GetActors(collection);</div><div class="gmail_quote">  collection-&gt;InitTraversal();</div><div class="gmail_quote">  for(unsigned int i = 0; i &lt; collection-&gt;GetNumberOfItems(); i++)</div>
<div class="gmail_quote">    {</div><div class="gmail_quote">    vtkActor::SafeDownCast(collection-&gt;GetNextProp())-&gt;GetProperty()-&gt;SetOpacity(0.5);</div><div class="gmail_quote">    }</div></div><br clear="all">Thanks,<br>
<br><div>David </div></div>