Open DrakeGator opened 10 months ago
Thanks mate, your suggestion to comment out the code, boosted performance on my machine too. Thank you for sharing that!
This whole section seems to be commentable out, and just looks like orphaned data. In 4.3 this section also breaks collisions outright because you can no longer assign embedded id pointers to properties.
Blender version: 4.0.2
I was having some serious framerate drops in the viewport from 60FPS to 5FPS in a very small scene with only a half dozen very low-poly colliding meshes and I eventually narrowed it down to using the "collection" type of collision. I went digging in the code for it, commenting things out until the performance drop stopped, and it's this code that's causing the issue:
https://github.com/shteeve3d/blender-wiggle-2/blob/b95c560f5713a3c66b3edf786a1470b4d86cd4c3/wiggle_2.py#L474-L486
It's specifically this line:
which, if I comment it out, the performance issues disappear, and the collision still works fine.
tbh I'm not sure what it's supposed to be doing. The only case in which this line is run is when
b.wiggle_collider_collection
is notNone
, and it re-sets it to - as far as I can tell - the same collection that it was already pointing to.I have no idea why this is slowing things down so much but it doesn't seem to be doing anything useful, but I don't know the Blender API too well so maybe this is working around some issue that I'm unaware of...?
More generally this block of code is strange. The
collision_col
property is never used outside of this code, and every case other than the firstif
has no effect (they usebpy.data.collections/objects.get
but don't assign the result anywhere). It seems like this was added in this commit and was never changed afterwards. Temporary code that never got removed?