Blender: Difference between revisions

From Bitpost wiki
Line 77: Line 77:
* You can also invert-select to select all BUT what you click
* You can also invert-select to select all BUT what you click
* You can also x-ray select to get occluded object vertices
* You can also x-ray select to get occluded object vertices
* "Follow the path" extended ring/line select: Alt-Sh-lclick an EDGE


=== Mesh/bridge two objects together ===
=== Mesh/bridge two objects together ===

Revision as of 20:57, 16 June 2021

Blender IS FUCKING LIT. But deep as hell.

Installation

Best to get a direct download from here and unzip it into apps:

cd ~/apps
tar -xf blender-2.92.0-linux64.tar.xz 
ln -s blender-2.92.0-linux64 blender
~/apps/blender/blender&

You can do that for multiple versions of blender.

It's pretty lazy to use apt in Ubuntu, you'll more than likely get an older version, but maybe this helped with dependencies? I didn't uninstall it to find out:

sudo apt install blender

Bah it starts as the default, so I'm going to remove it.

Configuration

3dconnexion mouse

Use this driver:

[~/app] git clone https://github.com/FreeSpacenav/spacenavd.git
cd spacenavd && ./configure && make && sudo make install # to install to /usr/local

Then set up a systemd service:

cp contrib/systemd/spacenavd.service ~/config/etc/systemd/system/
setup_stow.sh
sudo systemctl enable --now spacenavd

Configure using this excellent video.

  • Make sure you have at least version 2.92 so you have access to needed NDOF settings.
  • Edit > Preferences > Input > NDOF
  • Pan 4.0, Orbit 4.0, Dead 0.0
  • Nav Free, Rotation Turntable
  • Invert zoom OFF, also turn off all Invert Axis Pan and Orbit
    • WAIT, I really like to turn invert ON for Orbit Y

Plugins

Download zips for these plugins from the Tutorial above:

Find them here:

/spiceflow/bitpost/softraid/software/apps/blender/plugins

Custom keybinding

Blender lets you right-click ANY setting checkbox and assign a key, holy hell how cool. See functionality-specific keys lists for my customizations.

If you need to remove any conflicts:

  • Edit > Preferences > Keymap > Key binding > Name tab > search: File context or whatever > uncheck

Object Modeling

To get basics going, work through this excellent video, which includes the best plugins to grab out of the box.

this one is super-precise about what you need to GET SHIT DONE. Nice.

Object center

  • To set an object's origin to its center:
select the object > rclick > Set Origin > Origin to Geometry
  • To move an object to the world center:
select object > open sideways-right-bar Item menu > Transform > Location > set to 0,0,0

Object rotate pan zoom

  • Left-click an object, numeric . to center on it
  • Use spacemouse to rotate objects - see tutorials on config, default is f8xxed
  • R key + mouse to rotate around center
  • G key + mouse to move on x-y plane
  • mousewheel to zoom; use Perspective mode to zoom inside objects
  • mhold to rotate
  • Sh+mhold to pan

Face/edge/vertice selection

  • TAB Hit tab to toggle object/edit modes
  • 1 2 3 Once in edit mode, use 1 (vertex) 2 (edge) 3 (face) selection modes
  • Shift-click to add to selection
  • Drag rectangle to group-select
  • You can also invert-select to select all BUT what you click
  • You can also x-ray select to get occluded object vertices
  • "Follow the path" extended ring/line select: Alt-Sh-lclick an EDGE

Mesh/bridge two objects together

You will be creating a "web" of new polygons between them (without changing source objects).

  • Object mode > Select both objects > press Ctrl-J to join them
  • Pick the vertices on BOTH OBJECTS that you want to mesh/bridge together
    • To select an entire RING of vertexes, Edit mode > Alt-Sh-lclick on an EDGE and you'll get the edge +++!
  • Alt-F to create the mesh! Awesome power. May not be perfect!

Object modeling keys

  • Space - top menu
  • Sh+A - add new mesh menu
  • rclick - object menu
  • Del - delete menu
  • mhold - rotate
  • Sh+mhold - pan
  • spacemouse - rotate object
  • Sh+spacemouse - pan object
  • Numeric . - center selection/object
  • Numeric 5 - toggle perspective/orthographic
  • Numeric 4/6 - rotate l/r
  • Numeric 8/2 - rotate top/bottom
  • Numeric 7/9/1/3 - snap view to perspective
  • Sh+s - cursor/origin menu
  • Ctrl-Z - undo, +shift to redo
  • Tab - toggle object/edit mode
  • R - rotate
  • G - move
  • F - fill in an edge or face after picking vertices
  • Alt-Z - x-ray mode
  • 1 2 3 - node/edge/face select in Edit mode
  • Ctrl-W - toggle Overlays > Geometry > Wireframe (customized)

