I am working on a galaxy simulation. If I run the script, and then scrub the timeline it works prefect. If I run the script and then do an opengl animation render, it renders perfectly.
But if I run the script, and then do a real render, it keeps adding galaxy.001, galaxy.002 objects continuously while it builds the scene.
Does anyone have any idea why this happens. Here is the main handler, I can post all the other functions, or a blend if need be. Thanks in advance.
No problem here. Script runs on my machine fine and renders fine. If I’m running the same file as you, it can only be your gpu? That’s a question, sorry. Can’t think of much else it could be. Good luck in your search. It looks like a great script.
ross_m, I had another person run the files on their machine and they have the same issue that I do. My gut feeling is that, the first few frames will look pretty normal, but as the objects pile up you start to see the duplicates.
I may just have to refactor the code and move to bmesh for everything. It just sucks, it works perfect in viewport and opengl.
DEBLENDER, thank you very much for taking the time to run the test. At the moment the simulation only moves forward in time, so even if you scrub the timeline backwards every frame change moves the simulation forward in time one step. If you only render one single frame (any frame number) it will look correct. The problem is when you try to render multiple frames for an animation. That’s when the multiple objects start spawning, and so instead of a galaxy in motion it looks kind of like shooting stars.
On that blend if you do this:
Change end frame to 150
run script
render menu (up top) opengl render animation
You get this which is 100% correct
But if you do this:
change end frame to 75
run script
click ‘animation’ button from render tab (render active scene)
You get this, with old objects spawned: still processing…
Maybe I could approach it in a different way. Instead of clicking ‘render animation’ maybe I could just make a render call directly from the script. Is it possible to have a script make a render, finish and write the image to disk, and then continue on with the script?