In general please consider whether splitting a single skeleton into roughly 40 parts is really necessary, as it might lead to a lot of overhead, lots of additional draw calls for a single skeleton (unless they are all reduced by batching later).
meanwhile How can I rename these parts according to the bone names listed in the separator slot names section?
Note that draw order, slot visibility and skin-bones might change separation at any frame during playback, there is no guarantee for constant parts renderer order here.
Imagine having the following draw order with separator slots S1, S2, S3:
A
S1
B
S2
C
S3
D
The 4 parts will be:
[A, S1]
part 1
[B, S2]
part 2
[C, S3]
part 3
[D]
part 4
Compare it to:
A
B
S2
C
S1
D
S3
The three parts will be:
[A, B, S2]
part 1
[C, S1]
part 2
[D, S3]
part 3
Note that the parts count has changed from 4 to 3, and part 1 is now split by S2 instead of S1 (would be renamed in your use-case). The SkeletonRenderer
component constantly updates the parts renderers accordingly, which might mess with your renaming setup.
If you have a special use-case and ensure that draw order and slot visibility never changes, you might want to either write your own SkeletonRenderSeparator
subclass, or modify the spine-unity source code according to your needs.