Garry's Mod

Garry's Mod

657 ratings
Composite Bonemerge Tool
3
4
3
3
5
2
4
2
3
2
2
2
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Build, Scenic
File Size
Posted
Updated
99.042 KB
Nov 29, 2022 @ 1:53pm
May 27 @ 11:55am
62 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)
Popular Discussions View All (2)
85
Mar 22 @ 7:11am
PINNED: Bug reports
kuma7
0
Dec 7, 2022 @ 8:44am
PINNED: Post the dupes you've made here!
kuma7
311 Comments
ynkst splnkr May 23 @ 4:41am 
hehehe peepee joke lmao
kuma7  [author] May 6 @ 11:19pm 
Is that supposed to be a bug report?
215phoenix May 6 @ 5:14pm 
the bonemerge tool adds multiple bodygroups and skingroups
kuma7  [author] May 2 @ 11:11pm 
I think I know what caused that. I'll push an update today
DoomliBug May 2 @ 10:59pm 
It works fine with the vanilla color tool, but other coloring tools (Such as Proxy Color Tool and TF2 Hat Painter Tool) wipes the applied color after bonemerging
kuma7  [author] May 2 @ 3:54pm 
Do you mean that bonemerged models lose the color they have before they are bonemerged? I didn't experience anything like that with the vanilla color tool.
DoomliBug May 2 @ 3:00pm 
New update seems to have broken Proxy Color Tool usage with bonemerging :c It's resetting the colors applied before bonemerge
TheCarson116 Apr 24 @ 1:01pm 
Alright.
kuma7  [author] Apr 24 @ 12:50pm 
I'd download it and try and find out what's going on. You can friend me and post it privately if you want.
TheCarson116 Apr 24 @ 12:46pm 
What would you or me then do with that?