Video Editing

Set up project

  • Start blender, make sure "Info" view is selected in top left Editor Type dropdown
  • Change the "screen block" (first dropdown to the right of the File-Render-Window menu in the far top-left corner) to Video Editing
  • Now you have three areas, what I'll call top-left "graph", top-right "video preview", middle "video sequence", bottom "video playback"; each has a viewbar at the bottom of the area
  • in the "graph" area, select the area type dropdown (far left) and change it to "properties"; note that strangely, the properties ares has its area type dropdown at the TOP of the area, doh
  • In the video playback (very bottom toolbar), set the End frame to give enough width to fit the videos, eg 250 > 25000 (or more)
  • In video playback (the very bottom toolbar), change the "how to sync playback" combo from [No Sync] to [AV-sync] before importing anything.
  • Once you have the first video imported, hover over the preview clip, press N, select Proxy render size 25% - you should only have to do this once

Set up Render

  • In the top-right preview window, you are viewing VSE output (looks like a filmstrip S shape)
  • Carefully change that to Properties (remembering that the fucking toolbar will POP from bottom to top of the window - you want to set it BACK to VSE when done configuring the render properties)
  • Now you can change "Render Settings"
    • Dimensions > Resolution > (default is 1920x1080, you might want 1920x1920 if you have both vertical and horizontal footage); See Add a movie, below, to use Image Offset when importing to center each one accordingly
    • Output > directory to (project)/output
    • Output > ffmpeg video, RGB
    • Encoding > Container > MPEG-4, Codec H.264
    • Encoding > Audio Codec > AAC
    • Always select a different framerate, then select the correct framerate, at least once (to avoid a bug initializing the setting)
    • (used to have Presets > MPEG-4, Codec > H.264, Audio Codec > AAC (these codecs play on iphone + android + chrome + firefox!))

Add a movie

  • In the "video sequence" area, click Add > Movie to get a file browser and pick a movie file
    • I find it easiest to drag from a project folder visible in nautilus
    • You can also change the view to list and sort to by date by using the toolbar
  • Set up smaller "proxy" videos for each video strip you import; right-click video strips to select them, select Proxy/Timecode in properties, 25%, then click rebuild proxy and timecodes - YOU HAVE TO DO THIS FOR EVERY STUPID CLIP

Rotating Zooming Panning Video

Annoyingly Blender does not use the camera metadata to rotate the video, so you often need to fix this manually. It's not too bad once you're used to the process. You have to attach a "transform" strip to the video strip you want to ... transform.

  • select the target video strip (rclick or G)
  • VSE menu one up from the bottom > Add > Effect strip > Transform
  • select it, set the rotation to whatever you need
  • You can also zoom and crop the video with this same process, it's very useful
  • There is a way to set up a "driver" for dynamic panning etc. but I'm not smart enough for that yet

You can also rotate video FIRST with ffmpeg. But I got shit results, as it always seems to decode+encode, f that. This will strip the metadata so make sure you rotate the raw video to the correct rotation:

# To simply remote metadata:
ffmpeg -i VID_20180712_202358.mp4 1_grandentry.mp4

# To rotate
# transpose=1 means CW 90 degrees
# transpose=2 means CCW 90 degrees
# Use -vf "transpose=2,transpose=2" for 180 degrees
ffmpeg -i VID_20180712_202358.mp4 -vf transpose=2 -codec:a copy -metadata:s:v:0 rotate=0 1a_grandentry.mp4

Rendering output

  • Once you want to spend time to render the final output, go to the VSE, switch to properties, and set Render > Display to New Window
  • Hit the animation button and a new window should open and start rendering.
  • If nothing happens, check the log for errors. Usually a bug shows up that says "The encoder timebase is not set". You have to select a different framerate in properties, then reselect the correct framerate, to fix the error.
  • You can also use the Info view Render menu > Render Animation.

Video editing keys

  • Use the scrollwheel to zoom out, and ctrl-scrollwheel to center the sequence
  • Ctrl-s to save (Or use the Info view's File menu)
  • Shift-Ctrl-s to save-as
  • A to unselect all, then B to "box select", then drag the mouse
  • On a strip...
    • press K to cut it
    • press X to delete it
    • press G to move it left/right/across tracks
  • Click in the video sequence to set the current position; press M to leave a Marker there that can be returned to using the Marker menu
  • Alt-A to play/pause