I have the sorting like this:
objects.sort(key=lambda x: x.name.upper(), reverse=False)
.upper() because blender’s sort is case-insensitive. But in the same time non-Latin sorting is case-sensitive, so I get wrong sorting with
.upper() in non-Latin object names:
Other nasty thing that Blender uses case-sensitive when sorts name.00x things:
which makes sorting even more painful!
How it is supposed to sort objects to match them with Blender’s internal sorting?
I don’t know the answer. But I do have a general remark:
Why do you want to do that? Maybe you can state the actual problem you’re trying to solve and someone can give you a better way do do it.
Relying on the internal sorting order to be the same across versions seems brittle/bug-prone to me.
I want to pass correct index into Points on instances node
One workaround that I can think of is naming the objects in your collection smartly. name them 0001road 0002road 0003road or something like that. That way you force the sorting order.