/// <summary>
        /// WeightTable의 값과 연동을 하고 Sort를 한다.
        /// </summary>
        /// <param name="portrait"></param>
        public void LinkWeightPair(apPortrait portrait)
        {
            _totalWeight = 0.0f;
            WeightPair weightPair  = null;
            bool       isAnyRemove = false;

            for (int i = 0; i < _weightPairs.Count; i++)
            {
                weightPair = _weightPairs[i];
                if (weightPair._meshGroupID >= 0)
                {
                    weightPair._meshGroup = portrait.GetMeshGroup(weightPair._meshGroupID);
                    if (weightPair._meshGroup != null)
                    {
                        //<BONE_EDIT>
                        //weightPair._bone = weightPair._meshGroup.GetBone(weightPair._boneID);

                        //>>Recursive로 변경
                        weightPair._bone = weightPair._meshGroup.GetBoneRecursive(weightPair._boneID);
                        if (weightPair._bone == null)
                        {
                            isAnyRemove = true;
                            //Debug.LogError("Bone Weight가 없어졌다. Rigging 해제됨");
                        }
                        else
                        {
                            _totalWeight += weightPair._weight;
                        }
                    }
                    else
                    {
                        weightPair._bone = null;
                        isAnyRemove      = true;
                    }
                }
                else
                {
                    weightPair._meshGroup = null;
                    weightPair._bone      = null;
                    isAnyRemove           = true;
                }
            }
            if (isAnyRemove)
            {
                //뭔가 삭제할게 생겼다. 삭제하자
                _weightPairs.RemoveAll(delegate(WeightPair a)
                {
                    return(a._meshGroup == null || a._bone == null);
                });
            }
        }
        public void LinkEditor(apPortrait portrait)
        {
            _portrait        = portrait;
            _targetMeshGroup = _portrait.GetMeshGroup(_targetMeshGroupID);


            //ID를 등록해주자
            //_portrait.RegistUniqueID_AnimClip(_uniqueID);
            _portrait.RegistUniqueID(apIDManager.TARGET.AnimClip, _uniqueID);

            //TODO : 멤버 추가시 값을 추가하자
            for (int i = 0; i < _timelines.Count; i++)
            {
                _timelines[i].Link(this);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// WeightTable의 값과 연동을 하고 Sort를 한다.
        /// </summary>
        /// <param name="portrait"></param>
        public void LinkWeightPair(apPortrait portrait)
        {
            _totalWeight = 0.0f;
            WeightPair weightPair  = null;
            bool       isAnyRemove = false;

            for (int i = 0; i < _weightPairs.Count; i++)
            {
                weightPair = _weightPairs[i];
                if (weightPair._meshGroupID >= 0)
                {
                    weightPair._meshGroup = portrait.GetMeshGroup(weightPair._meshGroupID);
                    if (weightPair._meshGroup != null)
                    {
                        weightPair._bone = weightPair._meshGroup.GetBone(weightPair._boneID);
                        if (weightPair._bone == null)
                        {
                            isAnyRemove = true;
                        }
                        else
                        {
                            _totalWeight += weightPair._weight;
                        }
                    }
                    else
                    {
                        weightPair._bone = null;
                        isAnyRemove      = true;
                    }
                }
                else
                {
                    weightPair._meshGroup = null;
                    weightPair._bone      = null;
                    isAnyRemove           = true;
                }
            }
            if (isAnyRemove)
            {
                //뭔가 삭제할게 생겼다. 삭제하자
                _weightPairs.RemoveAll(delegate(WeightPair a)
                {
                    return(a._meshGroup == null || a._bone == null);
                });
            }
        }
Ejemplo n.º 4
0
        public void LinkEditor(apPortrait portrait)
        {
            _portrait        = portrait;
            _targetMeshGroup = _portrait.GetMeshGroup(_targetMeshGroupID);


            //ID를 등록해주자
            //_portrait.RegistUniqueID_AnimClip(_uniqueID);
            _portrait.RegistUniqueID(apIDManager.TARGET.AnimClip, _uniqueID);

            //v1.1.7 버그 수정
            if (_endFrame <= _startFrame)
            {
                UnityEngine.Debug.LogError("AnyPortrait : End Frame of Animation Clip [" + _name + "] is not set up normally. End Frame is changed from " + _endFrame + " to " + (_startFrame + 1) + ".\nThis action is temporary, so please modify the frame settings of this Animation Clip.");
                _endFrame = _startFrame + 1;
            }

            //TODO : 멤버 추가시 값을 추가하자
            for (int i = 0; i < _timelines.Count; i++)
            {
                _timelines[i].Link(this);
            }
        }