Solved Best way to display a bitmap in the viewport background

I would like to create an Object plugin and I would like the code to be able to show a bitmap, with optional alpha (transparency) adjustment, in the background of the viewports (perspective and orthogonal views).
What is the best way do do it?
I don't need actual code. Just what methods to override and what must I make to be sure it displays below all viewport objects.
Thank you very much in advance for any reply.

Rui Batista

Hi sorry for the late reply, I overlooked your topic.

You will need to override the Draw method of your ObjectData and then use BaseDraw.DrawTexture.

Cheers,
Maxime.

You can draw into the viewport using a scene hook and render a quad containing a bitmap texture. These may help you get started.

https://developers.maxon.net/?p=355
https://developers.maxon.net/?p=496

@kbar, thank you for the reply.
The problem with the Scene Hook is that it requires C++.
I'm coding in python.

Hi sorry for the late reply, I overlooked your topic.

You will need to override the Draw method of your ObjectData and then use BaseDraw.DrawTexture.

Cheers,
Maxime.

Hello @rui_mac,

without any further questions or replies, we will consider this thread as solved by Monday the 20th and flag it accordingly.

Thank you for your understanding,
Ferdinand

MAXON SDK Specialist
developers.maxon.net