Hey Folks!
Two questions followed by the context.
-
Where's the best place to add/update materials when those changes are initiated from the parameters of a generator object plugin? MSG_DESCRIPTION_POSTSETPARAMETER? MSG_DESCRIPTION_CHECKUPDATE? SetDParameter()? Somewhere else?
-
Is it correct that in some instances the Start/EndUndo() calls aren't necessary, such as in the case of the previously mentioned messages/functions, since they are received/executed between MSG_DESCRIPTION_INITUNDO and MSG_DESCRIPTION_USERINTERACTION_END?
I have a generator plugin written in python that has a few parameters that are meant to deal with generating/adjusting materials (a filename parameter and a couple of combo boxes). Grouping the creation/adjusting of materials with their parameter change into a single undo was proving difficult until I stumbled upon the above info on the exception to the "rule of undo's" (must call Start/EndUndo()).
Then there were the crashes and the errors related to baseundo.cpp (I've included those below).
Critical_Log
{
[12:41:19] CRITICAL: Stop [baseundo.cpp(1857)]
[12:41:19] CRITICAL: Stop [baseundo.cpp(1956)]
[12:41:19] CRITICAL: Stop [baseundo.cpp(1956)]
[12:41:19] CRITICAL: Stop [baseundo.cpp(1897)]
[12:49:45] CRITICAL: Stop [baseundo.cpp(1857)]
[12:49:45] CRITICAL: Stop [baseundo.cpp(1956)]
[12:49:45] CRITICAL: Stop [baseundo.cpp(1956)]
[12:49:45] CRITICAL: Stop [baseundo.cpp(1897)]
}
I had myself convinced it was all related to those material affecting parameters and that I had misunderstood the way undo's work with parameter changes, which led me to the two questions above. In the end it didn't even have anything to do with any of that, just something stupid I was doing in Execute() until I rediscovered the threading information page in the sdk. So the problem, technically, is all fixed, but after all the experimenting while on the "wrong track" I'm left with 3 different places where I could put the code for those material changes and I'm just not sure which would be best.
Thanks!
Kevin