Hello, I am writing a custom modifier (inheriting from Modifier) that adds topology (extending the borders), and whenever I am below it on modifier stack with “show end result” enabled and manipulate elements (move/scale/rotate) in any subobject level it crashes. I have tested ChannelsUsed and ChannelsChanged with ALL_CHANNELS and GEOM_CHANNEL | TOPO_CHANNEL but the problem insists. I also tried the NotifyInputChanged but no luck. Any thoughts, what am I missing?
Custom modifier crashes
is it crashing in a max routine or in your plugin ? ie can you “see it” in the debugger ?
I hope the attached picture and video somehow help you @Klvnk help me because my experience in c++ and max sdk is not extended. Trying to find my way reading and studying the howto, samples and online reference.
are you working on an MNMesh ?
Unfortunately not, I did not manage to get a copy of the mesh as MNMesh in order to operate and copy back, and the effect every time it was evaluated it was stacking. I am using Mesh but when I try to edit interactively it crashes. Actually since the last time we “spoke” I managed to operate with end result enabled but it needs to reenable or change the subobject level in order to update. I used NotifyInputChanged and a custom LocalModData. The issue is that when the editing is stopped it does not emmit something. Should a mouse callback be implemented? It seamed in the sample extrude.cpp much simpler, since you can manipulate interactively e.g. a spline, below the modifier.
TestExtendModLocalData* hs = static_cast<TestExtendModLocalData*>(mc->localData);
if ((int)partID == 134) hs->Invalidate(); //TODO(“check which partID results in int-134”)
if ((int)partID != 134) hs->SetValid(changeInt);
ed.: And I just realised that there is a general issue with editable_mesh and returning to the modifier after being just below the modifier on stack.
TheHold seams to be the answer, need to run more tests before committing to be the answer.