예제 #1
0
        public static void MergeFrame(xxFrame oldFrame, xxFrame newFrame)
        {
            for (int i = oldFrame.Count - 1; i >= 0; i--)
            {
                xxFrame oldChild = oldFrame[i];
                xxFrame newChild = null;
                for (int j = 0; j < newFrame.Count; j++)
                {
                    if (oldChild.Name == newFrame[j].Name)
                    {
                        newChild = newFrame[j];
                        break;
                    }
                }

                if (newChild == null)
                {
                    newFrame.InsertChild(0, oldChild.Clone(true, true));
                }
                else
                {
                    if ((newChild.Mesh == null) && (oldChild.Mesh != null))
                    {
                        newChild.Mesh   = oldChild.Mesh.Clone(true, true, true);
                        newChild.Bounds = oldChild.Bounds;
                    }
                    CopyUnknowns(oldChild, newChild);

                    MergeFrame(oldChild, newChild);
                }
            }
        }
예제 #2
0
        public void MergeFrame(xxFrame srcFrame, int srcFormat, int destParentId, int meshMatOffset)
        {
            var newFrame = srcFrame.Clone(true, true);

            xx.ConvertFormat(newFrame, srcFormat, Parser.Format);
            MeshMatOffset(newFrame, meshMatOffset);

            MergeFrame(newFrame, destParentId);
        }
예제 #3
0
파일: xxEditor.cs 프로젝트: kkdevs/sb3u
        public void MergeFrame(xxFrame srcFrame, int srcFormat, List <xxMaterial> srcMaterials, List <xxTexture> srcTextures, bool appendIfMissing, int destParentId)
        {
            int[] matTranslation = CreateMaterialTranslation(srcMaterials, srcFormat, srcTextures, appendIfMissing);
            var   newFrame       = srcFrame.Clone(true, true, matTranslation);

            xx.ConvertFormat(newFrame, srcFormat, Parser.Format);

            MergeFrame(newFrame, destParentId);
        }