Decompose (or expand) *selected* cap / corner components

Hi, I need to flatten (decompose / expand / whatever it is called internally), but only the selected ones via Python.

I got everything including targeting the right hints, but there is no visible API to decompose the hints.

(I basically want to decompose all selected corners/caps in all (master- & special) layers, which is still not an option when holding the option key in the UI’s context menu under “Decompose Cap”. (I expected this to be implemented already?)

Thanks in advance

Anyone please?

There is no ready-made API, but this works:

hint = ...
layer = hint.layer
hint.originNode.parent.decomposeCorner_(hint)
layer.removeHint_(hint)
for h in layer.hints:
	h.updateIndexes()