tom33
(Ye lin a)
December 17, 2025, 1:02pm
1
Question : How is DisplayMaterial constructed with rhino’s document default materials
Pictur_ information : On the left is the material drawn in the pipeline, and on the right is the rhino default material
Me = rh.Display.DisplayMaterial(sd.Color.LightGray)
Me.Transparency = 0.5
DisplayMaterial class
tom33
(Ye lin a)
December 17, 2025, 1:06pm
2
@nathanletwory Hi Sir, can you help me? The material drawing in the pipeline always troubles me, thank you
Hi @tom33 ,
You are passing a single argument to the constructor, basically just saying make a display material with the diffuse/albedo color of gray.
then with Me.Transparency = 0.5 you are setting additional settings of said material.
so to achieve what you see on the right you need to set the additional properties such as Me.Diffuse, etc.
1 Like
tom33
(Ye lin a)
December 17, 2025, 3:23pm
4
Display.DisplayMaterial(
sd.Color.Gray,
sd.Color.White,
sd.Color.Yellow,
sd.Color.Gray,
0,0.3
)
At present, the other parameters also seem unable to achieve the default material settings of Rhino.
@tom33 I think you are actually looking for the DisplayPipeline settings and specifically Display Pipeline Attributes:
https://developer.rhino3d.com/api/rhinocommon/rhino.display.displaypipelineattributes:
https://developer.rhino3d.com/api/rhinocommon/rhino.display.displaypipeline
This is where you can set it to be rendering edges, different control point styles, etc.
1 Like
nathanletwory
(Nathan 'jesterKing' Letwory)
December 18, 2025, 2:52am
6
@tom33 unfortunately I don’t know much about our display pipeline. Perhaps @jeff has better insight regarding display materials.
1 Like
tom33
(Ye lin a)
December 18, 2025, 3:11pm
7
Thank you for your reply. I think it might be a problem with my grid? Resulting in the rendering not meeting the requirements?
The key part of the pipeline👇
self.eddm = rh.Display.DisplayMaterial(
)
self.eddm.IsTwoSided = False
self.eddm.BackDiffuse = sd.Color.Red
self.eddm.BackTransparency =1
def DrawForeground(self, e):
"""
Draw_e
"""
try:
if not self.Drawing_Meshs is None:
for me in self.Drawing_Meshs:
e.Display.DrawMeshShaded(
me,
self.eddm
)
pass
except Exception as ex:
print("me",ex)
tom33
(Ye lin a)
December 18, 2025, 3:12pm
8
Thank you for your reply.
clement
December 19, 2025, 4:25am
9
Hi @tom33 ,
your problem is likely that you’re drawing your mesh in the DrawForeground channel which draws without depth testing and writing. Try to change this to PostDrawObjects first without transparency. If you find that the mesh still does not draw as expected, add it to the doc and see how Rhino draws it without your conduit.
Note that you need to draw your mesh edges using DrawMeshWires
_
c.
1 Like