Fusion
Fusion copied to clipboard
Parent children in batchable order when possible
Closes #293.
Modifies Fusion.Children's parenting behavior to parent things in a way that works for Roblox's naive greedy drawcall batching whenever reasonably possible. Contains comments for additional context where needed.
This seems mostly fine, but it'd be nice if it were more general and didn't implicitly make assumptions about what classes batch together.
Ideally it'd either be a general rule (i.e. "try and parent objects of the same class type together") or something that's declarative (i.e. "if you encounter classes from this list, put them together"). That'd free up the implementation from having to communicate those details, and makes it more flexible should this problem come up again in the future for new or completely different class types.
I'm going to defer on this for a bit though. I'd like to see if Roblox addresses the underlying issue first, because if we don't end up having to do this, it's less complexity in our codebase. That in turn means we make less promises to users that they expect us to keep, and there are fewer failure modes.
(In the meantime, feel free to distribute this standalone if you'd like! You don't actually have to mod Fusion to do this; you can distribute it as a separate module that just returns your own Children special key)
Unblocking this. It seems like Roblox haven't moved to resolve these issues, so I'd be interested in pursuing this.