PavelBlend / blender-molecular

molecular addon for blender
27 stars 7 forks source link

Increase work speed #21

Open PavelBlend opened 2 months ago

PavelBlend commented 2 months ago

@OmidGhotbi Hello. I tried to rewrite the code to make it run faster. I wanted to make sure that all substeps are calculated without using blender. I want to export particles to the core once per frame. And once per frame, collect information about particles from the core. This will allow you to calculate all substeps without long "conversations" with blender. But I couldn't do it. All my particles fly away at great speed. I used the formula.

new_position = delta_time * velocity + old_position

Can you suggest or do this behavior? If you need help with python code, I can help. But if you need help with the C code, I won’t be able to tell you.

OmidGhotbi commented 2 months ago

can you tell me which part of the code you are trying to modify, I believe you modified the code as you did in saving the cache? the best way we can work on it to create a sub-branch in Git Hub and share the code so we can work on it together. I'm not sure if in this current state of code, it is possible as the code use blender physics and collision. so both of us have access to the same code and we're able to work on it together. Or perhaps, it's best that we create a brand new GitHub repo for it, your choice. if we make it work without UI we can then run it in a separate thread as well. and make it much faster.

OmidGhotbi commented 2 months ago

If you are serious about improving the speed I can rewrite the code I C++ so we can move to TBB and OneApi instead of openMP. I can manage C++ code and you do the Python side. If we agree on this we need a new Repo for it. let me know your decision.

PavelBlend commented 2 months ago

I wanted to improve the code from this repository. It will take less time and effort. I wanted to rewrite the code slightly.

OmidGhotbi commented 2 months ago

ok, so what part of the code do you try to modify so far? i need to see the block of the code you try to modify to tell you more about it.