Blender

From OniGalore
Revision as of 15:10, 28 December 2020 by Delano762 (talk | contribs) (Added the Visual transformer script)
Jump to navigation Jump to search
Unfinished building-60px.jpg

This page is unfinished. Can you fill in any missing information?
If it is not clear which part of the page is unfinished, ask on the talk page.


Aged parchment-60px.jpg

This page contains information that is out of date.
Double-check for changes in Blender's features, workflows and UIs of version 2.8, as some sections might cover version 2.79.


Controls

Blender is so radically different from any other tool that you might want to customize the controls. In that case, have a look at:

File > User Preferences... > Input > 3D View > 3D View (Global)

The more controls you change, the harder it gets to follow a tutorial. Consider biting the bullet and keeping the controls as they are.

Viewport

Blender display mode Texture.png
Blender display mode Material.png

Q: How can I change the display mode to see textures?

A: At the bottom, click at the circle button to get a dropdown menu.
Texture gives you just rough shading.
Use Material instead to see textures plus rough shading.

Q: How do I get global lighting?

A: Go to the World properties and select the box Environment Lighting. (See the Warehouse screenshot)
Oni WH Env Blender.png


Object mode with vertex colors

In the upper right are small "sphere" buttons and an arrow.
When "solid" is selected, click on the arrow to open a drop down menu and change the color to vertex.

UI

Q: How do I close panels?

A: In the upper right corner drag the triangle symbol on another equal sized panel.

Tools and actions

Blender has excellent documentation. See HERE for the general docs on face-editing.

Q: How do I select faces, edges and vertices (points)?

A: There are controls at the bottom of the viewport. While being in Edit Mode, make the Edge symbol active. Right-click a component to select it. Use Shift to add or subtract.

Q: How do I toggle between selection modes.

A: See here.

Q: How do I (de)select all?

A: Press A.

Q: How do I fill holes in meshes?

A: Select edges of the hole. Press F to make a N-gon face or press F + Alt to make a triangulated face.

Q: How do I show normals?

A: Press N to toggle for a panel with more properties. Scroll down to Mesh Display section. You likely want to click the faces symbol.
Remove hard (blue) edge
In edit mode select edge, go to the right, open "Shading / UVs"
Edges: "Smooth" button
Triangulate faces
Select faces, Control + T
Quadrulate triangles
Select faces, Alt + J

Q: How do I edit UVs?

A:

Hotkeys

Right-click a menu for the context menu. Often this allows you to assign a hotkey.

Development

Blender 2.8 Python Tooltips.png

You may want to go to the preferences and switch on Python Tooltips.

Contrary to intuition, the Developer Extras do not give you additional Python functionality per se. Instead this option enables experimental Blender features.

Related videos:

Tutorials

Modelling

Rigging

Scripts

Script for enabling/disabling constraints in selected objects

This script allows the user to enable or disable constraints in currently selected objects, depending on whether con.mute is set to 0 (enable constraints) or 1 (disable). Usage is simple, just select your objects, set the value of con.mute and run the script.

import bpy
obj = bpy.context.selected_pose_bones_from_active_object
for bone in obj:
    for con in bone.constraints:
        con.mute = 1

Blender Forward throw adjustment script

Please see the XML:TRAM page describing this script.

Rig bone constraint target setting script

This script sets the targets of Geyser's rig bone constraints, after removing one of the existing pose-matching characters and replacing it with another.

import bpy
obj = bpy.data.objects

#SET THIS TO EITHER 1 OR 2 DEPENDING ON WHICH POSE YOU ARE GOING TO USE
prefix='1'

armature = bpy.data.objects['rig']

#copying location
armature.pose.bones["torso"].constraints['Copy Location.00'+prefix].target=obj['mid.00'+prefix]
armature.pose.bones["torso_pivot"].constraints['Copy Location.00'+prefix].target=obj['pelvis.00'+prefix]

#copying rotation
#Torso
armature.pose.bones["hips"].constraints['Copy Rotation.00'+prefix].target=obj['pelvis.00'+prefix]
armature.pose.bones["tweak_spine.001"].constraints['Copy Rotation.00'+prefix].target=obj['mid.00'+prefix]
armature.pose.bones["chest"].constraints['Copy Rotation.00'+prefix].target=obj['chest.00'+prefix]
armature.pose.bones["shoulder.R"].constraints['Copy Rotation.00'+prefix].target=obj['right_shoulder.00'+prefix]
armature.pose.bones["shoulder.L"].constraints['Copy Rotation.00'+prefix].target=obj['left_shoulder.00'+prefix]
armature.pose.bones["neck"].constraints['Copy Rotation.00'+prefix].target=obj['neck.00'+prefix]
armature.pose.bones["head"].constraints['Copy Rotation.00'+prefix].target=obj['head.00'+prefix]

#Arms
armature.pose.bones["upper_arm_fk.L"].constraints['Copy Rotation.00'+prefix].target=obj['left_biceps.00'+prefix]
armature.pose.bones["upper_arm_fk.R"].constraints['Copy Rotation.00'+prefix].target=obj['right_biceps.00'+prefix]
armature.pose.bones["forearm_fk.L"].constraints['Copy Rotation.00'+prefix].target=obj['left_wrist.00'+prefix]
armature.pose.bones["forearm_fk.R"].constraints['Copy Rotation.00'+prefix].target=obj['right_wrist.00'+prefix]
armature.pose.bones["hand_fk.L"].constraints['Copy Rotation.00'+prefix].target=obj['left_handfist.00'+prefix]
armature.pose.bones["hand_fk.R"].constraints['Copy Rotation.00'+prefix].target=obj['right_handfist.00'+prefix]

#Legs
armature.pose.bones["thigh_fk.L"].constraints['Copy Rotation.00'+prefix].target=obj['left_thigh.00'+prefix]
armature.pose.bones["thigh_fk.R"].constraints['Copy Rotation.00'+prefix].target=obj['right_thigh.00'+prefix]
armature.pose.bones["shin_fk.L"].constraints['Copy Rotation.00'+prefix].target=obj['left_calf.00'+prefix]
armature.pose.bones["shin_fk.R"].constraints['Copy Rotation.00'+prefix].target=obj['right_calf.00'+prefix]
armature.pose.bones["foot_fk.L"].constraints['Copy Rotation.00'+prefix].target=obj['left_foot.00'+prefix]
armature.pose.bones["foot_fk.R"].constraints['Copy Rotation.00'+prefix].target=obj['right_foot.00'+prefix]

Visual transformer script

This script "bakes" the animation done using Geyser's rig into Oni character model bones by applying visual transform and keyframing each frame within a specified frame range.

import bpy

start = 0
end = 100

scene = bpy.context.scene

scene.frame_set(start) #set start frame
for i in range(start, end): #loop for every frame
        scene.frame_set(i)
        bpy.ops.object.visual_transform_apply()
        bpy.ops.anim.keyframe_insert_menu(type='BUILTIN_KSI_LocRot')