Comments (3)
Did a little research...
It would seem that Raytracer.addObject()
is not thread safe, when it has to recursively call itself. That happens, when theObject
is and ObjectCollection
, it this case a ScriptedObject
.
Adding some debugging code shows that addObject()
always finds both of the first level objects (scripts), but sometimes misses one of the cubes the scripts produce. Setting addObject synchronized
naturally takes care of the problem but then we'd lose (some of the) benefit of parallel processing.
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.
from artofillusion.
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 SriptedObject.getObjectScript()
is visited twice for each rendered frame. Once before Raytracer.addObject()
and once after. Apparently the firts one happens in the model scene and addObject()
triggers the latter one is for the raytracing scene. With Groovy the latter visit is sometimes missing for one of the objects (typically looks like the 1st one on the list). Other times both objects end up in the same coordinates.
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 scripts only use new CoordinateSystem()
.
When I change the language to BeanShell the scripts work as expected.
from artofillusion.
Related Issues (20)
- Need help with Linux version HOT 4
- Rotation center of Scene Camera lost at save / open HOT 2
- Script editor window closing loses already saved changes HOT 21
- FileChoosers are missing file type filters HOT 2
- Clean up older Pull requests. HOT 1
- Migrate to build system with managed dependency support
- RFE. Extract procedural modules to separate plugin sub project HOT 3
- Loading freeze for object-script that tries to access the object list HOT 7
- Could not Bulk Edit on ScriptedObject Pose track HOT 2
- Text Area on script editing windows does not resize on maximize/restore.
- Script UI objects can be orphaned HOT 4
- Triangle mesh constructor description HOT 4
- Menu shortcuts conflict for Africaans language HOT 4
- "Transfrom Object..." order of operations is wrong HOT 15
- AOI hangs on shutdown if SPManager has been opened.
- Rotation angles calculation does not give optimal results HOT 3
- Can not compile. Recenet change in code?? HOT 9
- Start-up settings to core AoI HOT 4
- Probably bad Startup Scripts execution order HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from artofillusion.