-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem rendering multiple scripted objects (Groovy related) #312
Comments
Did a little research... It would seem that Adding some debugging code shows that As I recall, in the earlier case the scripted object was supposed to create arrow heads out of primitives by boolean operations and in that case the outcome was in most cases only partially made as if the object from the collection had been read before the script had completed the build. That would also explain what happens here. If that theory is correct, the question would be, how can it be made sure that running the script has been competed before addObject() requests the content? Edited a bit. |
So, the problem is that Groovy is not thread safe! -- This is actually nothing new, it tends to fail with recursion levels and things of that sort too... I changed the objects so that one of them is a Cylinder and one a Cube. When I render the 1 second movie, sometimes one of the objects is missing entirely and sometimes their position coordinates are confused... I did not quite understand what the mechanism that triggers updating the ScriptedObjects is, but it turns out that In the coordinates swapping case I find it a bit strange that the coordinates that are changing places are not in the script, they are the Scene position coordinates. Internally the example scripts only use When I change the language to BeanShell the scripts work as expected. |
And a bit more poking.... Making all the object declarations even "more local" to I wonder if it would be possible to create a "safe mode" that would be switched on is a |
May we read this as "old 2.1.2 groovy is not thread safe" ? |
I have no idea if these issues would have been fixed in later versions. All I know, is that in AoI both, threads and recursion are poison, when Groovy is involved. |
Strange things happen, when you try to render a scene with multiple
ScriptedObjects
. Attached a file to demonstrate. The two cubes respond fine to the time slider on the scene but rendering keeps randomly losing one of them. Sometimes they may even swap places.Scripted cubes.zip
I have ran into this before, but I can't remember the exact case. At that time the objects were more complex and it involved occasionally leaving the construction of some of the objects incomplete. As I recall, I traced the problem to multiple threads feeding data to some more static part of the rendering (possibly at building the triangulated scene for
RayTracer
), so that one object was not finished before the next one was pushed into the process.The text was updated successfully, but these errors were encountered: