Notifications
Clear all

[Closed] SDK: SimpleObject::Display no longer called when modifiers present

I have an SDK SimpleObject that I’ve made.

In its ‘Display’ function, I draw some polylines in the viewport.

Everything works fine when no modifiers are on the object. But if I add a modifier, the object’s Display function is no longer called (I’m guessing it’s because max calls the top modifier’s Display function instead?) and so my polylines disappear.

I’d really like to be able to display those viewport lines regardless of whether or not the object has modifiers on it. Is this possible?

7 Replies

are you using the mesh as well ?

Yes, I draw both: the mesh, as well as a polyline around it.

I think you’ll need to implement your polyline draw in the

virtual int BaseObject::Display  (  TimeValue  t,    INode *  inode, ViewExp *  vpt,   int  flags,   ModContext  *  mc) 
[i]function.[/i] Which is called to display the modifier gizmo but is implement by both the PatchObj and SplineShape so can be implemented by base objects.

Not sure on the usage, you may have to call the baseobject function after doing your thing but maybe not. I would be tempted to implement and empty function and run it through the debugger to see where it gets called when modifiers are present and when not.

Hmm…I’ll look into that…

Nah, that didn’t work. Thanks for the suggestion though!

yeah I tried it on one of mine, I have a quad cloud generator which inherits from simpleobject2 and uses several differing emitters which I handle with a additional mesh. They also don’t get drawn when a modifier is applied not really given it much thought as it was really an issue that bothered me until now

interestingly standard particles use a “gizmo” mesh thats sticky when a modifier is applied! having a browse through the source.

Yea I noticed that too. Could it be because SimpleParticle objects that they inherit from ignore modifiers? You’ll notice that particles aren’t affected by modifiers on top of them…