<div class="gmail_quote">On Wed, Feb 24, 2010 at 5:49 AM, Giancarlo Amati <span dir="ltr"><<a href="mailto:ilferraresebono@hotmail.it">ilferraresebono@hotmail.it</a>></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'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<vtkAssembly> assembly = </div><div class="gmail_quote"> vtkSmartPointer<vtkAssembly>::New();</div><div class="gmail_quote"> assembly->AddPart(actor1);</div>
<div class="gmail_quote"> assembly->AddPart(actor2);</div><div class="gmail_quote"> </div><div class="gmail_quote"> vtkSmartPointer<vtkPropCollection> collection = </div><div class="gmail_quote"> vtkSmartPointer<vtkPropCollection>::New();</div>
<div class="gmail_quote"><br></div><div class="gmail_quote"> assembly->GetActors(collection);</div><div class="gmail_quote"> collection->InitTraversal();</div><div class="gmail_quote"> for(unsigned int i = 0; i < collection->GetNumberOfItems(); i++)</div>
<div class="gmail_quote"> {</div><div class="gmail_quote"> vtkActor::SafeDownCast(collection->GetNextProp())->GetProperty()->SetOpacity(0.5);</div><div class="gmail_quote"> }</div></div><br clear="all">Thanks,<br>
<br><div>David </div></div>