Hello everyone,
I simply want to set my DisplayPipelineAttributes to render back faces in a color of my choosing with an opacity of my choosing. Lets say WhiteSmoke and 0.5 Transparency.
The idea is that the front faces will be solid/their render material and the backfaces will be slightly transparent but not hidden.
Most of the time I cull backfaces but for this application I need to show them ghosted.
I thought this would be a pretty easy attribute property but I’m confused as their are some new options now as of 8.20+
You can see here that when I modify my DisplayMode I can color the backface no problem.
But my conduit shows solid for the backfaces:
I’m trying to set the “conduit obj” to look like the “rhino geo” and I think this should be done in the DisplayPipelineAttributes for my custom conduit but I can’t seem to get it working.
DisplayPipelineAttributes Docs
Specifically:
BackfaceDisplayStyle
BackfaceStyle
Relevant excerpt:
# Back face settings
attr.Material.BackDiffuse = sd.Color.WhiteSmoke
attr.Material.BackTransparency = 0.5
attr.Material.IsTwoSided = True
attr.CullBackfaces = False
# attr.UseBackfaceMaterial = True
# attr.UseObjectBackfaceMaterial = True
attr.BackMaterialDiffuseColor = sd.Color.WhiteSmoke
attr.BackMaterialTransparency = 0.5
# attr.BackfaceStyle = rd.DisplayPipelineAttributes.BackfaceStyle.CustomMaterialAllBackfaces
the full function:
@staticmethod
def Geometry():
attr = Display.PreviewAttributes()
attr.CurveColor = sd.Color.FromArgb(105, 105, 105, 255) # Medium Grey #sd.Color.Black #Utils.ParseHexColor(UI.drawing_colors.get("new"), 255)
attr.CurveThickness = 1
attr.ObjectColor = sd.Color.White # Utils.ParseHexColor(UI.drawing_colors.get("new"), 200)
attr.ColorSource = Rhino.DocObjects.ObjectColorSource.ColorFromObject
attr.TextColor = Color.White
attr.CustomGroundPlaneShadowOnly = True
"""Properties for surface edges and section cut fills/colors"""
attr.ShowClippingFills = True
attr.ClippingPlaneFillColorUse = rd.DisplayPipelineAttributes.ClippingPlaneFillColorUse.SolidColor
attr.ClippingFillColor = Color.Blue
attr.ClippingEdgeColor = Color.Magenta
attr.ClippingEdgeThickness = 10
attr.ClippingShadeTransparency = 0.0 # 0.0 for opaque, 1.0 for transparent
attr.ClippingShadeSelectedPlane = True
attr.Material.Diffuse = sd.Color.WhiteSmoke
attr.Material.Transparency = 0.0
# Back face settings
attr.Material.BackDiffuse = sd.Color.WhiteSmoke
attr.Material.BackTransparency = 0.5
attr.Material.IsTwoSided = True
attr.CullBackfaces = False
# attr.UseBackfaceMaterial = True
# attr.UseObjectBackfaceMaterial = True
attr.BackMaterialDiffuseColor = sd.Color.WhiteSmoke
attr.BackMaterialTransparency = 0.5
# attr.BackfaceStyle = rd.DisplayPipelineAttributes.BackfaceStyle.CustomMaterialAllBackfaces
attr.ShowCurves = True
attr.ShowSurfaceEdge = True
attr.ShowSurfaceEdges = True
attr.SurfaceEdgeThickness = 1
attr.SurfaceEdgeThickness = 1.0
attr.SurfaceEdgeColor = sd.Color.FromArgb(105, 105, 105, 255) # Medium Grey
# attr.CastShadows = True
# attr.AmbientLightingColor = sd.Color.Red
# attr.IgnoreHighlights = True
return attr
Thank you for your help!