I'm currently using the below code to overlay text and works flawlessly.
It is possible to show also an image e.g. jpg, bmp ?
thank you!
cheers,
Dorin
Code: Select all
textSep = coin.SoSeparator()
cam = coin.SoOrthographicCamera()
cam.aspectRatio = 1
cam.viewportMapping = coin.SoCamera.LEAVE_ALONE
trans = coin.SoTranslation()
trans.translation = (-0.95, -0.5, 0)
myFont = coin.SoFont()
myFont.name = "Arial"
size = 75
myFont.size.setValue(size)
SoText2 = coin.SoText2()
SoText2.string.setValues(0,3,["A","","BCD"])
SoText2.justification = 1
color = coin.SoBaseColor()
color.rgb = (0, 0, 0)
textSep.addChild(cam)
textSep.addChild(trans)
textSep.addChild(color)
textSep.addChild(myFont)
textSep.addChild(SoText2)
activeDoc = FreeCADGui.ActiveDocument
view = activeDoc.ActiveView
sg = view.getSceneGraph()
viewer = view.getViewer()
render = viewer.getSoRenderManager()
sup = render.addSuperimposition(textSep)