THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 05/05/2012 at 21:07, xxxxxxxx wrote:
Originally posted by xxxxxxxx
Concerning to what littledevil said, you may use the DrawHelper plugin to enhance your skills with
the BaseDraw class.
It is similiar to the PyGenerator Object, but instead of generating Objects,
it enables you to do drawings into the Viewport.
Available gloabl variables are:
raw: the ObjectData Instance of the DrawHelper object
op: the BaseObject Instance (like in a PyGenerator)
drawpass: the Drawpass
bd: the BaseDraw Instance
bh: the BaseDrawHelper Instance
Note: Take care that you don't have important scenes opened. I must admit that I have noticed several crashes when closing Cinema 4D and the DrawHelper object is present in your scene.
Very interresting plugin
! thank you NiklasR 
Originally posted by xxxxxxxx
you could draw your text with the basedraw class.
Originally posted by xxxxxxxx
Originally posted by xxxxxxxx
you could draw your text with the basedraw class.
Yes, it is possible. By first drawing text into a bitmap with the GeClipMap class. Then drawing this bitmap with DrawTexture() into a view BaseDraw.
i'll test this, thnx 
actually, another problem disturbing me now, in fact i'm trying to make a plugin tool, and i'm trying to understand how to get some values (combobox value, and number) from the subDialog interface.
i tried to get them from the 'data' container (cf. mouseinput, draw, etc..) but it seems empty :S
here an example that i did yesterday :
import c4d, os
IDP = 1000001
class myToolDialog(c4d.gui.SubDialog) :
ID_COMBO = 10002
ID_NBR = 10003
def CreateLayout(self) :
self.GroupBegin(10000, c4d.BFH_FIT, 3, 1)
self.GroupBorderSpace(10, 10, 10, 10)
self.AddStaticText(10001, c4d.BFH_LEFT,0,0," Value ", c4d.BORDER_NONE)
self.AddComboBox(self.ID_COMBO, c4d.BFH_SCALE | c4d.BFH_FIT, 0, 0, False)
self.AddChild(self.ID_COMBO, 200, " Red ")
self.AddChild(self.ID_COMBO, 201, " Blue ")
self.AddEditNumberArrows(self.ID_NBR, c4d.BFH_FIT)
self.GroupEnd()
return True
def InitValues(self) :
self.SetLong(self.ID_COMBO, 200)
self.SetReal(self.ID_NBR, 10)
return True
class MyToolPlugin(c4d.plugins.ToolData) :
def MouseInput(self, doc, data, bd, win, msg) :
value = self.dialog.GetLong(10002)
nbr = self.dialog.GetReal(10003)
#print 'On Click >>> Value : ', value, ' >>> Nbr : ', nbr
return True
def Draw(self, doc, data, bd, bh, bt, flags) :
value = self.dialog.GetLong(10002)
nbr = self.dialog.GetReal(10003)
print 'Draw >>> Value : ', value, ' >>> Nbr : ', nbr
if value == 200:
color = c4d.Vector(1,0,0)
else:
color = c4d.Vector(0,0,1)
bd.SetMatrix_Matrix(None, c4d.Matrix())
bd.DrawSphere( c4d.Vector(0,0,0), c4d.Vector(nbr, nbr, nbr), color, 0 )
return c4d.DRAWRESULT_OK
def AllocSubDialog(self, bc) :
self.dialog = myToolDialog()
return self.dialog
if __name__ =='__main__':
mypath, myfn = os.path.split(__file__)
c4d.plugins.RegisterToolPlugin(id=IDP, str="Test", info=2,icon=None, help="TEst test", dat = MyToolPlugin())