# NTU 2023 VFX hw3: Match Move ## 成果影片 https://youtu.be/44yNA5a1mDU ## 影片中增加的模組 * 匯入 sketchfab modules: * 紅:https://sketchfab.com/3d-models/among-us-character-1167417509bd43e0bdfa7e562c20136e * 淺藍:https://sketchfab.com/3d-models/among-us-character-0a7369afec3e461d8f668498e36b7707 * 屍體:https://sketchfab.com/3d-models/among-us-characters-aaa0732208f04f3e8a721b64fec17d7d * 通風管:https://sketchfab.com/3d-models/vent-d6b51c17b0b941d8a24bd21b5936dc72 * 改變人物材質以創造新人物。 ## 實作內容 * 物件在地面的陰影。 * 物件在地面的移動、形變、旋轉。 * 紅:跳出動作(出現、拉伸形變、落地) * 紅:向前走動作 * 淺藍:繞圈走動作(設定 4+1 個角度的 keyframe) * 橘:被砍(兩個物件交互出現、消失) * 刀子揮動(出現、位移、旋轉) * 通風管打開(出現、位移、旋轉) ## 剪輯 * Intro/Outro 影片: 使用 Davinci Resolve 16. * 綠幕: * Imposter: https://youtu.be/249K9AihCek * Outro: https://youtu.be/hPwrzvnCugI * 配音: * 實驗室背景音:https://youtu.be/cRJqNjlKAsM * 通風管:https://youtu.be/pkntudFNuHw * 擊殺:https://youtu.be/34ewE9biJRE * Among us role reveal:https://youtu.be/ekL881PJMjI * Among us dead report:https://youtu.be/w3iKWwJYa7s _________________________________________________________ # Blender 3.5.1 筆記 https://hackmd.io/@BeNordic/Syp1_U0Nn ## 基礎 **插入影片變成png sequence** 1. 開新的 blender > Movie Clip editor > 開啟你的影片 2. 去左上角選擇 Compositor,左上勾選used nodes,右上點選 backdrop. 先刪除所有畫面上的 node 3. 用 add 新增 Input>Movie clip node, Output>Composite node, Output>viewer node並連接他們。 4. 在右下第三個 Output property 選擇符合影片大小的參數、解析度、影片長度(frames) 、影片輸出資料夾位置... 6. render -> render animation **Match Move** 1. 開新的 blender > Movie Clip editor > Open > 按 a 全選 > Open clip。 <br>如果只選到一張,請把檔案在 blender 視窗裡面先做a-z,0-9排序。參考:https://blender.stackexchange.com/questions/166115/video-clip-only-imports-first-image-in-sequence</br> 2. 右邊 track 欄位可調相機參數 3. (重要) 影片拉回 frame 1,選取 persepctive > Normalize > detect features 4. 按鍵盤 a 鍵全選 feature points(重要),按下向後 tracking, 播放查看向後 tracking 結果 5. 到 solve 區塊,勾選 keyframe, 勾選 Refine 的選項(都可嘗試看看),影片拉回 frame 1(重要),按下 solve camera motion. 6. (重要) 看右上角 solve error, 如果不夠小(ex:大於 1) 點選 clip display>info, 看看哪些 feature points 不夠好,不夠好的話要刪去比較爛的 feature points 然後重做一遍 7. 刪除:右鍵點選並刪除 error 特別大的 feature point 8. 新增:回到 track 頁面按下 cmd+左鍵,並重新按下向後 tracking. 9. 點選 setup tracking secne, 鼠標移到左上直到變成十字時,可以拖曳拉出新視窗,在新視窗選擇 3D view,並點一下攝影機 icon 使畫面移到攝影機視角。 10. 回到舊視窗開始定義座標系。按 shift+左鍵選三個 feature points(依序為x, y, origin)作為地板 floor 平面,然後按下 Floor 11. 按 shift+左鍵選兩個 feature points,設定兩者之間的 distance 定義,按 Set Scale 12. 按左鍵選一個 feature points 作為原點 13. 按左鍵選一個 feature points 作為x軸方向 or 選一個 feature points 作為y軸方向 14. 點選 setup tracking scene, 檢查 mesh (新視窗 3D view 裡面那個正方形) 有沒有貼著9.的地板 floor 平面移動。若不滿意則重複6-14. .. https://blenderartists.org/t/why-is-my-render-so-small/1195889 **Output Result:** 1. 去左上角選擇 Compositor,左上勾選used nodes,右上點選 backdrop. 先刪除所有畫面上的 node 2. 用 add 新增 Input>Movie clip, Input>Render Layers, Input>Alpha over, Output>Composite, Output>viewer 並連接他們。 3. Render Layers 記得選 Foreground (或是任何你想 render 的 layer) ## 物件 縮放靜態物件: 按s 縮放平移有 rig 的動態物件: transfrom-> delta transform (?) 新增物件顏色: 1. 點選物件 2. 點右下一排(有可能被隱藏)倒數第二個選項(Material Property),按 New+ 3. Surface>Base color的點點, 點選 Image texture, 點選你要的.png 4. You won’t immediately see any changes to your object. In order to see changes, you’ll have to change the settings in Viewport Shading settings in the upper righthand corner of the 3D Viewport. (去右上四顆球球,點Viewport Shading) https://all3dp.com/2/blender-how-to-add-a-texture/ https://www.youtube.com/watch?v=BmWlM5MadKs ## 陰影 (Light) https://youtu.be/lXJca9D_TRM 1. 創一個跟 floor 一樣位置的plane 2. 右上切換到第四個小圈圈。 3. 建議光源:點光源、100W、半徑1m(不要是0就好) 4, 調光源到喜歡的位置,讓物體看起來像自然光照。 (Shadow catcher) 5. 選取剛剛創的 plane. 6. 點右下第三個 Render properties>Render Engine 選取 cycle, devide=GPU 7. 點右下第三個 Render properties>Flim,點選 transparent. 8. 右下倒數第八個 Object Properties>Visiblilty 勾選 Show in viewpoint, Show in render, shadow catcher; 右下倒數第八個 Object Properties>Visiblilty 勾選 Shadow catcher 9. 右下倒數第八個 Object Properties>Ray visibility,把 Glossy & Diffusion 取消勾選 10. 回去微調光源設定(強度、顏色、半徑等)讓影子顏色更貼近背景 備註:此時若 plane 位置在 0,0,0,且導致整個平面都是黑的,可以把平面z軸上移一點點!(idk why but I tried it and success) (Rendering) 11. 去左上點 Compositor。 12. 左上勾選used nodes,右上點選 backdrop. 先刪除所有畫面上的 node 13. 用 add 新增 Input>Movie clip, Input>Render Layers, Input>Alpha over, Output>Composite, Output>viewer 並連接他們。 14. Render Layers 記得選 Foreground (或是任何你想 render 的 layer) ## 輪廓 (Shader Rendering) https://www.youtube.com/watch?v=G9yPhDLGBuQ 10. 選取剛剛創的 plane. 11. 去左上點 Shader Editor,點上方的 New 方格。 12. 新增:去偏左上點(or 空白處按右鍵)點選 add>shader>mix shader 13. 把 mix shader node input 接 Principle BSDF output; output 接 Material output. 14. 新增:去偏左上點(or 空白處按右鍵)點選 add>shader>transparent BSDF 15. 把 transparent BSDF output 接 mix shader node 第二個 input 16. 新增:去偏左上點(or 空白處按右鍵)點選 add>input>light path 17. 把 light path 的 is_camera_ray output 接 mix shader node Fac input. 17. 在 Material output node 選擇 cycle. ## 動畫 Imported from Blender, disappears when animation plays https://forums.unrealengine.com/t/imported-from-blender-disappears-when-animation-plays/ **Loop animation: cycle** 1. 選取整個物件(包含 rig,建議用右上點選),去左上 Graph editor 2. Select the keyframes that you wish to loop over (over their respective time period) (optional?) 3. 左上 key>Add F-Curve Modifier>Cycle. **Clean cycle:** Shift E > Clear Cyclic https://blender.stackexchange.com/questions/264549/how-to-remove-f-curve-cycle **Repeat animation:** https://www.youtube.com/watch?v=KgPDe2GoiRY 1. 選取整個物件(包含 rig,建議用右上點選),去左上 Graph editor 2. shift 選取相對應動作 channel,不需要的先隱藏 3. 複製下方bar的 keyframe 直到你想停止為止。 **改變動作時間** 1. 選取整個物件(包含 rig,建議用右上點選),去左上 Graph editor 2. shift 選取相對應動作 channel,不需要的先隱藏 3. 框住下方bar的 keyframe並拉到你想拉的時間 **改變visibility時間** https://www.youtube.com/watch?v=MXnFwR7kZPg 1. 選取整個物件(包含 rig,建議用右上點選),去左上 Graph editor 2. 左下倒數第六個 Object properties>Visibility 3. 先勾選 View points and/or renders 設定 4. 再點選 View points and renders 旁邊的小點,設定 keyframe (可以在 Group editor 發現多2個 channel) 5. 去其他 frame,重複34 **如何做平移的動畫:** https://www.youtube.com/watch?v=HPD3LhCLxCE 1. 選取整個物件(包含 rig,建議用右上點選)拖曳到 frame 0 ,右鍵>Insert Keyframe. 點選 Location. 2. 拖曳到不同的 frame 3. 右上,右鍵點 camera icon > Insert Keyframe , 並同時按下 i 設定 keyframe. 4. 重複3. 在其他 frame 設定 Keyframe 3. Press n > 3dview,更改整個物件的位置 4. 重複1. 在該 frame 設定 Keyframe. **如何做原地旋轉的動畫:** 1. 設定5個時間的keyframe 2. 把xy軸設好對稱數值之關係,並把5個時間的keyframe z角度各自設為0,90.180.270,360. 3. 設定 delta transform 把物件平移到畫面想要的地方。 4. 設定 Loop animation. **如何做跳出的動畫:** https://www.youtube.com/watch?v=KgPDe2GoiRY 1. 先設定跳起、降落的keyframe。 2. 再設定跳到最高點前、降落前的keyframe,設定形變讓動作更流暢。 **平移所有 keyframes 位置** 1. 選取整個物件(包含 rig,建議用右上點選) 2. 用 delta transform (左下倒數第六個 Object properties>transform 的下面) **修改所有 keyframes scale** 1. 選取整個物件(包含 rig,建議用右上點選) 2. 按下s. 直接移動鼠標做縮放 3. 確定後按下左鍵。 **改變物體移動曲線:** 1. 選取該 channel 2. 框取該 channel 內 keyframe 3. 右鍵>Handle Type>(自選一下) ## 其他 **移動視角** - Rotate Mouse: Middle mouse drag Trackpad: Move with two fingers - Pan Mouse: Shift + middle mouse drag Trackpad: Shift + move with two fingers - Zoom Mouse: Roll mouse scroll wheel up and down Trackpad: Pinch or expand with two fingers **移動相機到你目前的視角** Edit -> Preferences -> KeyMap 搜尋 camera, 自訂 Align camera to view 的 hot key(建議option+cmd+0)(因為 mac book 沒有 numpad 0所以需要自訂) 之後選取相機,瘋狂按快捷 :) https://blender.stackexchange.com/questions/128118/camera-shortcut-keys-for-mac-keyboard **加速Rendering:** 1. Edit>Preferences, go to System. 2. Under Cycles Render Devices, check CUDA or OptiX https://renderpool.net/blog/speed-up-cycles-rendering-with-these-5-easy-settings-tweaks/ 3. Cycle 的 sample point 要減少。 **合併物件** 偏左上點 object>join https://www.makeuseof.com/merge-objects-in-blender/ **解除合併物件** 偏左上點 object>join **Compositor node zoom in:** command+2指下滑 **關閉視窗:** 左上右鍵>close area Separate XYZ and Combine XYZ **開啟 timeline bar:** 鼠標移到左上直到變成十字時,可以拖曳拉出新視窗,在新視窗選擇 timeline https://blender.stackexchange.com/questions/36239/how-to-open-a-timeline-window **Camera Viewscreen:** https://blenderartists.org/t/how-to-i-make-the-camera-view-full-screen/1162697/6 **Render 畫面和 Compositor 不一致 or 完全沒有更新你的更改:** 去右下第二個 Render properties>Post processing 把 Compositing & Sequencer 打勾! https://docs.blender.org/manual/en/2.79/render/post_process/panel.html **Preview render layer node:** 在做任何有關 render 設定更改時,如果想要預覽更動,一定要記得點一下右下角刷新。 https://blender.stackexchange.com/questions/227036/rendered-image-in-viewport-not-showing-in-compositing-tab **Camera 畫面 Movie clip 超小** https://blenderartists.org/t/why-is-my-render-so-small/1195889 **Render 畫面沒有出現你的 Movie clip** 記得 background 要設到跟 camera view 差不多大? 建議: 先確定平面不會亂飄 再來插入3D物件做操作