GitHub - feilen/tuxedo-blender-plugin: A Blender plug-in to facilitate producing game models, namely by baking everything into one atlassed model with Blender's own rendering engine! (original) (raw)

Tuxedo Blender Plugin - a Blender plugin to make importing character models into various game engines painless and fast.

Questions? Join us on Discord!

Features and How-Tos

Bake a super-performant avatar from just about any starting point!

Up/Left: 'Good' 10000 tri version of model, running on Quest 1. Up/Right: 'Excellent' 32k tri model, running on Desktop. Ambient occlusion and lighting baked and premultiplied.

Down/Left: Nearly the same model, but running in Garry's Mod. Down/Right: Same model, but in Second Life.

Quick start:

For most people, all you'll have to do is:

  1. Make sure your project is saved as a .blend somewhere.
  2. Click the Autodetect button, confirm the resulting platforms make sense for you.
    • Optional: check 'Ambient Occlusion' for more shadow detail, as it's not detected by auto-detect.
  3. Click 'Copy and Bake (SLOW!)', and wait for it to complete (may take a while)
  4. Once you've looked over the results, locate the 'Tuxedo Bake' output directory, inside your current project directory.
  5. Import the whole folder into your unity project.
    • For Quest, you'll want to make a duplicate of your unity project and click "Switch to Android platform" in the VRC control panel.
    • Reccomended: For each texture, edit the texture settings as shown in Reccomended Texture Settings
  6. Setup your rig as usual (humanoid, map bones) and add to your scene.
  7. Copy your existing avatar's properties (and blueprint ID) to the new avatar.
    • Pumkin's Avatar Tools can help you do this quickly.
    • Nara's Unity Tools can quickly simplify dynamic bones, by turning some into rotation constraints, and includes an option for fake bone gravity on Quest.
  8. Create a new Material (right click folder -> Create -> Material) and select the shader you'll be using.
    • For Desktop, Standard is a good starting point.
    • For Quest, you'll want to select your shader based on what passes you've selected:
      * If you're using only a Diffuse map, select VRChat/Mobile/Diffuse or VRChat/Mobile/Toon Lit
      * If you're using only a Diffuse and Normal map, select VRChat/Mobile/Bumped Diffuse
      * Otherwise, select VRChat/Mobile/Standard Lite
    • For Quest, it's reccomended to check GPU instancing.
  9. Drag and drop each texture to its slot in the material.
    • Albedo: SCRIPT_questdiffuse.png if using AO, otherwise SCRIPT_diffuse.png
    • Metallic: SCRIPT_metallic.png
      * Metallic and Smoothness sliders should be set to 1 when the map used.
    • Normal: SCRIPT_normal.png
    • Emission: SCRIPT_emission.png
      * Make sure to check 'Enable Emission' and set 'Emission Color' to #FFFFFF if you're using this!
  10. Drop the new material onto your avatar in the scene, or onto 'Body' in the 'Hierarchy' view.

  1. Upload through the VRChat control panel!

Common issues:

Detailed options:

General options

More info on PBR passes

Reccomended Texture Settings

Quest:(Important: I reccomend you set your project's texture format to ASTC, as reccomended in the docs. This doesn't allow crunch compression, but the VRAM size can often be halved or less.)

Pass name Mip Map Filtering Filter Mode Texture size Compression Resulting size Notes
Diffuse/QuestDiffuse Kaiser Trilinear 2048x2048 Normal Quality 2728kb Diffuse doesn't rely upon shading, so higher resolution can show off finer surface detail
Normal Kaiser Trilinear 1024x1024 Normal Quality 682kb Normal maps are important! The key feature of Bake is its high-to-low complexity normal bake, which makes the lowpoly mesh shade like it's the higher poly one
Metallic(R)Smoothness(A) Kaiser Trilinear 512x512 Low Quality 85kb If you're using this map to show fine surface details, use the same options as Normal. Otherwise, it's pretty safe to compress
Emit Kaiser Trilinear 1024x1024 High Quality 1264kb Emission is completely dependent on the encoded texture, and really easily shows compression artifacts. Higher quality is worth it.
Total, if using all: 4759kb (compressed, usually less than 1-2MB)

Desktop:

How can I see what it'll look like on the Quest?

Almost all Quest worlds use baked lighting settings and a gradient, single-color, or skybox environment lighting. Disable all directional or realtime lights in your avatar scene, and then in the Lighting panel (Window->Rendering->Lighting) see what your model looks like with Source set to Gradient, Single Color (set to white) and Skybox lighting.

Note on Bump Map input vs real displacement

If you intend to bake ambient occlusion, it's highly reccomended that you use a height map with Displacement instead of bump map node (or normal map).

To do this, you will need to connect a 'displacement' node between your height map and material output, and ensure your mesh has a 'subdivision' or 'multires' modifier with a handful of subdivisions present. You also need to enable displacement on a material basis in the sidebar: Material Properties -> Settings -> Surface -> set 'Displacement' to 'Displacement And Bump Map'

Executing from the command line (Batch)

Bake can be easily called from the command line, if your model is already reasonably sanely setup in a Blend file.

> blender Feilen.blend -b --python-expr "import bpy
bpy.ops.tuxedo.preset_quest()
bpy.ops.tuxedo.bake()
exit()"

Additional examples

image

'Dawn' model by @zombies_in_soup

Generate twist bones automatically for more realistic avatar movement

See '5-minute twistbones' on the wiki

Generate facial tracking shapekeys instantly from visemes!

Generate shapekeys on the fly using just the AA, OH and CH visemes (together with the blink/smile/frown keys)!

Installation:

Installation is pretty standard. Grab the latest .zip off the releases page and install using Blender's addon settings.