Hello @Sinnerkot,
Welcome to the Plugin Café forum and the Cinema 4D development community, it is great to have you with us!
Getting Started
Before creating your next postings, we would recommend making yourself accustomed with our Forum and Support Guidelines, as they line out details about the Maxon SDK Group support procedures. Of special importance are:
About your First Question
First of all, please share code in the future so that we can see that you tried on your own and more importantly what you tried to do. Drawing text can be achieved with BaseDraw.DrawHUDText. This will draw text in the HUD style, you can also draw it manually using a bitmap and then having full control over the outcome, but that can also get complicated when you then must make sure that your text looks sharp.
I provided a brief example for BaseDraw.DrawHUDText
below. Using a Python programming tag is not the only option, you can use everything that has a .Draw
method.
Cheers,
Ferdinand
File: hud_text.c4d
Result:
Code:
"""Demonstrates how to draw hud text with a `BaseDraw`.
"""
import c4d
doc: c4d.documents.BaseDocument # The document evaluating this tag
op: c4d.BaseTag # The Python scripting tag
def main() -> None:
pass
def draw(bd: c4d.BaseDraw) -> bool:
"""Draws the string located at (c4d.ID_USERDATA, 1) onto the origin of the object holding this
tag.
"""
# Bail if we are not in the object drawing pass.
if bd.GetDrawPass() != c4d.DRAWPASS_OBJECT:
pass
# Get the object the tag is attached to and its location in screen space.
obj: c4d.BaseObject = op.GetObject()
mg: c4d.Matrix = obj.GetMg()
p: c4d.Vector = bd.WS(mg.off)
# Get the string to draw and set the drawing operations to be carried out in camera space.
msg: str = op[c4d.ID_USERDATA, 1]
bd.SetMatrix_Camera()
# DRaw the hud text at the origin of the object.
bd.DrawHUDText(int(p.x), int(p.y), msg)
return True