Skip to content

TheJebForge/BoneReferenceHelper

Repository files navigation

Bone Reference Helper

A ResoniteModLoader mod for Resonite that adds a lot of useful things for transferring bone references of skinned mesh renderers

Elements that get added:

image

  • Copy Bone References into Clipboard - reads all the references in bone list of SkinnedMeshRenderer and serializes them into Clipboard
  • Paste directly - reads reference list from Clipboard and directly sets bone list to whatever was found in the Clipboard
  • Paste based on names - reads reference list from Clipboard, and then goes through the current bone list of the skinned mesh renderer, replacing every bone reference with one that was found in Clipboard
  • Set references from hierarchy - goes through the current bone list of the skinned mesh renderer, replacing every bone with one that was found in the provided hierarchy
  • Use find and replace - if enabled, will use find and replace fields to replace things inside of bone names
  • Apply on source or on destination - decides which names to apply find and replace on, ones that come from armature or clipboard, or names found on this mesh
  • Use RegEx - if enabled, find and replace fields are treated as match and replace patterns for RegEx
  • Ignore case - if enabled, letter case will be ignored while looking for substitute
  • Ignore whitespace - if enabled, any spaces before or after the name will be ignored while looking for substitute

How find and replace feature works

The feature will perform find and replace operation in each name it sees from the bone list

  • If find field is empty, it will work as C#'s string.Format where it will replace the entire name with the replace pattern
    • For example, if bone's name is Hips and replace field is Outfit.{0}, the result will be Outfit.Hips
  • If find field contains something, it will perform simple find and replace
    • For example, if bone's name is Outfit.Hips, find field is Outfit. and replace field is empty, the result will be Hips
    • If bone's name is UpperLeg, find field is Leg and replace field is Thigh, the result will be UpperThigh
  • If RegEx is enabled, it will work as C#'s Regex.Replace, see more here https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expressions#regular-expression-examples
    • Example: if bone's name is Arm.L, find field is (.*)\.(.?) and replace field is $2_$1, the result will be L_Arm
  • If no match was found in the bone's name, it will be left as is

Find and replace is applied before letter case and whitespaces get discarded!

If you want to see what the find and replace feature is doing, you can enable replacementLog in the mod's settings and then check Resonite logs while using the feature.

Some usecases:

  • I want to apply clothes onto my avatar
    • Open your avatar mesh in inspector
    • Click 'Copy bone references into clipboard'
    • Open your clothes mesh in inspector
    • Click 'Paste based on names'
  • I want to apply clothes onto my avatar, but they have some extra bones!
    • Open your clothes mesh in inspector
    • Drag and drop hips slot of the avatar's armature into Armature Root
    • Click 'Set references from hierarchy'
  • Oh no! My bone list in SkinnedMeshRenderer is now completely empty!
    • Open your mesh in inspector
    • Set avatar's hips slot into Armature Root
    • Make sure 'Use mesh bone list instead' is checked
    • Click 'Set references from hierarchy'
  • I want to put an outfit on my avatar, but my avatar has all those <NoIK> tags!
    • Open the mesh of the outfit in inspector
    • Set avatar's hips slot into the Armature Root field
    • Enable 'Use find and replace'
    • Put <NoIK> into the Find field
    • Click 'Set references from hierarchy'

Installation

  1. Install ResoniteModLoader.
  2. Place BoneReferenceHelper.dll into your rml_mods folder. This folder should be at C:\Program Files (x86)\Steam\steamapps\common\Resonite\rml_mods for a default install. You can create it if it's missing, or if you launch the game once with ResoniteModLoader installed it will create the folder for you.
  3. Start the game. If you want to verify that the mod is working you can check your Resonite logs.

About

No description, website, or topics provided.

Resources

License

Stars

17 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors

Languages