question about dirty
-
On 27/04/2013 at 02:59, xxxxxxxx wrote:
User Information:
Cinema 4D Version: r14
Platform: Windows ;
Language(s) : C++ ;---------
Hi,in my GetVirtualObjects function i check if the first child object (a spline) has changed. if so, some objects are generated along a spline.
now, when i move a point of the spline, the plugin always updates (which makes the whole thing quite slow)..
how can i get it so the plugin just starts after the movement of the point is finished and not every time? i guess it has something to do with the message MSG_POINTS_CHANGED. but how do i check this within GetVirtualObjects?
thanks for any input.
cheers,
Elloedit: btw, here is how i check right now:
Bool dirty = op->CheckCache(hh) || op->IsDirty(DIRTYFLAGS_DATA); dirty |= spline->IsDirty(DIRTYFLAGS_DATA) || spline->IsDirty(DIRTYFLAGS_MATRIX) || spline->IsDirty(DIRTYFLAGS_CACHE); if (!dirty) { return op->GetCache(hh); }
-
On 27/04/2013 at 04:11, xxxxxxxx wrote:
MSG_POINTS_CHANGED is a Nodedata.Message() id. You cannot access other nodes messages
form your node. your node does only receive messages regarding itself. the message notification
will be send in your case to the spline object.1. you have to determine your nodes dirty flag before GVO is called if you want to react on such
data.2. despite the fact that you are most likely unable to fetch MSG_POINTS_CHANGED for the spline
without some major core message sorcery, you should be aware that the msg is being fired very
often (so won't exactly solve your problem).3. listening from a core message plugin for EVMSG_CHANGE could be a solution, it is usually fired
after something has changed on a higher level. i guess this will be also the case for vertex editing
operations on splines.4. on a somewhat similar scenario i just introduced BaseDocument.GetMode() as a parameter for
my nodes dirty flag, so that it remains silent while the user is in edge, texture ... mode.edit : 5 you could also investigate the behaviour of the spline nodes dirty flag. i am not sure when
the dirty flag is set - while the user dragging vertices or after the user has moved a vertex. if the
last one is the case you could just use the splines dirty flag. -
On 27/04/2013 at 04:50, xxxxxxxx wrote:
Hey, that idea using BaseDocument GetMode is working. thank you!