Notifications
Clear all

[Closed] gw.Marker, Disable Draw On Top?

Is it possible to disable draw on top when using gw.Marker, or is there another method to use, to display something similar?

I’m trying to make sure it doesn’t show over objects, polygons, ect. when its position is behind them from the current p.o.v.

Also I noticed it really drops fps in viewport, is there anyway to make it faster, or something similar that is faster?

Thanks for any information you can share.

Edit:
I tried doing this…


RenderLims = gw.getRndLimits ()
append RenderLims #backcull
gw.setRndLimits RenderLims

but it didn’t help, I guess what I thought that should do, isn’t what it does.

16 Replies

how important is a constant screen size ?

2 Replies
(@cg3dopifex)
Joined: 11 months ago

Posts: 0

Fairly important, but I’m willing to find out anything even if its not.

(@denist)
Joined: 11 months ago

Posts: 0

you can make a scripted helper with custom mesh and constant size. that’s what getScreenScaleFactor for…

I know, but don’t you have to rebuild the mesh every time the viewport changes ?

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

you don’t have to rebuild… only scale or make transform.

op on an other issue #backcull would only disable back face culling try #zbuffer instead.

1 Reply
(@cg3dopifex)
Joined: 11 months ago

Posts: 0

Also not sure what this was meant to do, all this gw is new to me, but it didnt stop the markers from drawing on top of everything.

Ok I tried what Denis mentioned, but I’m having an issue.

I made a standard dummy box, and gave it a custom param, and gave that a controller point3 script.

Here’s the Expression I’m using,


[I]--BoxHelper = the dummy box node[/I]
theboxsize = ( (getScreenScaleFactor BoxHelper.pos) * 0.01)
BoxHelper.boxsize = [theboxsize, theboxsize, theboxsize]

The only issue is, it’s only updating the boxsize set from the expression when I move the Dummy Box.

Anyway to get it to update also when zooming / rotating / panning the view?

I didn’t think it would work on the marker I was just pointing out the correct flag to use (though it doesn’t always work in the sdk either). As for the constant size thing just use a Point helper instead of the dummy and check the constant screen size.

1 Reply
(@cg3dopifex)
Joined: 11 months ago

Posts: 0

Ah can’t believe I overlooked the point helper…
How can i get it to always be facing the camera though, I figure a lookat constraint, but what can I use to get the proper lookat value to constrain to?

Just found viewport.getTM() in the maxscript help, so I guess using the inverse of that for the rotation would make it always face the camera.

But I’m getting the same problem as with the boxsize of the other expression, its only updating when moved…

I’m using a scripted rotation controller of

inverse (viewport.getTM())

What am I missing?

use manipulator… it updates on every redraw

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

btw… it also has built-in ‘constant screen size’ option

I would have to make a new object type I guess?

Also how would the speed be compared to the gw.hMarker?

Using this as a preview of one objects selected vertices on another object with a local space distance threshold, whose topology most likely wont match.

Or am I completely going about it the wrong way?

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

gw drawing is always on top of view…

you don’t have to make new type(class). it calls the scripted manipulator…

i think that the easiest way for me to understand what you want to make is to see the picture. could you post an image of what you want to draw?