Comments (10)
every node in all node trees is executed on everyframe..
you cannot 'unconnect' a node tree
You mean that the slowdown happens when you change the node tree or when you playback the animation?
from animation_nodes.
I mean when things going like this:
From the trees I've tested, it happens when changing on node setup at least. About the playback speed, I didn't get a very complex setup to test so far.
from animation_nodes.
Hm okay.
Can you estimate the total amount of nodes?
I have some ideas how to speed up those things but I don't know if it helps much when you have so many node trees
I can check that tomorrow
from animation_nodes.
Sure, I'll try. Btw, I tested with my timer_v3.blend file so far. When playing back the default scene, it's about 27 fps, which went down to 11 after simply duplicating the node tree for 100 times then changing some link or adding some new node (It also happens even when the Text Ouput node is removed bedore duplicating).
However, after toggling off the Scene Update checkbox, it works fine as before. So, I bet this is kinda trick, or, things have to be working like that?
EDIT:
The Scene Update toggle only speed up the playback fps. Operations on node setups, such as linking / unlinking / adding / removting nodes, switching nodes operations (switching from math operations list for example), become relatively slow. (chaning values and toggles are fine, however)
from animation_nodes.
ah now I know exactly what you are talking about :)
(duplicating 100 times is a lot, I hope nobody will ever have such a huge node setup :D )
I will try to explain whats going on in the background. maybe I will write a small documentation about that later.
The execution progress is separated into two parts:
- build python scripts from the animation node trees and compile these
- execute the compiled python scripts
The first part runs everytime you change the node tree (linking, adding, etc + when a node says that the python scripts should be updated (as the math node does))
https://github.com/JacquesLucke/animation-nodes/blob/master/nodes/number/mn_float_math.py#L19
The generation of the python scripts is one of the core parts I wrote for this addon.
Everything for this happens here: https://github.com/JacquesLucke/animation-nodes/blob/master/mn_network_code_generator.py
this is also the place where I will speed up this process
To see the generated python scripts you have to open the console (Window ->Toogle System Console) and click on Print Node Tree Code in the developer panel.
You can see there that the selected math operation changes the script, because it is very optimised with the so called in-line-execution where a node writes code instead of executing the operation in the execute function.
Whenever you change the frame or a property or the scene updates (yes, these are the 3 checkboxes) this script is executed.
The reason why I separated this progress is because I think that the playback speed is much more important than time it takes when you change the node tree.
the scene updates around 30 times per second (I didn't count that). So when you playback your animation the script is executed on every frame change ( 25 fps) + these scene updates.
It may be a good idea to not execute the script when the scene updates while you playback the animation. Will see if that works.
I hope that was understandable and maybe you found that even interesting :)
btw: you can also print the time it takes to execute all generated python scripts by checking Print Update Time in the developer panel.
The average execution time of your timer is 0.00015 s -> 6700 fps
There is no other way I can think of to have such a fast execution time, although this is only a python script and not C-code or so
from animation_nodes.
Yeah, I know 100 trees would be hardly possible practically, just want to make things more clear by extremity. :P
And thank you so much for such a comprehensive explanation! Now I get it more than before. :)
from animation_nodes.
haha yes. I tested you extrem example myself now :)
I just started searching where the slow parts are
from animation_nodes.
399dae8
so small things -.- with such a huge impact on the performance
from animation_nodes.
Yeah, it seems faster indeed! 👍
from animation_nodes.
reroute nodes dramatically decrease the performance...
this is the speedup of the last 45 min: 0.6578s -> 0.1399s
from animation_nodes.
Related Issues (20)
- Python version mismatch, Blender 4.1a HOT 2
- Windows compile error: LINK : fatal error LNK1181: cannot open input file 'FastNoiseSIMD_windows.lib' HOT 2
- Distribute Linear on Scene Change keeps triggering the Node Tree
- Mesh execution problem in Blender 4.0.2 HOT 2
- Proper socket is missing for a new input to Expression node HOT 3
- Animation Nodes for Python 3.10 ? HOT 2
- Build to python 3.10.12 HOT 1
- failed to enable the addon HOT 1
- Python Version Mismatch HOT 1
- mac blender 4.0.1 install failled HOT 1
- failed with exit code 1104 link.exe HOT 8
- Can someone create build with python 3.10.13?
- Real instances problem
- Python version mismatch HOT 1
- Mesh object output error HOT 5
- Can't install Animation Nodes in Blender 4.0.2 HOT 5
- Animation nodes do not update in viewport when linked with Geo Nodes HOT 1
- Upgrading Code HOT 4
- Ctrl+A Typing will cause instant Crash HOT 7
- Python version mismatch (Blender 4.1.1) HOT 3
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 animation_nodes.