Exemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     //同オブジェクト内にスクリプトがある前提
     list           = gameObject.GetComponent <MotionList>();
     _chgValue      = new ChangeValueManage();
     ChangeValueLog = string.Empty;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Exports a Motion List Asset
        /// </summary>
        private string ExportMotionList(Package.Entry entry, string name)
        {
            var scale   = float.TryParse(Settings["ModelScale", "1.0"], out var val) ? val : 1.0f;
            var motions = MotionList.Convert(ActivePackage.LoadEntry(entry));

            var path   = name.Split('.')[0];
            var folder = Path.Combine(path, motions.Item1);

            var result = path;

            Directory.CreateDirectory(folder);

            foreach (var motion in motions.Item2)
            {
                var motionPath = Path.Combine(folder, motion.Item1);

                if (Settings["ExportSEAnim", "Yes"] == "Yes")
                {
                    motion.Item2.Scale(scale);
                    motion.Item2.ToSEAnim(motionPath + ".seanim");
                }
            }

            return(result);
        }
Exemplo n.º 3
0
 public VMDFormat(BinaryReader bin, string path, string clip_name)
 {
     try
     {
         this.clip_name = clip_name;
         header         = new Header(bin);
         read_count++;
         motion_list = new MotionList(bin);
         read_count++;
         skin_list = new SkinList(bin);
         read_count++;
         camera_list = new CameraList(bin);
         read_count++;
         light_list = new LightList(bin);
         read_count++;
         self_shadow_list = new SelfShadowList(bin);
         read_count++;
     }
     catch (EndOfStreamException ex)
     {
         Debug.Log((object)ex.Message);
         if (read_count <= 0)
         {
             header = null;
         }
         if (read_count <= 1 || motion_list.motion_count == 0)
         {
             motion_list = null;
         }
         if (read_count <= 2 || skin_list.skin_count == 0)
         {
             skin_list = null;
         }
         if (read_count <= 3 || camera_list.camera_count == 0)
         {
             camera_list = null;
         }
         if (read_count <= 4 || light_list.light_count == 0)
         {
             light_list = null;
         }
         if (read_count <= 5 || self_shadow_list.self_shadow_count == 0)
         {
             self_shadow_list = null;
         }
     }
 }
Exemplo n.º 4
0
 public VMDFormat(BinaryReader bin, string path, string clip_name)
 {
     // 読み込み失敗した場合はだいたいデータがない
     // 失敗しても読み込み続けることがあるので例外でキャッチして残りはnullにしておく
     try {
         this.clip_name        = clip_name;
         this.header           = new MMD.VMD.VMDFormat.Header(bin); read_count++;
         this.motion_list      = new MMD.VMD.VMDFormat.MotionList(bin); read_count++;
         this.skin_list        = new MMD.VMD.VMDFormat.SkinList(bin); read_count++;
         this.camera_list      = new MMD.VMD.VMDFormat.CameraList(bin); read_count++;
         this.light_list       = new MMD.VMD.VMDFormat.LightList(bin); read_count++;
         this.self_shadow_list = new MMD.VMD.VMDFormat.SelfShadowList(bin); read_count++;
     } catch (EndOfStreamException e) {
         Debug.Log(e.Message);
         if (read_count <= 0)
         {
             this.header = null;
         }
         if (read_count <= 1 || this.motion_list.motion_count <= 0)
         {
             this.motion_list = null;
         }
         if (read_count <= 2 || this.skin_list.skin_count <= 0)
         {
             this.skin_list = null;
         }
         if (read_count <= 3 || this.camera_list.camera_count <= 0)
         {
             this.camera_list = null;
         }
         if (read_count <= 4 || this.light_list.light_count <= 0)
         {
             this.light_list = null;
         }
         if (read_count <= 5 || this.self_shadow_list.self_shadow_count <= 0)
         {
             this.self_shadow_list = null;
         }
     }
 }
Exemplo n.º 5
0
			public VMDFormat(BinaryReader bin, string path, string clip_name)
			{
				// 読み込み失敗した場合はだいたいデータがない
				// 失敗しても読み込み続けることがあるので例外でキャッチして残りはnullにしておく
				try {
					this.clip_name = clip_name;
					this.header = new MMD.VMD.VMDFormat.Header(bin); read_count++;
					this.motion_list = new MMD.VMD.VMDFormat.MotionList(bin); read_count++;
					this.skin_list = new MMD.VMD.VMDFormat.SkinList(bin); read_count++;
					this.camera_list = new MMD.VMD.VMDFormat.CameraList(bin); read_count++;
					this.light_list = new MMD.VMD.VMDFormat.LightList(bin); read_count++;
					this.self_shadow_list = new MMD.VMD.VMDFormat.SelfShadowList(bin); read_count++;
				} catch (EndOfStreamException e) {
					Debug.Log(e.Message);
					if (read_count <= 0)
						this.header = null;
					if (read_count <= 1 || this.motion_list.motion_count <= 0)
						this.motion_list = null;
					if (read_count <= 2 || this.skin_list.skin_count <= 0)
						this.skin_list = null;
					if (read_count <= 3 || this.camera_list.camera_count <= 0)
						this.camera_list = null;
					if (read_count <= 4 || this.light_list.light_count <= 0)
						this.light_list = null;
					if (read_count <= 5 || this.self_shadow_list.self_shadow_count <= 0) 
						this.self_shadow_list = null;
				}
			}