forked from terrysimons/spine-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSkeletonData.py
More file actions
50 lines (38 loc) · 1.26 KB
/
SkeletonData.py
File metadata and controls
50 lines (38 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
class SkeletonData(object):
def __init__(self):
super(SkeletonData, self).__init__()
self.bones = []
self.slots = []
self.skins = []
self.animations = []
self.defaultSkin = None
def findBone(self, boneName):
for i, bone in enumerate(self.bones):
if bone.name == boneName:
return bone
return None
def findBoneIndex(self, boneName):
for i, bone in enumerate(self.bones):
if bone.name == boneName:
return i
return -1
def findSlot(self, slotName):
for i, slot in enumerate(self.slots):
if slot.name == slotName:
return slot
return None
def findSlotIndex(self, slotName):
for i, slot in enumerate(self.slots):
if slot.name == slotName:
return i
return -1
def findSkin(self, skinName):
for i, skin in enumerate(self.skins):
if skin.name == skinName:
return skin
return None
def findAnimation(self, animationName):
for i, animation in enumerate(self.animations):
if animation.name == animationName:
return animation
return None