hud depth buffer?
-
What is the correct code "HUD depth buffer" in R19 and R2023?
As shown, in R2023 the HUD is not obscured by objects. (R19 is inverted)
Thank You.bd.SetDepth(False) bd.DrawMultipleHUDText(data) bd.SetDepth(True)
-
Hi @ymoon,
Could you please provide minimal working code snippet that highlights the problem?
There were quite some changes since R19, so it's now hard to say if it was broken or fixed on it's way.
Cheers,
Ilia -
@i_mazlov
Here is code. Thank You.def draw(bd: c4d.BaseDraw) -> bool: obj=op.GetObject() points = obj.GetAllPoints() objMg = obj.GetMg() newpointpos = [] for o in points: newmg = objMg * o newpointpos.append(newmg) scrpos = [] for p in points: newpos = bd.WS(p) scrpos.append(newpos) textval = [] for i, pos in enumerate(zip(newpointpos, scrpos)): data = {"_txt":str(i), "_position":pos[1]} textval.append(data) bd.SetDepth(False) bd.DrawMultipleHUDText(textval) bd.SetDepth(True) return True
-
Hi @ymoon,
Sorry for the delayed answer.
Drawing HUD functions are not intended to be using depth buffer, so managing z offset functions (e.g. BaseDraw.LineZOffset(), BaseDraw.SetMatrix_Screen(), BaseDraw.SetMatrix_Matrix()) would not make any effect.
As a workaround you might consider only drawing HUDs for those points that are exposed to the editor camera.
Let me know if you have any further questions.
Cheers,
Ilia -
@i_mazlov said in hud depth buffer?:
As a workaround you might consider only drawing HUDs for those points that are exposed to the editor camera.
Thanks for your answer. The code above is my limit.
would you give me a hint? thank you. -
Added one more for... zip to remove the invisible points.