Quantcast
Channel: Second Life – Austin Tate's Blog
Viewing all articles
Browse latest Browse all 281

Ready Player Me Avatars in Second Life and OpenSim (Onigiri)

$
0
0

This blog post describes a process to take Ready Player Me (https://readyplayer.me) avatars via Blender and the Onigiri add-on to use in Second Life and OpenSim. Onigiri is a type of Japanese rice ball (see Wikipedia).

Prepare the Resources

  1. Obtain and install Blender (https://blender.org).
  2. Obtain Onigiri (https://github.com/nessaki/Onigiri). Only the Blender add-on install ZIP file is required, the rest is source code only used to build the add-on. Get it via https://github.com/nessaki/Onigiri/blob/main/Onigiri.zip. Install it as a Blender add-on via Edit -> Preferences -> Add-ons.
  3. Some data files used by Onigiri may be needed to make the conversion process easier.
    1. Go to the Onigiri “data” directory which is usually located at something like
      C:\Users\…\AppData\Roaming\Blender Foundation\Blender\…\scripts\addons\Onigiri\data
      This location can be overwritten when you update Onigiri so save a copy of the changes/additions mentioned below for future use.
    2. Observe that the readyplayerme.onim is 3KB (in Onigiri 3.5b). Copy mixamo_no_prefix.onim (29KB) to readyplayerme.onim instead as that gives a better conversion. Ready Player Me avatars have a Mixamo compatible skeleton/armature.
    3. Ready Player Me avatars can be downloaded in a “T-Pose” which is a good basis for the conversion but also splaying the fingers on the hands works better. From https://openvce.net/resources/downloads/ReadyPlayerMe/Onigiri/ download ReadyPlayerMe-T-Pose-Splayed-Hands-Only.bpl and also put it in …\addons\Onigiri\data.
  4. Ensure you have a Ready Player Me avatar to download via https://readyplayer.me).

Workflow for Conversion

  • Obtain Ready Player Me avatar .glb URL.
  • Download avatar URL with ?textureAtlas=none&pose=T on the end.
  • Start Blender and delete the default camera and light.
  • Import .glb to Blender and check avatar is in T-Pose.
  • Extract all the textures. One quick way to do that is to save the project as a .blend file first, then go to File -> External Data -> Unpack Resources and select “Use files in current directory (create when necessary)”.

Set Finger Pose to Second Life/OpenSim Splayed Fingers

The Ready Player Me T-Pose has the fingers in a line. Second Life and OpenSim T-Pose rest pose has the fingers widely splayed. This can be fixed by applying the finger splaying mentioned earlier which is limited to the fingers and thumbs of the avatar.

  • Location of the Apply Pose ButtonUse Onigiri’s Animation -> Enable the Pose Library and then load the ReadyPlayerMe-T-Pose-Splayed-Hands-Only.bpl pose library file and applying the pose to the avatar (note to make the Pose Apply button to be active you might have to click off the Armature in the Blender Outliner and and back on it).

Onigiri Posing Library

Convert Avatar Rig/Armature for Second Life/OpenSim

Onigiri Load Map - Convert - Project Full Rig - Export

  • Under Onigiri’s Character Converter, load the readyplayerme.onim map and click Convert
  • Use Onigiri to export for Second Life/OpenSim (select all three options including Project Full Rig).
  • Import the Collada (.dae) file produced to Second Life/OpenSim. Name the mesh something sensible. Set the Lowest Level of Detail to 0. Select Physics as “Lowest”. In Rigging tick both “Include Skin Weights” and “Include Joint Positions”. If you leave out Include joint positions, the avatar may look spindly.

Prepare the Avatar within Second Life/OpenSim

  • Attach the uploaded mesh avatar (e.g. to Avatar Center)
  • Change the Description field of the avatar mesh to include the licence information:
    CC BY-NC 4.0 https://readyplayer.me
  • As with any mesh avatar in Second Life or OpenSim, you will need to add an “Alpha Mask” to make sure the underlying standard avatar does not show through the mesh. This should make all parts transparent (Lower, Upper, Head, Eyes and Hair)

Texture the Avatar in Second Life or OpenSim

  • Texture the mesh faces using the Diffuse textures and Normal Maps (for bumpiness). The shininess/metallic textures don’t work well and may be omitted

Texture with diffuse textures and add bumpiness “normal” textures to the mesh inworld. You probably don’t want to use (yet) the Metallic/Roughness/Shininess (PBR) where that is provided for some faces as they can be a bit too glossy. Though Physics Based Rendering (PBR) is under development for Second Life, so you may wish to keep the textures to hand.

To texture the teeth you may need to Disable the Camera Constraints (Preferences -> Advanced) to be able to swing the camera inside the mesh head to select that mesh part.

The hair colour is a simple coloured image. You can alternatively change the hair colour using the “Blank” texture and setting a colour.

Avatar .glb files that are downloaded may have a single face with three textures that represent the texture (diffuse), normal map and metallic/shininess (PBR), or maybe have multiple faces for hair, face, skin, top and bottom. The single face format does not allow hiding of the hair, glasses, etc for in world customisation as described below.

Optimising and Re-using Textures

If multiple Ready Player Me avatars share the same face, eyes, teeth body, hair and perhaps items such as glasses. The diffuse and normal map textures for these can be reused rather than uploading and using a new asset each time. This will save upload fees, but also allow for texture sharing or reuse for efficiency. The different textures for the outfit top, bottom, dress and/or footwear can then be used with these shared elements. The skin and hair colour textures can also be replaced by the standard blank texture and coloured to match to further save on the use of different textures.

Hand Relax Background Pose

  • You could add a hand relax low priority pose into the mesh.
  • To “relax” the hands when not in a pose you could use the RuthAndRoth “bentohandrelax” script and “bentohandrelaxP1” animation. These are available in the Ruth2 v4 and Roth2 v2 distributions in Second Life and OpenSim or via the (GitHub RuthAndRoth “Extras” repository Animations Directory).

In-world Customisation

  • Optionally make some parts transparent (such as hair and glasses, hats, etc) to allow use of in world attachments for those parts
  • Try the Avatar Shape sliders as many will work

A number (but not all) the “Edit Shape” sliders work on Ready Player Me avatars to adjust the general shape.

Some parts such as the hair, accessories such as glasses, etc can be set to 100% transparent and the underlying avatar shows through (such as setting a bald head). This can allow some measure of in-world customisation. It also allows standard avatar attachments such as mesh and flexi hair to be added on without initially uploading a bald headed Ready Player Me avatar.

The head and body parts and textures cannot be altered. Facial hair, eyebrow details, make-up, etc are all baked onto the skin textures which have a unique mapping for Ready Player Me avatars. Hence tattoos and other elements that can be applied to skins in Second Life or OpenSim will not work.

The eye texture can be changed, even to a Bakes on Mesh (BoM) Eye (ensure you use an underlying avatar mask that allows the eye to show in that case). The normal eye texture iris image is slightly larger than the standard Ready Player Me one, so you may wish to adjust the image horizontal and vertical scale to (say) 1.1.

Licencing

Onigiri is based on a fork of Bento Buddy (a charged for Blender add-on) and uses the same basic Python scripts as is permitted under the Blender add-on licence, though it uses its own assets such as icons.

Alternative Routes

An alternative route to convert Ready Player Me avatars for use in Second Life and OpenSim is to use the Bento Buddy Blender add-on as described in this blog post. Though Bento Buddy is also GPL licenced, the latest versions of Bento Buddy (1-Jan-2023 onwards) requires a current paid for licence to the Bento Buddy “Expression” service to allow the export of the Collada (.dae) outfit file.


Viewing all articles
Browse latest Browse all 281

Trending Articles