I've placed an ellipse in my model, enabled Transparency in the View Attributes, filled the shape and changed the shape's Transparency value. The element displays with the expected transparency. In my tool's code, I create an ellipse, and set it's fill and transparency:
IAreaFillPropertiesEdit *fillProps = dynamic_cast<IAreaFillPropertiesEdit*>(&eeh.GetHandler()); UInt32 fillColor = 23; bool alwaysFill = true; fillProps->AddSolidFill(eeh, &fillColor, &alwaysFill); ElementPropertiesSetterPtr propSet = ElementPropertiesSetter::Create(); propSet->SetTransparency(.95); propSet->Apply(eeh);
However, when the ellipse displays in _OnDynamicFrame(), the ellipse is not transparent (I have ensured that the view's transparency is enabled). Might that be due to the way I'm setting the RedrawElems object?
RedrawElems redrawTool; redrawTool.SetDrawMode(DRAW_MODE_TempDraw); redrawTool.SetDrawPurpose(DrawPurpose::Dynamics); redrawTool.SetDynamicsViews(IViewManager::GetActiveViewSet(), ev.GetViewport()); redrawTOol.DoRedraw(eeh);
Thanks,
Bruce
The ellipse is displaying as a solid color fill in dynamics?
When you accept your tool's ellipse, does it draw with transparency then...the problem is only in dynamics?
The transparency of elements in dynamics is actually a global preference, by default all elements are displayed transparent. Maybe you've changed this preference?
Brien Bastings said:The ellipse is displaying as a solid color fill in dynamics?
Yes and no. The ellipse IS filled, but it is NOT "completely" opaque - I do see other elements "behind" the ellipse. After reading your questions, I think
my "issue" is that no matter what I set the transparency to, it seems to have no effect. It's always "somewhat" transparent, but I can't seem to alter it.
Brien Bastings said:.the problem is only in dynamics?
I'm only displaying the ellipse during dynamics - it's never written to the file. Essentially I'm skewing the ellipse into an isometric representation and using it to "show" the user the current isometric plane they are working with inside my tool.
Brien Bastings said:Maybe you've change this preference?
I don't think so. I just verified my settings are what you show,
Bruce Reeves SRNS said:I've placed an ellipse in my model
Bruce Reeves SRNS said:I'm only displaying the ellipse during dynamics - it's never written to the file
It's not easy to follow your questions when you write contradictory statements!
Regards, Jon Summers LA Solutions
Bruce Reeves SRNS said:I don't think so. I just verified my settings are what you show,
Right then, every element displays with 25% transparency in dynamics (default setting), this overrides the 95% transparency you are setting on the element, so this is working as intended. Play with the slider in the preference dialog if it's still not clear what's happening...
You might want to consider using a view decoration in your tool instead of element dynamics. The transparency for view decorations is not affected by view flags or the element dynamics preference...
HTH
-B
Maybe I should have said it differently...
Bruce Reeves SRNS said:I've placed an ellipse in my model, enabled Transparency in the View Attributes, filled the shape and changed the shape's Transparency value. The element displays with the expected transparency.
The ellipse I placed displayed fine.
Bruce Reeves SRNS said:In my tool's code, I create an ellipse, and set it's fill and transparency
Bruce Reeves SRNS said:However, when the ellipse displays in _OnDynamicFrame(), the ellipse is not transparent
The issue is setting the Transparency while in my tool...
Brien Bastings said:You might want to consider using a view decoration in your tool instead of element dynamics.
I will take a look at that. I've only (so far) used an raster icon as a view decoration...
Bruce Reeves SRNS said:I will take a look at view decoration
Here's an article about view decoration and view transients.
You can draw pure geometry (e.g. an ellipse) or a transient element (i.e. an ellipse element) using IViewTransients, as well as sprites. Pure geometry might be what you want...
IViewTransients