Custom Empty Object

Hi all,
I wonder if is possible to customize/write a new empty object
Possibly I would like to be able to draw a Cylinder in the viewport and update is width and height in the viewport
Something like the CylinderGizmo in 3dsmax
How can I do this? with class should I look to write in the viewport?

Hi, AFAIK you cannot add more options than the already available shapes (arrows, circle etc.), but you can get around this by drawing a custom Gizmo around an empty

https://docs.blender.org/api/master/bpy.types.Gizmo.html?highlight=gizmo#bpy.types.Gizmo

Please, have a look at the template in blender’s text editor menu:

Templates->Python->Gizmo Custom Geometry

Another idea is to have a normal empty object.

That you give is a special property.

Property Definitions (bpy.props) — Blender Python API

And then having a modal operator, to find it’s position, and draw anything.

https://github.com/blender/blender/blob/594f47ecd2d5367ca936cf6fc6ec8168c2b360d0/release/scripts/templates_py/operator_modal_draw.py#L32

However as said. Unless you want to write your own tool and iteract with it you should go for gizmos.

Did you know you can attach a custom image or movie to an Empty?

OK, so it’s only 2D …