On 12/01/2013 at 09:48, xxxxxxxx wrote:
Originally posted by xxxxxxxx
^Not to beat a dead horse. But I really do think that Draw() is definitely what you're missing.
Since LD brought up User Areas. I took a look at my UserArea notes. And it turns out that UA also uses an overidden draw() method to handle the live drawing. But it's named DrawMsg().
AFAIK. We cannot draw into User Areas without it. Just like Draw() is needed for screen and GUI drawing.
of course is the drawing of the UserArea is done within DrawMsg, everything else would be
magic
My GeClipMaps are just drawn once on the instantiation of the GeUserArea in its
constructor. When c4d calls for a redraw of the UserArea, the DrawMsg() method creates a
bitmap pattern out of the bitmaps returned by the GeClipMaps. just on certain events the
GeClipMaps are being flushed and redrawn.
Lets think about what's happening when we are drawing something:
We are constantly changing something(redrawing). Even if the draw values stay the same.
What tells the plugin's GUI to keep in snyc with this drawn object?
What happens when plugin is not there anymore but the object is still drawing itself?
at least for my (unexperienced) oppinion there is the basic misconecption of yours. GeClipMaps
are not meant to be dynamic or something they are just a subtype of the c4d.Bitmap class, which
provides some helper methods to fill this bitmap with content. their content remains static. that is
the reason why there are no overwriteable methods for a GeClipMap.
plugin classes on the other hand need a dynamic drawing content like a TagPlugin for the
opengl view or a GeUserArea for the gui. Because of that they have to be bound to certain
(overwriteable) methods. GeClipMaps are not part of the GUI, they are just static bitmaps.
if your assumptions were true, shoud it not be impossible to use a GeClipMap in a script (or at
least shouldn't this produce dozens of runtime errors ?).
import c4d
from c4d import bitmaps
from c4d.bitmaps import GeClipMap
w, h, step = 880, 800, 100
txt = 'C4D'
def main() :
map = GeClipMap()
map.Init(w,h)
map.BeginDraw()
map.SetColor(125,125,125,255)
map.FillRect(0, 0, w, h)
map.SetColor(50,50,50,255)
for x in xrange(0, w, step) :
for y in xrange(0, h, step) :
map.TextAt(x, y, txt)
map.EndDraw()
bitmaps.ShowBitmap(map.GetBitmap())
if __name__=='__main__':
main()
or am i still misunderstanding you ? however i think i might be worth a shot for the OP, but
i think it is very unlikely that you are bound to Draw type methods with GeClipMaps. it would
render GeClipMaps unuseable for large parts of the api, which might have to use a drawable
bitmap class, but do not have any gui access.
if i am all wrong on this, it should be stated MUCH more clearly in the documents.
@ wicked
i think you misunderstood me a bit. my kind of vague idea was, that the GeClipMap neither
should be a memeber of the plugin class, nor of the Message() method, but the member of
a seperate method which returns a bitmap as its result. this method is called from within
the Message method, to ensure, that there are not any 'parallel' attempts to use the same
GeClipMap instance in a threading context.
but please always bring to your mind, that i am a newb
so it is most likely utter nonsense.