UE4

来自CGTWiki
跳转至:导航搜索

UE4主要分为两个方向,技术美术和C++方向。

UE4嵌入视频

官方资源

视频资源

技术博客

FBX文件的导入

Fbx导入


UE4嵌入winform

namespace testUE4
{
    public partial class Form1 : Form
    {
        private Process process;
        [DllImport("User32.dll")]
        static extern bool MoveWindow(IntPtr handle, int x, int y, int width, int height, bool redraw);

        internal delegate int WindowEnumProc(IntPtr hwnd, IntPtr lparam);
        [DllImport("user32.dll")]
        internal static extern bool EnumChildWindows(IntPtr hwnd, WindowEnumProc func, IntPtr lParam);

        [DllImport("user32.dll")]
        static extern int SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);

        [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
        static extern IntPtr FindWindow(string strClass, string strWindow);

        [DllImport("user32.dll", SetLastError = true)]
        private static extern long SetParent(IntPtr hWndChild, IntPtr hWndNewParent);

        private IntPtr UE4HANDLE = IntPtr.Zero;
        private const int WM_ACTIVATE = 0x0006;
        private readonly IntPtr WA_ACTIVE = new IntPtr(1);
        private readonly IntPtr WA_INACTIVE = new IntPtr(0);

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
         

           
        }

        private void PictureBox1_SizeChanged(object sender, EventArgs e)
        {
            MoveWindow(UE4HANDLE, 0, 0, this.pictureBox1.Width, this.pictureBox1.Height, true);
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {
            process = new Process();
            string filepath = @"D:\unreal engine\BLPRINT\bin\WindowsNoEditor\BLPRINT.exe";
            process.StartInfo.FileName = filepath;
            process.StartInfo.Arguments = "-parentHWND " + this.Handle.ToInt64() + " " + Environment.CommandLine;
            process.StartInfo.UseShellExecute = false;
            process.StartInfo.CreateNoWindow = true;
            process.Start();
            process.WaitForInputIdle(10000);
            UE4HANDLE = FindWindow("UnrealWindow", "BLPRINT  ");
            SetParent(UE4HANDLE, this.pictureBox1.Handle);

            MoveWindow(UE4HANDLE, 0, 0, this.pictureBox1.Width, this.pictureBox1.Height, true);
            pictureBox1.SizeChanged += PictureBox1_SizeChanged;

        }
    }
}

可运行程序

文件:WinfomUE4.7z

动画混合

动画混合的两种模式:(1)混合空间 (2)动画蒙太奇 10分钟学会ue4动画

播放动画的两种方式

按键直接播放蒙太奇

  1. 首先建立一个空的pawn
  2. 在pawn下面建立Skeletal Mesh Component,并赋予相应的mesh和骨骼
  3. 建立一个蒙太奇动画
  4. 在关卡蓝图中直接调用蒙太奇

使用蒙太奇播放动画

  • 动画蒙太奇在开始调用时会出现自动插帧,所以不用担心不连贯。

使用按键播放资源动画

按键直接播放动画序列 获取Actor播放动画.

骨架绑定

角色换肤