Hi,
The quoted lines in point 3 are a problem because when your first object is a MyObject
, you will end up with an infinite recursion, because this object will try to build its caches when it is added to the scene (either in the illegal direct scene graph modification way of yours or by the correct way by returning that MyObject
as a result of your GVO
). Building cashes will mean that it will try invoke its GVO
which then is the start of the infinite recursion. But this is only a somewhat minor issue with your code.
There are two major problems with both your code snippets.
-
You modify the scene graph and invoke events in a threaded context (see point 4 in my last posting).
-
You 'misuse'
GVO
as you basically treat it like a script orCommandData
plugin (see points 5 and 6 in my last posting).
Disregarding the threaded context of a method and the mentioned limitations can lead to corrupted objects and files or crashes of the main application. I was probably a bit unclear about the importance of the points in my first posting, I just did wrote them down as I red your code. The important points you should focus on are 4, 5, and 6. You will have to change your approach.
If you are unclear on how to do that, check the example plugins on github and then explain here to us what you are trying to do. Because I frankly, have no idea, what your code is supposed to do on a higher level of meaning :)
Cheers
zipit