- attached J3S97FGT2_7QRCSYB0BW9.png
When I draw AnimationCurve Property with odin, A lot of gc is generated, It's 100mb or more
When I draw AnimationCurve Property with odin, A lot of gc is generated, It's 100mb or more, use [DrawWithUnity] is the same, but unity default draw is ok
I just create a AnimationCurve field
Comments (7)
-
reporter -
-
assigned issue to
-
assigned issue to
-
- changed status to open
-
- changed status to wontfix
This is a bit of an unfortunate, but unavoidable fact of life. Unity’s animation curve drawing has access to native internal structures. Odin, meanwhile, must use the public animation curve API that Unity provides in order to do its job, and this API allocates a lot of extra data. Thus, if you have an enormous curve, a lot of stuff will be allocated, since Unity’s API is so wildly inefficient and does not give us direct access to the inspected data, but passes us complete new copies of everything whenever we ask for it. As such, we can’t really fix this issue, I’m afraid. Or at least, we cannot fix it without introducing a lot of bugs and limitations to Odin's drawing and handling of animation curves.
-
I suggest that, for the types that contain such massive curves, you disable Odin drawing entirely in the preferences > editor types window.
-
reporter @Tor Esa Vestergaard I got it, Thank you very much
-
hi @Tor Esa Vestergaard , i stumbled upon the same thing and i understand it’s not possible to draw AnimationCurves without those allocations. i added
[HideInPlayMode
because it only really is a problem in playmode (regular 500ms freezes). but this does not help either. is there a way to actually skip the performance heavy part if the drawer is hidden? - Log in to comment