我有两个皮肤,无论我切换为哪个皮肤,绘制顺序都会显示所有的插槽,无论当前皮肤有没有在使用该插槽,这将在皮肤众多时不易维护,如何能过滤出当前皮肤正在使用的插槽
如何隐藏绘制顺序列表中当前皮肤未使用的插槽
All slots are shown because the entire list of slots that makes up the draw order must be defined regardless of what skins are currently visible.
It's somewhat abnormal to have slots that are only used in one skin. A slot like hair-front
is likely relevant for multiple skins.
You can use folders (in 4.2+) to organize your slots, but I still don't recommend using slots specific to a single skin unless absolutely necessary.
Nate 我们有这么一种情况,不同角色的相同局部部位的插槽绘制顺序不同,比如A角色是脚优先于小腿先进行绘制,而B角色是小腿优先于脚先进行绘制,当然还有其他的情况。所以无法简单的在不同皮肤中替换插槽的附件,这样会导致A的绘制顺序对了,而B的绘制顺序错了,无法做到相同插槽的绘制顺序因为不同皮肤而定制差异化。以及某些角色有一些特定的附件,只属于该角色,这就意味着我们需要为该角色单独分配插槽,但是切换为其他角色时,不属于当前角色的插槽仍然会在绘制列表中起到混淆的情况。
Slots are used to group attachments where only one item in the group is visible at once. This allows you to have a draw order list of slots that is much shorter than if you had a draw order list of ALL attachments. Creating a slot per attachment defeats the purpose of slots.
It does make sense to add slots when a skin requires it. Ideally it's still done in a generic way that could be useful to other skins, like calf-over-feet
and calf-under-feet
rather than elf-calf
. Some slots may be better as belt-item
so they can be used by multiple skins rather than elf-belt-dagger
. When it's absolutely required to have a slot that no other skin will ever use AND another slot can't be repurposed, only then would you name it something specific to a skin.
A slot has no notion of position. They important aspects of a slot is which bone it is under and where it is in the draw order. Therefore if a slot is on the right bone and in the draw order where you need it, then you can use it for any attachment. It may make sense in a highly customizable skeleton that contains skins for many characters to have slots like belt1
, belt2
, etc. You may want to name some slots based on draw order like belt-under-shirt
. A skin could use these for any attachments on the belt
bone, without needing a slot for each skin attachment.
The entire draw order must be valid at any given time. If we hide some slots in the draw order, those slots still exist and still need to have their position in the draw order defined. If you change the draw order, the slots you can't see likely get left in some draw order position that doesn't make sense. This doesn't seem very good. It is better to see and think about the slots that other skins use, unless you are making animations that are really only for one skin.
Using folders (in 4.2+) you can group your slots based on how you plan to make draw order changes. This might be by limb/hand/foot/weapon/etc. If you have many slots because you have many skins that need them, this reduces the number of other slots you need to think about at once. Folders coupled with using fewer slots as described above should make the draw order manageable.
Nate 感谢指点,之前我们的做法有点太粗暴了,在您的帮助下,我们的项目正在变得越来越规范以及更加容易维护,太棒了
I'm glad this was helpful! It's smart to work out the best way to do these things at the beginning, before a project gets large and it becomes hard to change.