Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
On 16/12/2013 at 04:05, xxxxxxxx wrote:
ok, i'm doing and object plugin. Everything that i draw which is 2D, like DrawPoint2D and other objects that are drawn in screen space, are drawn behind/overlapped by the objects in the scene. I'm drawing in the c4d.DRAWPASS_OBJECT pass.
for example:
def Draw(self, op, drawpass, bd, bh) : if drawpass==c4d.DRAWPASS_HIGHLIGHTS: return c4d.DRAWRESULT_SKIP elif drawpass == c4d.DRAWPASS_OBJECT: bd.SetMatrix_Screen() posList = [Vector(500,500,500), Vector(480,480,500), Vector(470,470,500), Vector(460,460,500), Vector(450,450,500), Vector(440,440,500), Vector(430,430,500), Vector(420,420,500), Vector(410,410,500), Vector(400,400,500)] for point in posList: bd.DrawPoint2D(point) bd.SetMatrix_Matrix(None,bh.GetMg(),0)
On 16/12/2013 at 07:39, xxxxxxxx wrote:
If you use a SceneHook plugin to draw 2D stuff to the screen it won't get hidden by the objects. Take a look at this: http://c4dprogramming.wordpress.com/2012/11/15/2d-drawing-using-a-scenehook/
However, I found another way to get around the problem (I call it a bug) by creating a dummy 2d object at the top of my code where I'm drawing things. The dummy object I use is just a 2D line with no length. This pushes the drawn 2D stuff out one layer and prevents objects from covering it up.
-ScottA
On 16/12/2013 at 12:19, xxxxxxxx wrote:
Hm, I can't get to exploit your bug suggestion The result is the same, and if i don't fix the matrix after that it messes up the 3d draws following in the code. I found that post with the scene hook before posting here, but I have no C++ experience at all. Looking at that code, i can't understand how to register a scene hook plugin via pythoh. Any hints ?
On 16/12/2013 at 13:25, xxxxxxxx wrote:
I don't happen to have a Python example of drawing 2D things to the screen in an Object plugin. But I do have one for a Tag type of plugin.
If you like. Send an e-mail to: [email protected] with your e-mail address. And I'll send you the plugin and the code.