$bonemerge: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(added a guide on how to quickly make bonemerge lines)
(→‎Writing Bonemerge easily: updated guide with a simpler to understand alternative. which also includes less work)
Line 12: Line 12:
#Copy the bone names from the very top into a new, empty file.
#Copy the bone names from the very top into a new, empty file.
#Press '''Ctrl&H''' to enter "Replace" mode.
#Press '''Ctrl&H''' to enter "Replace" mode.
#Replace '''[0-9][0-9][0-9] "''' with '''$bonemerge "''' - for three digit numbers before bone name
#In the "Find What" field, enter  '''^\s*\d+\s*"([\w\.]+)"\s*-?\d+\s*$'''
#Replace '''[0-9][0-9] "''' with '''$bonemerge "''' - for two digit numbers before bone name
#In the "Replace with" field enter '''$bonemerge "\1"'''
#Replace '''[0-9] "''' with '''$bonemerge "''' - for one digit numbers before bone name
#Replace '''" [0-9][0-9][0-9]''' with '''" ''' - for three digit numbers after bone name. including a space after the replacement "
#Replace '''" [0-9][0-9]''' with '''" ''' - for two digit numbers after bone name. including a space after the replacement "
#Replace '''" [0-9]''' with '''" ''' - for one digit numbers after bone name. including a space after the replacement "


After doing this you will have replaced every three, two and one digit number before a bone name with $bonemerge and every three, two and one digit number after the bone names have been deleted.  
Now you can paste those lines in your qc file, or use as a qci file.


[[Category:QC Commands|bonemerge]]
[[Category:QC Commands|bonemerge]]

Revision as of 16:54, 27 April 2020

Serves as a hint to the game code that the named bone will be used for bone merges (see Attachments) during the game. If this flag is not present, the bone can still be used but you'll get performance warnings.

It can also be used to force a bone existance for the $definebone process. Sometimes when you use Crowbar to write the $definebones lines, it will collapse a bone and simply not write a $definebone line for a bone. Adding a $bonemerge line for all, or just the missing bone, circumvents the bone from being removed.

Syntax

$bonemerge <bone name>

Writing Bonemerge easily

There is no automated function for this yet, but you can do it manually using Regex in Notepad++. This process takes about two minutes

  1. Open your mesh.smd in Notepad++.
  2. Copy the bone names from the very top into a new, empty file.
  3. Press Ctrl&H to enter "Replace" mode.
  4. In the "Find What" field, enter ^\s*\d+\s*"([\w\.]+)"\s*-?\d+\s*$
  5. In the "Replace with" field enter $bonemerge "\1"

Now you can paste those lines in your qc file, or use as a qci file.