-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfbx.go
More file actions
37 lines (29 loc) · 678 Bytes
/
fbx.go
File metadata and controls
37 lines (29 loc) · 678 Bytes
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
package main
type FBX struct {
Header *Header
Top *Node
Nodes []*Node
}
// func (f *FBX) Filter(filter NodeFilter) (nodes []*Node) {
// for _, node := range f.Nodes {
// subNodes := node.Filter(filter)
// nodes = append(nodes, subNodes...)
// }
// return
// }
// GetNodes attempts to find a node from those contained in the fbx
func (f FBX) GetNodes(names ...string) []*Node {
if len(names) == 0 {
return nil
}
nodes := []*Node{}
if f.Top.Name == names[0] {
nodes = append(nodes, f.Top.GetNodes(names[1:]...)...)
}
for _, n := range f.Nodes {
if n.Name == names[0] {
nodes = append(nodes, n.GetNodes(names[1:]...)...)
}
}
return nodes
}