Difference between revisions of "Blender hints and tips"
(link) |
(→Animations) |
||
Line 19: | Line 19: | ||
<br> | <br> | ||
[[File:After-collada.jpg|400px]] | [[File:After-collada.jpg|400px]] | ||
+ | |||
+ | To save a movement to a keyframe, in pose mode with the bones you want to adjust selected, click 'i' in the main window to bring up 'insert keyframe menu' and set the type you want, probably 'location and rotation'. | ||
====Bone Constraints==== | ====Bone Constraints==== |
Revision as of 08:20, 2 February 2022
For information specific to using Blender in conjunction with IWTE for M2TW Battlemap Buildings please see IWTE - Settlements in Blender. For information on working on RTW and M2TW Units or Characters in Blender see IWTE - Units in Blender.
This page consists of more general tips which may be suited to use of Blender for other aspects of Total War Modding. Information given is for Blender 2.8 unless otherwise noted.
Contents
Textures
This explains one way of opening an image texture in Blender 2.92. In the right-hand side bar click the pink circular material icon. If 'Surface' is not visible, click the 'Use Nodes' button. In the 'Surface' drop down box select 'Principled BSDF'. Click the small round button next to 'Base Color' (not the main box), select 'Image Texture' from the drop down list. A new bar will open under Base Color, select the 'Open' tab and browse to your image file.
Animated Models
Bone Assignment
Assigning vertexes to bones is achieved by 'weight painting' in Blender. If you need to limit the number of bones a vertex is assigned to, e.g. to a single bone for M2TW strat characters or RTW units, you can use "Limit Total" under the "Weights" menu, input the number of bones desired in the drop-down mini-menu that appears. To get Vertex Groups applied to new/imported piece of mesh, first make the mesh a child of the Armature parent, using one of the "Assign from Bones" options. If the automated process didn't get the desired result select the vertex group bone name that you want to assign to, and 'paint' the vertexes.
Animations
To start adjusting animations you need to be in "Pose Mode", to view the keyframes in the "Dope Sheet" section and be able to select bones easily, click the pose (running man) symbol in the side-bar, open "Viewport Display" and select "In Front".
To save a movement to a keyframe, in pose mode with the bones you want to adjust selected, click 'i' in the main window to bring up 'insert keyframe menu' and set the type you want, probably 'location and rotation'.
Bone Constraints
Bones will generally follow the movements of their parent bone/s in the armature, to over-ride this behaviour, or temporarily change the parent relationship you can use "Bone Constraints" on individual bones.
You can impose a constraint only on certain keyframes by manipulating the "Influence" amount. 1.0 will give the constraint full influence and 0.0 will give no influence. To set for an individual keyframe, drag the blue time bar to the desired frame, type the desired number in the influence box then hover over the box and hit the shortcut key "i" to set that value. This can be used if you wish to have a weapon's bone linked to the hand bone for parts of the animation, but set down or stored against the torso for other parts.
Pictured below is an animation in .blend file with bone constraints applied.
"Shrinkwrap" to a portion of mesh seems to be the only constraint that will make a bone follow acurately an element that isn't its parent in the armature. If you're exporting the animation separately you can temporarily separate a portion of mesh to provide a smaller area to wrap to.
Exporting via Collada will convert the movement paths obtained by the bone constraints to individual keyframe values (as shown in the picture under Animations above), that should then be useable in other programs that may not directly accept the constraint properties.
Fixing Floating Units
If your model mesh and skeleton has been scaled you may need to adjust the bone positions in all the .cas animations relative to ground level to prevent floating units.
To find out how much you need to adjust the skeleton load your model on it's basepose and at least one animation in Blender. Activate the animation, view in orthognal projection and measure the amount the model needs to be moved by to sit at the required level:
Select the Armature and select 'Edit Mode' for the Armature, select all the bones and move them vertically by the required amount:
Select all the Mesh elements, go to 'Edit Mode' for all of them, select all and move them vertically by the same amount.
Activate the animation again and check that your model now performs the animation at the correct height. If so export the file. You will need to use the basepose information from this file to update the skeleton in ALL of the animations the model uses, and you will need to use the new re-aligned mesh generated from the file too.
For how to use IWTE to update animations see here
Export via Collada to .dae
To ensure you save the frames for any bones that might be stationary but in a new pose position select the boxes shown below.
To suit processing by IWTE please use the "Matrix" export option as shown.