bulia byak schrieb:
On Dec 7, 2007 1:32 PM, Maximilian Albert <Anhalter42@...173...> wrote:
Hi all,
I've asked this before but unfortunately I haven't been able to fix it yet. My rewritten 3D box class inherits from SPGroup. Each box has six children of type Box3DSide, each of which is inherited from SPPolygon. So far so good. The problem is that I can't figure out what functions I need to call in sp_3dbox_update so that the boxes are correctly updated on screen during handle dragging (but without writing to repr for efficiency).
Note that when you drag a node, repr is not updated but display is, for the same efficiency reason. So you can borrow it from there. The function you need is object_update in nodepath.cpp: it creates a new spcurve and manually sets it on the SPShape of the object, then issues requestModified. That's what you need to do if you want to update display while bypassing the repr update.
Thanks, that's precisely what I was trying to do. I had borrowed the code from the other tools (but it's essentially the same as in nodepath.cpp) and placed it in the sides' update methods. But what drove me crazy was the fact that the curves were set alright but didn't show up on the screen - except when requestDisplayUpdate was issued, too, but since I did this from the parents' update method, it created evil cycles.
Fortunately, a first stab at MenTaL's approach of moving the calls to requestDisplayUpdate() to other places (e.g., to the knot handler functions) seems to yield promising results. I don't know why I didn't try this before, but I was so much focused on the parent-child relationship between boxes and their sides that I considered it harmful to break it to some extent by moving the displayUpdates out of the box's responsibility.
As an aside, I just noticed that you wrote "then issues requestModified" above, whereas I have only worked with requestDisplayUpdate so far (and have only seen this in the other tools' code, IIRC). Is there a notable difference between the two that could be relevant for me? Do I have to consider them both or can I stick to requestDisplayUpdate?
Thanks again, Max