Garry's Mod

Garry's Mod

737 ratings
Composite Bonemerge Tool
3
4
3
3
5
2
4
2
3
3
2
2
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Build, Scenic
File Size
Posted
Updated
99.294 KB
29 Nov, 2022 @ 1:53pm
22 Aug @ 9:05am
64 Change Notes ( view )

Subscribe to download
Composite Bonemerge Tool

Description
The Composite Bonemerge Tool (CBT) is an advanced bonemerge tool that lets you modify bonemerged models with any vanilla or custom tool after bonemerging them with other model. The bonemerged models' data will be automatically available when you use your favorite tools, as if they truly were a single model. This includes the following data: body groups, skins, submaterials, flexes, eyes, bones and attachments.

Additional cool features:
  • Models are added, removed or detached with menus in an intuitive way.
  • We can change the position, angle and scale of child models from within a PAC3-style editor.
  • Bonemerged models' color can be changed in the editor.
  • Players, NPCs and NextBots preserve the models that were attached to them when they die.
  • Everything is saved correctly in dupes and saves.
  • Flawless ghost preview.

This tool fixes many of the bugs of the Easy Bonemerge Tool as well, for example:
  • Halos are drawn smoothly across parent models and their children (see the images above).
  • When you attach something to yourself, there aren't bugged shadows in first person view.
  • When you remove a child model from its parent, the child's shadow is removed instantly.

INSTRUCTIONS
  • R-click: Select the model you want to add or remove models from.
  • L-click: Add something to the model on which you right-clicked. Clicking on the selected model allows for removing the models that you merged with it before. KEEP IN MIND THAT THE MENUS WILL ONLY APPEAR WHEN YOU HOLD YOUR C KEY.
  • Reload: Select yourself as the model you want to add or remove models from (click again to remove models from yourself).

It's possible to make very complex models with infinite depth. For example, you can bonemerge a prop to another prop that you've already bonemerged before, and so on.

Available convars
  • sv_compositeentities_enable: Enable/disable scripted models (those that are created with LUA scripts). See info for developers.

  • sv_compositeentities_childboneediting: By default, the feature that lets you transform bones of child models using bone tools is disabled. It can be enabled with this ConVar (set it to 1). Anyway, some bone tools have built-in features for child bone editing (Ragdoll Mover), so you could just use them directly. You should disable this if it causes problems with other addons.

INFO FOR DEVELOPERS
The CBT includes an internal system for bonemerging models automatically when they're spawned using small LUA scripts. The child models specified in these scripts will ALWAYS spawn, even in playermodel selectors. This way, we can make custom playermodels, NPCs, ragdolls, or whatever we want.

Personally, I use this feature for creating very complex models that couldn't have been compiled with Studiomdl (too many vertices, more than 32 materials...).

In order to use this system, you just need to call a special method called addModel in a hook called CompositeEntities_AddModels. This function is used to register a model and returns a registration ID. Then, you can add child models to that model by calling the function again. It has the following parameters:
function CompositeEntities:addModel(modelChild, modelParent, att, localPos, localAng, scale, scale2)
  • modelChild: A path to the MDL file of the model you wanna register. If you want to attach this model to multiple parent models, you can either use the registration ID returned by the function in a previous call or just type the path of the MDL file again.

  • modelParent (OPTIONAL): A path to the MDL file of the model you wanna use as the parent of modelChild. It must have been registered in a previous call, otherwise the function will fail. You can use its registration ID too. This argument may be nil if you intend to use modelChild as a root model.

  • att (OPTIONAL): Name of the bone that you wanna use for parenting (it must exist within the parent model). If this argument is nil, bonemerge will be applied instead. If you use this argument, modelParent, localPos and localAng must be set.

  • localPos (OPTIONAL): Relative position (Vector) of the child model within its parent (doesn't work if att isn't set).

  • localAng (OPTIONAL): Relative angle (Angle) of the child model within its parent (doesn't work if att isn't set).

  • scale (OPTIONAL): Scale (number) of the child model (doesn't work if att isn't set).

  • scale2 (OPTIONAL): Scale (Vector) of the child model's root bone (doesn't work if att isn't set).
NOTE: You can use the PAC3-style editor in-game for helping you determine localPos, localAng, scale and scale2.


As an example, this's the script I used for my Velikan playermodel. This code was added to a file within the "lua/autorun" folder.
hook.Add("CompositeEntities_AddModels", "CoD: MW Velikan", function(composite) local id_pm = composite:addModel("models/kuma96/codmw/characters/velikan/velikan_pm.mdl") composite:addModel("models/kuma96/codmw/characters/velikan/velikan_bodygroups.mdl", id_pm) end)

Recommended Addons
Use this along with Overhauled Bone Tool to do head swaps. Enable the "Scale child bones" checkbox for better results. Remember that sv_compositeentities_childboneediting must be set to 1.
Popular Discussions View All (2)
88
17 Aug @ 9:14am
PINNED: Bug reports
kuma7
2
13 Sep @ 1:56am
PINNED: Post the dupes you've made here!
kuma7
333 Comments
(Insert Username Here) 28 Sep @ 11:46pm 
Hmm doesn't appear to work with advance duplicator 2. Shame that been trying to find some bone merge addon that functions with that so that way I don't have to pose the bones every single time. Not your fault there as it appears the devs of the advance duplicator doesn't appear to leave hardly any documentation.
TIRED AND LAZY 22 Aug @ 6:25pm 
Thank you! I thought the feature was gone forever
AaronJohnLeal2001 22 Aug @ 10:56am 
@TIRED AND LAZY Thank you!!! Helped before missing errors to fixed back stay face poser! :steamhappy:
kuma7  [author] 22 Aug @ 9:06am 
After further investigation, I think I managed to fix the LUA errors without removing that feature. It should work again now.
TIRED AND LAZY 22 Aug @ 6:46am 
Ah, thanks for reply, a shame that the face poser is broken due to the new update,at least the other features can still work with SMH.
kuma7  [author] 22 Aug @ 6:11am 
@TIRED AND LAZY
As you mentioned, it wasn’t a bug but a feature. However, the Gmod developers updated the game in July and made some changes to the vanilla faceposer code, which caused LUA errors when CBT was used to bonemerge ragdolls with flexes. Unfortunately, I had to remove it.
TIRED AND LAZY 22 Aug @ 4:43am 
I thought the face posing bug was a feature,I really liked the bug to be able to swap heads since some ragdolls don't have facial flexes,I could just use the tool to bonemerge one with face flex on it and proceed to make animations with it.If you don't mind me asking, Is this bug gone gone? Or is it going to be back any time soon?
AaronJohnLeal2001 13 Aug @ 1:46pm 
Before Composite Bonemerge Tool and add Face poser to After update but not add face poser?
Dr. Diddy House 2 Aug @ 5:17pm 
CBT?!!!
kuma7  [author] 2 Aug @ 3:04am 
Tell me the steps I should follow to reproduce those errors. I updated the tool yesterday and I am not experiencing errors related to the faceposer anymore.