//This only modifies vertices after ApplyCHR0 has weighted them.
        //It cannot be used without calling ApplyCHR0 first.
        public void ApplySHP(SHP0Node node, int index)
        {
            _currentSHP = node;
            _currentSHPIndex = index;

            if (node == null || index == 0)
                return;

            SHP0EntryNode n;

            if (_objList != null)
                foreach (MDL0ObjectNode poly in _objList)
                    if ((n = node.FindChild(poly.VertexNode, true) as SHP0EntryNode) != null)
                    {
                        //Max amount of morphs allowed is 32
                        float[] weights = new float[n.Children.Count];
                        MDL0VertexNode[] nodes = new MDL0VertexNode[n.Children.Count];

                        foreach (SHP0VertexSetNode v in n.Children)
                        {
                            MDL0VertexNode vNode = null;
                            foreach (MDL0VertexNode vn in _vertList)
                                if (vn.Name == v.Name)
                                { vNode = vn; break; }

                            weights[v.Index] = vNode != null ? v.Keyframes.GetFrameValue(index - 1, SHP0VertexSetNode._linear) : 0;
                            nodes[v.Index] = vNode;
                        }

                        float totalWeight = 0;
                        foreach (float f in weights)
                            totalWeight += f;

                        float baseWeight = 1.0f - totalWeight;

                        //Calculate barycenter per vertex and set as weighted pos
                        for (int i = 0; i < poly._manager._vertices.Count; i++)
                        {
                            int x = 0;
                            Vertex3 v3 = poly._manager._vertices[i];
                            v3._weightedPosition *= baseWeight;

                            foreach (MDL0VertexNode vNode in nodes)
                                if (vNode != null)
                                    v3._weightedPosition += (v3.GetMatrix() * vNode.Vertices[v3._facepoints[0]._vertexIndex]) * weights[x++];

                            v3._weightedPosition /= (totalWeight + baseWeight);

                            v3.weights = weights;
                            v3.nodes = nodes;
                            v3.baseWeight = baseWeight;
                            v3.bCenter = v3._weightedPosition;
                        }
                    }
        }