#Model Replacement API & SDK
1 messages Β· Page 6 of 1
I've seen some models that were designed to work with blender rigidbody physics that were full of random garbage.
well what do you consider random garbage
Everything other than the armature and model.
You know the armature is the set of all a model's bones, and the model itself has a skinnedmeshrenderer and perhaps an animator, but sometimes there's other stuff attached to the bones other than other bones.
can things become wonky if there are too many bones?
because the model is stupidly overcooked
it does have like 19 vertex groups/bones per leg
same thing for the arms
it is super cluttered
It's just the first thing that came to mind. It's really hard to say since they have so much going on behind the scenes.
If you can get rid of those without ruining it, it might be worth a try.
Supposing it's worth the effort, anyways
well i already had to modify the rig to get it to work for lethal to begin with
so ye i could do that
Also if you hadn't already, I would recommend looking for a possible duplicate in unity explorer.
Or if not, you can go into the model and disable things until you find what causes the lag
i did delete the shape keys and i do disable animations when exporting it to fbx and i have no idea what else it can have
Well, give disabling things a shot.
Actually that's probably going to be way faster than just looking for random things to cut out
well, what do i disable? just random parts of the model or what do you mean by that
I would start by disabling the entire thing and confirming that the lag goes away, for one.
Then you just go down the hierarchy until you can isolate what causes it.
Like, start at the waist, then do the lower body, then upper body, then head, etc..
With luck it's not just the whole thing that's cursed. I've tried out tons of models and never got anything close to performance issues without physics.
well, i can do all of that but probably not this week anymore lmao. ive spent 3 days with this model, running into issues everywhere, at this point almost the entire model is custom weight painted, some textures are custom made and the rig is modified too. i kinda feel a bit burned out on this thing rn
im doing something where i actualy get something done for a bit
I really feel you on the taking a break part, except my break has been months now.
i mean
i dont do modding anymore outside of my vacation
when i get home from work i have like no motivation for anything lol
Real.
You can have a life outside of modding?
if you consider work a life
fair
dahell is the problem here
unity keeps selecting the thump bones for the index finger and the index bones for the thump wich is just wrong and looks broken, manualy changing them to be correct also makes them look broken but now shows them red
ok i found the enforce T-pose button
dunno why it didnt just do but whatever
but it still doesnt fix the pose
theres still something off
now it does
i hate everything
@full hollow I don't really mod anymore. Life got busy, and I also work in software full time, which makes my desire to mod even less. If you hadn't noticed, basically all the updates for the past several months have been from PRs by extremely generous gigachads.
how do i donate
not sure where else to ask this but theres no solution to this happening with jiggle physics yeah? when the model moves a lot in a short timeframe (ship leaving, entering facility, etc)
i assume its just a funkiness ill have to live with but figured id ask anyways
As long as they return to their original positions this is normal behavior
Because the jiggle physics still account for movement while the player is being teleported to another spot
(Teleported meaning any time the player's position is set specifically, not actually using the teleporter)
they do yeah it just looks really bad for a split sec
Best solution i can think of for stopping it is turning off the jiggle physics components during teleports but there isn't really a unified way to know when you're being teleported
And its a lot of work for something you'll see 1% of the time you play
yeah makes sense
any idea on what causes this error on a modelreplacement when starting the game?
im going off of memory here and i forget if its already been fixed but there was this bug i remember seeing where theres a vertically stretched employee head over the model replacement head, anyone recall that or know what causes it? ive seen it quite a few times and always forget to screenshot
has there been any large auto generated project changes over the past few updates?
updating femmployee and having lots of strange issues with the mod in game.
my project was generated a good while ago and has been built on since then, so wondering if that could be why.
no direct errors in code though, just some new unity errors when building my asset bundle, unsure if its that or not but cant get the error to go away though so just looking elsewhere.
ah,, old build works just fine with latest model API, so no not that nvm
Your assetbundle is missing, or messed up in some way. Try rebuilding it.
I honestly don't think I've ever seen that. Send a screenshot sometime.
None. May just be unity being stupid. Don't forget to clear out the AssetsToBuild folder first.
Honestly I wish I knew enough about unity to fix that one, but the SDK is basically a black box at this point, and I 100% know that I'll break everything if I touch it again.
Yeah I know it was something being stupid lol, the issue went away without warning and the things that I thought were symptoms are still present
The issue persisted on both unity projects too, so whatever cased it, caused it from my old untouched project all the same as the new one. So something really wacky I think on my pcs side went down
yea i fixed it by moving the scene and the models to a new unity project
hey howdy!
dunno if you remember but a while ago i came here about my mod having a frame drop when my MRAPI suit was on, about 15~20 fps.
with lots of help i was able to track it down. from what i understand its code in ModelReplacementBase.LateUpdate() and ManagerBase.Update() causing my drops.
figured i would let ya know!
could you specify what code you think causes it
im not sure, @limpid pebble was helping me. from what they said just stuff running every frame.
they had me prefix return patch out LateUpdate() as a test and that made the FPS better with the suit on. and i did not test it but was told ManagerBase.Update() was the other half of the FPS drop
wouldn't patching out lateupdate stop your model from following your body
dont know, was just doing profiling
you can look in #dev-general thats where they helped out
if they pop in here at any point i am sure they can explain it better than me, they were looking at source
doesn't really matter, as the geometry isn't moving regardless of whether it's on or off if you're doing a benchmark
point was to test what components cause the most performance reduction
I can't say I know what specifically causes those methods to run so slow, but I have a number of critiques for them that would likely improve things if they were addressed
could be worth chucking an issue up maybe?
something more proper than discord i guess
I think people are more likely to see it here tbh
yeah fair nuff
I don't think Bunya has any interest in doing a deep dive to optimize it, but the more people that see it the more likely someone will be to decide to make a pull request
thats what i was thinking
mh that was a msg i was looking for lol
mentioning it here might be good enough proponent for someone to do a PR at least
what I would do:
- Think about the complexity of the methods that are doing these searches, try to use dictionaries or other O(1) operations wherever possible
- Make sure that all Unity runtime properties (especially active state) are only changed when needed, rather than every frame
- Cache components
- Stop using linq!!!
since mrapi seems mostly maintained through prs anymore
yeah
if I get especially bored at some point I might think about doing it myself, but for now I'll leave it to anyone else feeling adventurous
its not a super huge FPS drop for a high end rig, but someone running a semi large pack on a mid range pc, would for sure cause issues. at least in Femmployees case
if I did though, my PR would probably be massive lol
it's definitely nowhere near insignificant on my machine, and it's pretty high end (for 4 years ago at least)
i mean even mine its about a 25 FPS drop at its worst
so yeah ig it can be bad
but i dont mind low FPS, 15 is fine to me, just a lil chunky lol
it was about 16% reduction for me
yeah
i do agree
thats why i was so sad i never could seem to find the cause lol
if it could get a PR that would be super neat for all mods that run the API too. and thats a lot of mods at this point
very cool mod imo, would 100% not been able to help out tilted with the femmployee mod without it β€οΈ
Some suits that have some kind of custom code sometimes reduce my fps by like 40
Very basic and simple suits are usually at this 10 to 15 fps drop range yeah
But I love linq.
Very good critiques. Personally I have never experienced frame drops, even when I used to play with 100+ mod modpacks so I never bothered with optimizations. If there's a lot of people with issues then I could look at optimizing some of this stuff.
it's more of a death by a thousand cuts situation I'd say
plus probably some unoptimized models undoubtedly contribute to it too in some cases
but that 15% probably compounds for each person that equips a custom model, and in a larger lobby it probably makes quite a large difference
15% is a lot for something that should in theory be able to be nearly free (except for mesh skinning cost)
It definitely does
it would probably be worth putting some profiler markers in to see where exactly the biggest slowdowns are, since my lists above are only hypotheses for the cause
My own experience running large lobbies with people who basically exclusively use modelswaps shows some big fps drops
I like it too!! but it's not great to use it in update methods imo, since it allocates garbage as far as I'm aware
it's probably not near the most significant cost, but I avoid it wherever I can in the interest of reducing overhead
except when I'm doing things that are especially concise with linq and don't have to run every frame
also I should probably expand on my
(especially active state)
from that message, the reason I say that is because I've seen multiple times that toggling active state is incredibly slow, presumably because it has to walk the tree to notify every single child component that it has been disabled/enabled
I've found that caching the actual components I care about, even if it's basically all child components, and using that cache to toggle the enabled state instead is much much faster
most people that have come to me about my mod have been people with lower end systems, or people that play with more than 4 people. it does really seem to compound the more people that have MRAPI suits on
would be nice to get some benchmarks from people with mid range/low end setups
can custom shaders outside of lethal company be used with a model or can i only use the builtin HDRP ones?
liltoon works with Lethal, which is how you get anime/toon shaders
can you just use it on the model and everythings fine or do you have to compile it into the dll?
Use it on the model in unity, it should compile into the asset bundle.
Make sure you use the hdrp wizard to correct your model's shaders before you apply liltoon, though.
oh cool. also, if i hit setup on a model that layed on its back when imported into blender, then rotated 90 degrees forward, its rotates back 90 degrees but the rotation of the modelreplacement is locked to i cant rotate it back
Hey folks. I'm running on terrible sleep, trying to set a gift up for a friend - custom player model etc. My issue is that when I use unity to generate the files using the API, it fails to generate the template bundle and templatebundle.manifest
I'm so tired and my laptop is so slow. Anyone just yell what version of unity you're using and I'll try a clean install with the most recent mrAPI.
In other news, the project I was using was giving compilation errors like 'Assets\Plugin.cs(1,7): error CS0246: The type or namespace name 'BepInEx' could not be found' Which I know is a critical component but I assumed that was primarily on the mod manager. I've clearly fucked something severely and just starting over. Got this working once two years ago and struggling to get back into it
unity version 2022.3.9f1 is the version you must use
and must be in hdrp if you weren't already doing that
Was in HDRP, but will try that unity version on the next attempt, thanks
Update: Had to delete and reinstall a couple things, but managed to unfuck things and get back into the groove. Bless
That's so frequently how it goes. Just another reason to hate unity
hey! i was just curious if anyone knows how to do camera height for playermodels, and how one would do it?
There's probably another mod out there that you can leverage to change camera height on your model, but it's not a base feature since it could affect gameplay.
It sucks anyways because every time I tried some of these models they had like an additional -10fps and the camera wouldn't reset to default if you swapped to a model that didn't have any camera modifications
When I worked on modelswaps I got the height changing camera to work and mostly be compatible with everything else, frame drop was cus the models were too detailed
Basically models have a delay of like 10ms before applying height change, and ondestroy resets the height change
Anyone know how to fix this? Iβm making a character mod using the Maria Kanellis model from Smackdown vs Raw 2010, but when I test it in-game the model comes out all twisted. Even the default Lethal model looks the same, both end up broken. Any ideas?
for starters are you on the correct unity version 2022.3.9f1
Yes π
Can you show how it looks ingame
does anyone know how can i add black mask/alpha texture to models? need to apply transparency to her hair and lashes
Try toggling alpha clipping on your material
i think i did but keeps the black part of the mask
Well a couple things, surface type needs to be opaque, you need to turn on alpha clipping, then go to the texture settings and enable alpha
is there any way to select all these hair skeletons at once? it's a little bit annoying selecting one by one
Hi guys! Could someone tell me what is the correct mod packaging structure in order so submit my custom model to the thunderstore?? Thanks in advance
Your root folder needs the DLL you made, README.md, manifest.json, and icon.png
If you have a suit texture to assign the model to, add plugins/MoreSuits/yoursuitname.png
The lethal mod wiki i think has info for formatting manifest
Sorry for late reply! I was able to fix it. Everything regarding that was okay, I just commited an error while taping something in the code, but now works fine. Thanks anyways!!
I dunno if this is the correct thread for it, but there's this weird thing now with Masked enemies using suits where the Employee badge is showing up recently. Not sure what's causing it
what hdrp wizar i need for apply liltoon in my characters?
I have added jigglephysics to my modelΒ΄s tail, but it doesn't collide with the ground and it goes underneath the ground. Is there any solution for this?
No
You can curve the tail and reduce gravity in jiggle physics component but there isn't a good way to make it collide with the ground
Solved, thanks!
Hello
Me and my friend are trying to import models from Fire Emblem Three Houses but we've been running into a lot of issues regarding them (eyes not having their textures, origin points being off, etc.)
It may be a long one since me and her are both trying to figure it out and we're both on the server so do any of you want me to move this into a thread or something else?
probs have to be fixed manually as not all extracts are good enough for every game especially if they using a custom engine which idk if they are
Those are always way more difficult than regular characters. I would recommend that you fix things like origin points and other geometry in blender, then after you import it into unity extract materials. After that you can match your textures to your materials one by one. I know that in some cases eyes wont' have textures. You may have to make your own, or borrow from somewhere else.
i am having a little issue with the thumbs in this model. i have seen this in other suits. Does anyone know how to fix it??
this is the rig
where should that be??
IDK, but I once uploaded a mod, attempting to hide the employee badges on the Masked οΌI'm not sure if it's still effective now https://thunderstore.io/c/lethal-company/p/hu_luo_bo_ya/Remove_Masked_Player_Level_Badge/
Could it be that it was always a "thing" and I only noticed recently?
anyone experienced textures not carrying into ingame? ive got a bunch in the same mod where the textures work just not this one, not sure why
material, and texture
though i doubt its an issue with the material/texture itself
wait no it is??? i tried putting materials from one of the other model replacements and those worked??
thats so bizarre
ill try remaking the materials
wtf is going on remaking the materials still didnt work
π
is it somehow the textures?? though that makes no sense
maybe they have a strange encoding..?
ill try saving them through photoshop under a diff name
wait
what the fuck
π
welp that uh... fixed it
my bad yall my files were haunted by the random number generator asset bundle ghosts
perfect!
damn wtf
so i added 1 more model (1mb uncompressed) and it added 13 mb to the mod size??? π
im very confused
DAMNNN okay note to self dont import the mmd instead because that 6mb model will add 26mb to the mod size
just checked, thats 1mb of it
FOUND IT
it was the normals
i set normals to calculate instead of import
11mb gone
oh interesting
i would rather not have the normals of 1 model be larger filesize than the entirety of my 30 model replacement suit mod

thanks tho! was literally checking that as you sent
couldve 100% never gotten that
So true, my mayu model was like... 60+mb or something like that because of all the blendshapes it has for VRChat lol stripped them all off and removed 80% of the file size
That's actually insane. But it gets worse. I've created a character mod before where unity decided to build a 300 mb assetbundle. I still don't know how that happened.
π
does this mod work in v73
Good to hear
mrapi the immortal mod that never breaks and works flawless 
I think I've broken it more times than game version updates, to be honest.
Hello. My sincerest apologies for requiring asistance with this mod. I followed the entire guide in the mod api and some video tutorials and overall everything went smoothly. However, when I load up the game, my character model is invisible. The annoying part is that there's no error message in any of the steps I have followed. Is there another requirement I'm missing out regarding the models or the materials/textures? Or has this happened to someone else before?
You need to choose the correct shader.
hdrp/lit or liltoon
And there should be no missing materials on the mesh.
In some cases, the skinned mesh renderer under the skeleton can also cause the model to fail to load.
Also the bounds of the skinned mesh renderer
Yep. The skinned mesh renderer didn't work but it was the shader indeed. For some reason hdrp/lit was not working. However, I downloaded the liltoon shader and it's finally showing in-game.
Thank you so much!!
https://thunderstore.io/c/lethal-company/p/hu_luo_bo_ya/SapsuckerDefaultBody/
Does anyone know if this is still needed? I've forgotton this has been in my modpack this whole time.
Hiya, I need your help fellas, I followed the video tutorial naqibam made, but when I loaded mod first it was just looking like default suit reskin and now the game refuses to start with this error. Could you help me?
The size of the DLL looks too small, maybe it didn't build the asset bundle properly?
Is it possible to replace the texture on a model without making a new unityasset? Say if I give a path in my mod for people to add their textures to, like MoreSuits does, but label them with their steamid or username and swap them out, sort of like how LethalVRM does.
` public new void SetAvatarRenderers(bool enabled)
{
base.SetAvatarRenderers(enabled);
if (((BodyReplacementBase)this).controller.playerSteamId == 76561198012800532)
{
// Replace the texture on this avatar's material for personalization.
Material mat = replacementModel.GetComponent<Material>();
// Load the image from plugins\moresuits\advanced\VoidCat_Body_BaseColor.png
Texture2D tex = new Texture2D(1024, 1024);
byte[] fileData = System.IO.File.ReadAllBytes(System.IO.Path.Combine(Paths.PluginPath, "PoikSpirit-VoidCatCompany", "moresuits", "advanced", "VoidCat_Body_BaseColor.png"));
tex.LoadImage(fileData);
// And its emissive map from plugins\moresuits\advanced\VoidCat_Body_Emissive.png
Texture2D emissiveTex = new Texture2D(1024, 1024);
byte[] emissiveFileData = System.IO.File.ReadAllBytes(System.IO.Path.Combine(Paths.PluginPath, "PoikSpirit-VoidCatCompany", "moresuits", "advanced", "VoidCat_Body_Emissive.png"));
emissiveTex.LoadImage(emissiveFileData);
// Then assign them to the material
mat.mainTexture = tex;
mat.SetTexture("_EmissiveMap", emissiveTex);
Debug.Log("renderer.GetMaterialCount(): " + replacementModel.GetComponentInParent<Renderer>().GetMaterialCount());
Debug.Log("Customized VoidCat texture applied.");
((BodyReplacementBase)this).controller.gameObject.TryGetComponent<BodyReplacementBase>(out var bodyReplacement);
bodyReplacement.replacementModel.GetComponent<Renderer>().material = mat;
bodyReplacement.replacementViewModel.GetComponent<Renderer>().material = mat;
bodyReplacement.replacementModel.GetComponentInChildren<Renderer>().material = mat;
bodyReplacement.replacementViewModel.GetComponentInChildren<Renderer>().material = mat;
bodyReplacement.replacementModel.GetComponentInParent<Renderer>().material = mat;
bodyReplacement.replacementViewModel.GetComponentInParent<Renderer>().material = mat;
}
}
}`
Is clearly not the way to do it. The code runs, but the default texture is still there. I dunno if it's getting overwritten by a later call, I'm grabbing the wrong renderer (nuclear option level of grabbing everything didn't work), or it's even the right way to swap the texture image to begin with.
My UnityProject for this one is gone (by accident), and I don't want to start over.
i have a project to do this that i didnt publish for months as i just aint got time to create tutorials for it
Hello, would it be possible for someone to show me how to make a simple model replacement mod for the game?
There are tutorials in the pins here. They're how I got mine set up.
Here's the newest one.
damn no need to ping me lmaoπ
I think at least.
Dunno how to link back without pinging, sorry. ^^;;
Thank you for the tutorials, by the way!
thank you! mb I didn't check pinneds.... 
Down at the bottom right next to the x tap/click the @on to turn off the ping on replies
Thanks!
how do I get the .fbx models from the workshop uploads?
Is there a mod or code available. Most mods I know that do texture swaps do it by loading an entirely new model in, which seems wasteful to me. Or they're not using ModelReplacementAPI, like the protogen one, or the hyena one.
its an api i made for texture swaps
it uses steam sockets to sync between people who have it so host doesnt have to have the mod to sync and stuff
Ah. Just on default meshes? That's not a terrible idea for adding client side additional functionality to MoreSuits.
I really just need to know which model/renderer is the one that is actively shown for MRAPI, as the one (actually three) I swapped the texture on does not cause the shown model in game to change. I'll do a little more digging later.
is there a list of known incompatibilities? for some reason some models i have installed make me bug out and slide to the left whenever im crouching or using an emote from toomanyemotes
no, this tends to be a model issue tho
Why do some mods that use ModelReplacementAPI not work
It doesn't show the models as models, it shows them as suits when equipping
Ok, I tested on a different profile and it works just fine, that means there seems to be an incompatibility in the old modpack and I have to find which mod does it ( I am so tired of these mods not working π )
The joy of V73 update. It broke so much. Unfortunately though it was needed. Just wait until v80 drops π we get to go through it all over again.
indeed v80 probs will break alot of mods
Is there anything known about v80?
not until either right before it drops or right asit drops
Zeekerss doesnt like giving warnings
Salutations! I was wondering if it's possible to have a custom model use a cutout shader? The model in question doesn't look quite right unless I change from opaque to cutout and adjust the alpha cutoff, but when I test it in game it seems to revert to opaque. Is there a way to fix this? I'm attaching a reference screenshot. Thanks in advance! <3
In the image texture itself I have to make sure I have alpha is set to transparency
On top of setting the material from opaque to cutout
Should be a checkbox when you select the texture itself!
Got it! Not sure what the issue was the first time, but after a couple of attempts it looks perfect. Thanks for the help! <3
Anyone know how to get modelreplacementsdk into unity? I have tried using git, and manual, but it wont import correctaly, I have unity failed to find entry points and error code 4 : Build asset version error: packages/com.bunya.modelreplacementsdk/bunya.modelreplacementsdk.asmdef in SourceAssetDB has modification time of '2026-03-25T00:09:12.0758226Z' while content on disk has modification time of '0001-01-01T00:00:00Z'
I already have reinstalled unity, restarted my computer, deleted library
I fixed it i think! right clicking on assests and reimporting seems to have fixedf it somehow
@median rain i dont know if anyone told you but this mod will probably need an update for v80
The new hand slot causes log spam with Model Replacement API. Seems to work otherwise (with my model at least). I haven't done more testing than that yet.
Lemme pull the logs and see what the spam was.
[Error : Unity Log] IndexOutOfRangeException: Index was outside the bounds of the array.
Stack trace:
ModelReplacement.Patches.LocateHeldObjectsOnModelReplacementPatch.LateUpdatePatch (GrabbableObject& __instance) (at <b2c3a9c897704bec936a49e15eb643f1>:0)
(wrapper dynamic-method) GrabbableObject.DMD<GrabbableObject::LateUpdate>(GrabbableObject)
https://thunderstore.io/c/lethal-company/p/qwcan/ModelReplacementAPI_v80/ should this be used?
Only changes I can see on there that are different are things relating to the utility slot at least there won't be anything malicious
hello hi, im trying to get a premade 3d model modded into the game following a tutorial for modelreplacementsdk and running into a problem with both the lighting and the pose. I got him in the game but any shadows make him unnaturally dark and the right arm is bent weird. this also happens in unity when i try to run it for both arms. any suggestions appreciated!
normal tpose when its not running
Mine still look okay from what i can see, but i also haven't played it fully tbh
I've made model mods in the past that have the lighting issues, but not the arm breaking. Those mods are still working on the latest version. Unfortunately I lost the source project files for those so I can't double check if there are any differences
The fact that the arms are also bent in Unity when I click the run button makes me think it's either something with the model or my settings that I'm not sure how to adjust
I have the lightling issue too, I am going to try to turn my material's shinyness down
no idea if the property is called shinyness or something else
does anybody know why, when building from unity, it just makes the cs and csproj files super fast without compiling the models to a file
ive tried with many models and on CachyOS and Bazzite so it might be a linux issue?
Do you have the model selected as prefabs in the project settings? i think you only need it under asset, but having both of these doesnt seem to hurt
Did you have any luck with this?
yea both of them have all my models in them. theyre all also tposing in the main scene and not saved as prefsabs if that effects anything
You have generate new project on build checked on?
ill try making a dummy character from scratch in a completely new project and see if it works
same thing happened. i recorded my process which took 7 minues. i used a shitty character with a weird rig but the same thing happened
https://www.youtube.com/watch?v=jovJKnqO7LI
so for me I have LC path just set to somewhere in my documents, im pretty sure thats where it tries to save the project files. if you leave it blank it should open the explorer and let you select where to save it from there
otherwise it looks like you did everything else right
youre telling me i shouldnt have the lc path be the path to lc?
i dont have it set to my path to lc π€·ββοΈ
i think the idea is its supposed to save directly to your mods folder?
damn yeah i got nothing then sorry :( i havent tried this on linux before
god damn it i dont want to buy another hard drive to reinstall windows
remaking my model seemed to get the arm working but he still looks weirdly dark when not in direct light, any way to fix that?
ok i killed bazzite and installed windows 11 in the fertile soil of its corpse and the build thing is working now
That really sucks it doesn't work on bazzite
next time you do linux try one of the arch-likes
like cachyos
it'll probably work better
Why angry studio
wrong version of Unity modules
Lethal updated some time ago to 2022.3.62
so its probs confussed about the dlls having diffirent signiture
from what the game dlls are compiled against
I have near zero coding knowledge, but I did eventually figure out how to re-reference what it was crying about. idk if I did it right though lol the assembly sharp is still mad though, don't know what to do about that
its because publicizer is making it mad but ya need it to make it convient to use
so its a warning to ignore
but ye the issue was in packages well still is where it refrencing the old version of Unity
so you can either update it though the nuget manager to version 2022.3.62 or in that text file you sent earlier where they all are listed you can change the numbers from 2022.3.9 to 2022.3.62
but ye what you did works too
i used cachyos in the video and it didnt work
but in case you use cachy and building the project works for you, it gives me sanity that the workflow is possible on linux
It was more of a general suggestion tbh
Assuming the arch-likes would be a little easier to make it work than the fedora-based bazzite
Since the former is on the bleeding edge
So they would be getting their advancements first over the fedora-based and debian-based machines
@median rain are you aware of anybody successfully exporting from unity, running on linux?
having a minor issue where mesh is not moving correctly (socks not moving with the rest of the model) anyone know of a fix? Ive tried weight painting in blender, and merging verticies to see if its just face on face and still having issue
is there any way to add a config that disables the model AND suit from being registered? as far as i can tell theres a way to exclude the model and just have the suit as a config but not both
i know more suits has a disabled suit list, maybe its possible to add/remove the listed suit there..? unsure if thats possible though
This got made to fix ModelReplacement-API for v80+ BUT - this v80 version doesn't show the players model with TooManyEmotes in third person. Always shows hands of models that require ModelReplacement API IF the config to generate a view model is enabled and sometimes the whole model is invisible or always if one uses a non-ModelReplacementAPI suit.
This stuff only applies to the v80 fix version.
Meanwhile, for the curious ones as to why v80 fix exists - the old ModelReplacement API breaks utility slot quite a lot:
- spams errors if an item inside the utility slot is being held lowering the frame rate
- causes items like the spray can, weed killer, probably the inhaler as well, to not work at all - they make visual effect, yes - but they don't use up their capacity nor affect the game, spray doesn't leave spray marks, weed killer doesn't do anything - so on, could apply to more modded items as well
- many oh many items become blurry when held by a player (like what, the game can't decide where to put the item in the hand?, 3rd image)
^^^ these three ONLY apply to the current, old ModelReplacementAPI
ahh, i love writing reports.... anyway, is @median rain actually working on this or?... should I ping the one who made the v80 fix?
bunyas not working on it rn
they just dont really have time to spend on it iirc
it is MIT licensed though so it can be forked (like the v80 fix) and hopefully it lands somewhere with active devs
@drifting flax it is then... perhaps.
Hi there! Hopefully not breaking any rules asking this. First time using ModelReplacementAPI (and LC modding in general). I've successfully gotten a character in and switching blendshapes when using emotes. Does anyone know if it's possible to make the character blink when alive? I've tried searching but all I can find are gifs of blinking cats π
yeah just add an animator somewhere on the model and make an animation for blinking
what you can do to make it stop blinking on death is add some code per suit that finds where the animator is and forces it to play a different animation (closed eyes for example)
Right. I've not made an animator before, but I'll give it a go. Thanks!
heres an example
basically i define the animator, then have an OnDeath() override where i find the animator on the replacementDeadBody
i have a trigger called OnDeath that transitions from the idle state off of it
personally i use it for tail and ear animations but you can do this same concept for anything
transform.Find looks through your model downwards like a file directory so just input what it would be for your model
That's my fork. It works (mostly), but there are some bugs that racc noted above
do u need the fork tho? I find that the OG works okay. Unless theres something I am missing w my models
I've ran into the third person emotes bug as well, but it seems inconsistent (works sometimes when I first join but then stops working after switching suits)
The OG isn't updated for v80, so it breaks when you use the new utility slot
AH
That's what I haven't done yet.
I have yet to actually play w the new utility slot sldfhlkjsdfhkl
I put the bare minimum effort into my v80 fork so use with caution
bare minimum still means a lot of time lets be real
It was like 15 minutes of work lol
Can I use the one on the base mesh? It looks like this. I've made an animation controller and an animation called "Blink".
i forgor not everyone is as dum as me tbh
I made a PR for my changes but idk if the OG mod is even still being maintained
i doubt it, i would just make a new animator and put it on the head or smth
it was literally 2 lines of code
literally i barely can code and rely on tutorials so step above me
i know bare minimum of c#
but maybe oneday ill punch out shakespere nevertheless...
Hm. I've made a new animator and blink animation. It plays correctly in Unity's play mode. When I click "Build Project" it goes through the export process but no new files are created in the project... Hm..
it wouldnt make a new file if thats what youre confused about
it would just be put in with the assetbundle as normal
These files I mean. They've exported properly now but he still doesn't seem to be blinking for some reason... I'll keep trying
if you check the animator window is the blink animation you made the default animation? and is it set to loop when you select the animation asset in the project?
I think so?
It plays properly in Play mode
Yeah that should be correct
If it's still not working honestly I don't know because that's all I did
This is what I get in play mode.
Yeah should be identical ingame
As it would get bundled with the model when you build
Hmm, well I'm out of time tonight. Thanks for the help anyhow. I'll try again tomorrow. Take care!

Hello! I'm still having issues getting the blinking animator to work unfortunately. I can't seem to use your Logger code to verify it's there either. Could I possibly screen share with you here to see if I'm missing a step somewhere please?
i am a bit busy right now but if you can share some of your code i can take a look later π, although i dont think the code would be the problem i think
Okay. I appreciate any help you can offer.
It's complaining about being unable to access the Logger. I don't have an OnDeath state yet so I'm using the OnEmoteStart function to test it.
I'm not too familiar with Unity, but I think I've spotted a possible cause for the animator not working.
If I select "Body" in the scene itself, I can see the Animator component I've added.
But if I select the Body from the Asset Drawer (after clicking the arrow), there's no Animator.
It doesn't seem possible to add an animator on the Asset drawer reference, only on the instance in the scene.
The tutorial on github shows the Model Replacement Project with a "Scene Prefabs" option.
Whereas my one says "Asset Prefabs". Maybe when I build my project, it's pulling from the asset directly rather than the one I've placed in the scene?
there shouldnt be an avatar on there
nah thats fine, youre not supposed to add it to that
thats just the mesh within the project files
nah thats normal
theyre likely using an older version of the api that had it named differently
heres how i have the logger setup in my plugin
you do have an OnDeath state, its overriding the existing state from other places in code
OnDeath is basically a function within BodyReplacementBase, which we are overriding
make sure to have base.OnDeath(); at the start so it runs the code from the original script as well
Oh I see that's in the other .cs file. I'm very new to this, apologies.
Visual Studio doesn't complain about the logger anymore. The animator still doesn't seem to be working in-game with the "Avatar" removed, nor did the Logger print to the console.
I'm wondering if this has something to do with it
if you mean from the code you sent earlier it will only run if that function is triggered and condition is false in that if as you put the logger in an else
like a null ref exception is harder to figure out
easiest way is using breakpoints via debugger
I've fixed the null ref exception. It wasn't the animator.
Actually no. I removed the Logger stuff and the exception went away. I put it back and the error re-appeared
This is my OnDeath function. The blendshapes all work correctly on death, but I'm guessing I've messed up with the logger test trying to find the animator.
oh then its your logger that isnt intialised correctly in your entry class
so the null ref is the logger as its null
Okay I've fixed the null ref logger, thanks. Unfortunately I've run out of time again this evening. Take care.
most, if not all custom model mods are broken in vr when using LCVR 1.5.0
would the shader fix described in this document by the dev have to be fixed for each mod individually?
or could an update to the api fix it?
Mrapi needs an update anyway since it breaks with the tool slot
You might be able to ask qwcan to try fixing this in the v80 fork but idk
per mod
Anyone know about adding toon shaders to models?
some of mine use some, i just found a shader online and set it up, added it to the model and thats it really
no particularly special setup
okie
depending on the shader it might look different but yea
this is what i used
if you go to unity registry in package manager you should be able to find it iirc
ive also used this one in the past:
https://github.com/lilxyzw/lilToon
both seemed to work
i love u
out of pure curiosity i wanted to try doing CTRL+A in my biggest model project
π
the results were not disappointing
π₯
I'm still having problems with getting animations to work. I took a break from the blink and tried to make a tail animation, but that's not working either.
There must be something I'm doing wrong in Unity
Apologies for asking again but I'm a bit out of my depth here. Could I screenshare my unity setup with you if you're not busy please?
i should be available now to take a look
Thank you! I'll hop in one of the chatting channels
I use that for some of my vrchat models 
Trying to figure out why my stupid model isn't working
[Error : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ModelReplacement.BodyReplacementBase.LoadModelReplacement () (at <b2c3a9c897704bec936a49e15eb643f1>:IL_002C)
ModelReplacement.BodyReplacementBase.Awake () (at <b2c3a9c897704bec936a49e15eb643f1>:IL_0057)
UnityEngine.GameObject:AddComponent(Type)
ModelReplacement.ModelReplacementAPI:SetPlayerModelReplacement(PlayerControllerB, Type)
ModelReplacement.PlayerControllerBPatch:ManageBodyReplacements(PlayerControllerB)
ModelReplacement.PlayerControllerBPatch:ManageRegistryBodyReplacements(PlayerControllerB&)
GameNetcodeStuff.PlayerControllerB:DMD<GameNetcodeStuff.PlayerControllerB::Update>(PlayerControllerB)```
I setup my model, I click build project. I open the Mayu.csproj and click rebuild, I then select everything here and zip it, load it into Gale as a local mod.
If there's any ModelReplacement pros out there β€οΈ i'd super appreciate the help
im not a pro but id check to see if asset name is correct in the code
isnt it plugins/moresuits?
o shit u might be right
but also it is a null ref error so not sure if it would be because of your suit missing depends on the code that assigns it i guess
That fixed the suit not appearing on the rack, but the model isn't replaced π
well ye you have a null ref error
did you forget to tell unity to include the model in the bundle?
as null ref can be as little as a missing required value
but in your case it seems to say something about invalid assetbundle
This is the project settings
so stuff must be missing in it
The prefab is referenced and everything's there
ye that dont tell me anything xD
then idk what to do π I followed https://github.com/BunyaPineTree/LethalCompany_ModelReplacementAPI/wiki/Using-the-Unity-Workflow basically everything here
So unless it's outdated, things are broken or I did something wrong, i'd have no idea
what i say lets add AssetBundles Browser to check if everything is getting added first
its made by Unity themself
you can install it using the git url via the package manager in Unity if you used that before
doing that right meow
I clicked Build again, and opened the browser and this is what it shows
meanwhile im having an odd error myself tbh
lmfao
bc it keeps erroring when I try to add a second suit
to me it looks okay i guess
when you run rebuild project does it actually replace the bundle in the project path?
well build project
I get this in the output
[Info :MirrorDecor] Plugin MirrorDecor is loaded!
[Info : BepInEx] Loading [ModelReplacementAPI 2.4.19]
[Info :meow.ModelReplacementAPI] Plugin meow.ModelReplacementAPI is loaded!
[Info : BepInEx] Loading [MayuModel 0.1.3]
[Info : Console] Mayu.MayuBundle
[Error : Unity Log] ArgumentNullException: stream
Parameter name: ManagedStream object must be non-null
Stack trace:
UnityEngine.AssetBundle.ValidateLoadFromStream (System.IO.Stream stream) (at <60c13874e0e045b59e9d86f24a2d5c95>:IL_0009)
UnityEngine.AssetBundle.LoadFromStream (System.IO.Stream stream) (at <60c13874e0e045b59e9d86f24a2d5c95>:IL_0001)
ModelReplacement.Assets.PopulateAssets () (at <99508100641b41a2ab02c93a652654d3>:IL_004B)
ModelReplacement.Plugin.Awake () (at <99508100641b41a2ab02c93a652654d3>:IL_0012)
UnityEngine.GameObject:AddComponent(Type)
BepInEx.Bootstrap.Chainloader:Start()
UnityEngine.XR.Management.XRGeneralSettings:Awake()
[Info : BepInEx] Loading [More Suits 1.5.0]
[Info :More Suits] Plugin More Suits is loaded!
ye its failing when it gets to the loading part
to load the assetbundle
in the code for actually loading it is the names correct?
Could it be Assembly-CSharp looking angry? Or would that be unrelated.
nah thats fine its the publicizer making it look mad
if it helps we can go into the chatting vc and you can just sharescreen the project
might be easier like that
if u havent, u can also go thru this tutorial rq, https://www.youtube.com/watch?v=Wnobg8zFFK0&t=1707s
ModelReplacementSDK Tutorial - https://github.com/BunyaPineTree/LethalCompany_ModelReplacementAPI/wiki/Using-the-Unity-Workflow
Package URL - https://github.com/BunyaPineTree/LethalCompany_ModelReplacementSDK.git#upm
ModelReplacementAPI.dll - https://github.com/BunyaPineTree/LethalCompany_ModelReplacementAPI/releases
MoreSuits Mod Page - http...
it still holds water now, and i use it as a refresher
It's looking for this, and putting it in the DLL, right? is it case sensitive?
Because the DLL is the same size as that asset bundle so... i'd assume it is being properly put in the mod
i dont understand how yall can get toon shaders to look good. i legit cannot tell
@median rain i dont see anything breaking realy but these are being spammed every time i hold a utility item (flashlight weed killer etc)
Will this get compatibility with cadaver blooms?
probably not
i think even the sapsucker still just spawns the default body when someone gets killed by it
If anyone was following my woes with getting animators to work - this was the fix. Installing the asset bundle browser revealed that my animations weren't being auto-packaged into the asset bundle. I was able to select the animations and manually add them to the asset bundle (in the bottom right corner of the screen).
Thank you for that π
ive been warned about this and am surprised it has not happened to me yet
is it a replacement or do i need the original?
Replacement
I submitted the changes as a PR to the original, but who knows if they'll be accepted ever
i pinged bunya so it should sooner or later
I wouldn't be so sure, last message was 6 months ago
rip
Congratulations you are now the maintainer
gonna look into this im guessing that it works the same(?) with models that we set up codewise and DLL wise?
jdhlkasjf
Have fun fixing the issues with this api

It's identical to the original other than two lines of code to check for the tool slot
It doesn't fix any other problems with the move to v80, just the errors when using the tool slot. There are still issues with other things, for example TooManyEmotes
o7
possible dum error on my end but I keep getting this message for one of my suits. Everything looks ok in code (no errors) and the asset bundle built correctly. It went from working to not working
an argument is null
so a paramter isnt set
paraneter*
which one is it. it dont say
also when coding your own stuff for the game when you build it you should also get a .pdb file if you throw it along side your dll into the mods folder and it errors out because of your code it will tell you which line π
i love u
some people have it set to embedded so its just included by default inside of the dll btw
but it wont give you the answer every time xD
no error w that so its gotta be something in unity that im missing
IT WAS IN UNITY
nvm i did forget something in unity but its still throwing same error.... i spoke 2 soon....
i just deleted the model entirely and remade it and that fixed it lmfao
probably something to do w the jiggle physics that I added but idfk it works now
do you have to use the old unity version from the tutorial or the newer one? i was thinking about making something again but its been a few months
I'd use the newer one. It seems to work just fine imo
old unity version had some security issues
what version was that again?
looks correct?
i was so close to making a newer tutorial just for the sake of it
its so hard to understand this guy
can it be any 2022 version?
in the video it is 2022.3.9f1, you mentioned 2022.3.62f2, i got f3 and the latest 2022 version is 2022.3.75f1
well i guess ill just fuck around and find it
f3 should work for you only difference between f2 and f3 is a UI fix if i remember from the changelog
which is editor only
ye doult either of those should cause you issuses
those 2 things are only differences between f2 and f3
this fork doesnt work properly with too many emotes
models are invisible when emoting
models are visible with the original mrapi
Β―_(γ)_/Β―
I've been doing some experimenting today (fighting tooth-and-nail with Unity) to make my character's eyes not static
Works about 80% of the time. I think it makes a big difference :3
Damn howd you do it??? That looks awesome
I needed to convert the character to a prefab first, which allowed me to add an empty object to the bone hierarchy. I called "LookAt" and parented it to the neck bone. On both eyes I added an "Aim Constraint" component and hooked them up to aim at the LookAt object. I moved the LookAt object to eye level and forwards a fair bit. This gives the eyes some movement during animations, because they're looking ahead at an object which moves similarly but not exactly the same as the head bone.
I just got voice working on a blendshape too! The shape affects the mouth and the cheek tufts for some extra movement
I gotta try that sometime. For real its so cool!!!
Ough my model's jaw will not move and everything looks correct, but I am also getting an error [Error :meow.ModelReplacementAPI] Could not set all model scripts. Error: Object reference not set to an instance of an object
so I wonder what I am missing. Path looks correct in unity too
maybe i mispelled something?
looks like 1 word was misspelled lmfao
too bad the model looks like this tho, with zero movement
gonna try playing with weight painting and see what happens
I also wanna try adding blinking tbh bc the concept sounds so cool
Still twisted.... Anyone have an idea why?
It 'opens' correctly, just not closing right
....setting start to 0f fixes it, but then it doesn't open.... i forsee a lot of toggling...
Every time I see models do this kind of stuff with blinking eyes and moving mouth it's like an additional -20fps wich is why I never realy looked into this (idk how this can even destroy performance this much but it's what I observed)
prob cus a lot of them run in update and set rotations every frame
i did it with coroutines and using the blendshapes instead of rotation/position
granted idk if that helped at all
but its pretty hard to measure these
cus unless you package the exact same model and just have one of them not do the blinking code theres too many factors to take into account
biggest one being a variance in tris/poly count
also if a model has physics objects
those slow the game down a ton
I usually compare my fps to the default suit, - 20fps compared to the vanilla suit is average, suits with just 1 addition tend to have - 40 fps, I've had very rare occasions where I even saw - 50ish fps
Wich is fine solo but in a group of 5 ppl is kinda unbearable even tho the performance hit doesn't stack up like that
Do not put on HSR sparkle model at 3am (-120 fps)
I remember alot of the genshin models doing - 40 fps simply for changing the camera height for smaller characters
I was looking into adding sounds to being damaged to my models in the past together with a friend who knows coding and a some help from here but I never actualy bothered trying it after seeing how poor models run that have any kinds of additions
I prefer the better performance while also doing less
I had ran some tests by patching out some of the expensive stuff in this api mod, some had gains but i didnt feel they warrant the visual trade off/unmotivated as well at the time, I ended up removing them without diving deeper
Also now you can't even disable the shader for each model anymore since zeekers fixed the shader
Now all my models look dirty
Ugh
nnmm im pretty sure theres a way
I also dont, but the lethal star rail creator has found a way if the configs to be believed (I havent tested or played). They dont seem to be in the server, or if they are, theres like 15 people with the same name
I bet this just toggles the option we have in unity wich stopped working
When was this added?
when it got updated to v81

I think. I never paid attention, i had only downloaded this mod for testing purposes with unity camera layer hellzone
Best of luck, im caught up with other stuff right now but ill keep an eye out for your resukts
Wait that's possible?? Would you happen to be able to name one so I can take a look at how they did it 
Though I'm a bit concerned if that fps is true lol though I can't see how that could be the case
I can check when I'm home
Much appreciated!
I dont believe that would be the cause of the fps drop but thats just my belief. But changing height can come with its own quirk of issues
that would be ideal, the quirks im thinking of are erm, unable to climb ladders due to being too small, not sure how this happened but it fixed itself after reloading the lobby, second one, small visual bug with items that have canvases on them
Also for ladders do you mean if the ladder is suspended above the player? I assume with this method the grab position comes from around the camera
Otherwise I can't see not being able to reach the ladder at all but maybe I'm missing something
not really something 99% of items have to worry about to be honest, they look normal on the floor/with normal sized player model. ive tried fixing this with a few methods i came up with, but i dont really know what to do about it
Ah yes this was also an issue now that i think about it as well
but no, it was every single ladder, even the one on titan but did work when i swapped to someone... larger
BUT only happened twice in all my... short time using it so im not sure if its too valid of a worry
but the interaction being disproportionate to where youre actually looking is a real thing
Interesting okay I'll mess around, thanks for the insight!
Personally I'm fine with the debuffs as long as it's clear what's happening
It's only if something isn't working that feels like it should that's an issue
I see that, i agree with you with you under the context of this mod anyway. the only true issue is the hit to performance, it is tolerable but it can be real brutal
Yeah that I'm most worried about
Especially since I've already gotten performance reports without that feature despite my mod being very light
i did this with some models i did
ill pull up the code
oh boy lets see if i remember how these work
CameraVisuals.cs
using BepInEx;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using ModelReplacement;
using UnityEngine;
namespace CamVisuals
{
[BepInPlugin("MRCameraVisuals(name)", "(name)", "1.0.0")]
public class CameraVisuals : BaseUnityPlugin
{
private readonly Harmony harmony = new Harmony("CameraVisuals(name)");
private static GameObject gameObject;
private static CameraVisuals Instance;
public static Vector3 baseSize;
public static ManualLogSource mls;
private static bool usingCameraVisuals;
private static bool terminalDisable = false;
private void Awake()
{
if (Instance == null)
{
Instance = this;
}
mls = base.Logger;
harmony.PatchAll(typeof(CameraVisuals));
mls.LogInfo("CAMERA HEIGHTS LOADED");
}
public static void DetectCamera(PlayerControllerB player)
{
gameObject = player.gameObject;
Transform childTransform = gameObject.transform.Find("ScavengerModel").Find("metarig").Find("CameraContainer");
if (childTransform != null)
{
GameObject childObject = childTransform.gameObject;
if (gameObject.GetComponent<MR(name)>() && !usingCameraVisuals)
{
gameObject.transform.Find("ScavengerModel").Find("metarig").Find("CameraContainer")
.Find("MainCamera").Find("HUDHelmetPosition").localPosition += new Vector3(0f, 0.005f, 0f);
gameObject.transform.localScale = new Vector3(1f, 1.185f, 1f);
usingCameraVisuals = true;
}
}
else
{
CameraVisuals.mls.LogInfo("Child GameObject not found.");
}
}
public static void StopUsingModel()
{
usingCameraVisuals = false;
}
[HarmonyPatch(typeof(Terminal), "BeginUsingTerminal")]
[HarmonyPostfix]
public static void DetectCamera2()
{
PlayerControllerB local = GameNetworkManager.Instance.localPlayerController;
baseSize = local.gameObject.transform.localScale;
if (!terminalDisable && usingCameraVisuals)
{
gameObject.gameObject.transform.Find("ScavengerModel").Find("metarig").Find("CameraContainer")
.Find("MainCamera").localPosition += new Vector3(0f, -0.31f, -0.018f);
terminalDisable = true;
}
}
[HarmonyPatch(typeof(Terminal), "QuitTerminal")]
[HarmonyPostfix]
public static void ResetCamera()
{
PlayerControllerB local = GameNetworkManager.Instance.localPlayerController;
if (terminalDisable && usingCameraVisuals)
{
gameObject.gameObject.transform.Find("ScavengerModel").Find("metarig").Find("CameraContainer")
.Find("MainCamera").localPosition -= new Vector3(0f, -0.31f, -0.018f);
terminalDisable = false;
}
}
}
}```
then add this to Start() in BodyReplacements.cs
```cs
if (childTransform != null)
{
GameObject childObject = childTransform.gameObject;
if (!usingCameraVisuals)
{
usingCameraVisuals = true;
Task.Delay(50).ContinueWith(t => CameraVisuals.DetectCamera(player));
}
}
else
{
CameraVisuals.mls.LogInfo("Child GameObject not found.");
}```
where usingCameraVisuals is a public bool taken from Plugin.cs
this should be right
iirc this code got a performance improvement passed in CruiserImproved because it was setting camera position every frame even when not in the cruiser
Okay yeah something like that I would expect to impact performance I just didn't think it'd actually be coded like that
this code itself shouldnt be that bad on performance since it runs in Awake and postfixes terminal stuff
Sweet
i guess the others run in update or something
who knows tbh, the star rail models probably have shitloads of polys because mihoyo
and id think with so many of them in a pack theyre probably not decimated
The blendshapes too can get steep quick
My Uma model extractions take over 100mb each with them on
But disabled is under 1mb
Not sure why exactly
yea i guess because it has to include every variation possible by the blendshapes?
beats me
the models i worked with had the cam code, blendshapes, high poly model, physics objects, and voicelines
idr how bad perf was but this was in liek v69 and i tested in a profile with no performance mods and imperium enabled
yup
I didn't notice a performance hit with my model. I ran with a crew of 6 yesterday and we all tried it at once. Seemed fine.
The only thing that didn't work was setting blendshapes for emoting. Works fine locally but over a network game my friends didn't see it
^genshin models guy also figured out a way to make the models clean again
performance hit is also not as big as it used to be but its still there
i tested this one just now
can use any model mod from him tho
clean
he also fixed some other issues that used to exist back then
like the camera not resetting when changing to a model from a different mod that doesnt have a custom height
it resets now wich wasnt the case in the past
i do wanna know how he got the models clean again
@brisk wagon its the question everyone is asking, ya mind sharing
ye the HSR mod reduces my fps by 50
from 200 to 150 in orbit
not even comparing to vanilla suit and rather to another modded suit from myself

but the hsr models are also clean
@long briar I had to go through and change all my materials to transparent and mess around with some render queue stuff- still working on getting all the suits looking clean again
can you write it down in more detail at some point throughout the week? atleast the render queue stuff
Uhh, I've been switching my models over to use the Unity Toon Shader from my previous setup, which just has an option to set it at a value. Transparency starts to kick in at 3000, so I've been setting all my materials to that, or 3100 if they still need some additional transparency.
If your shader setup has an option for z-write I'd try enabling that as well so that the models are transparent by technicality but you can't actually see through them
something like this? just need to figure out how to reference the player
Probably GameNetworkManager.Instance.localPlayerController
But honestly I forget when bodyreplacementbase gets created it's been so long
ah yea makes sense
not really sure what getting "childObject" does here

i guess just making absolutely sure it doenst run multiple times..? though its a start function so idk how it would
also rewriting how i do BodeReplacmeents.cs since having 79 suits is getting tiresome
idk why i didnt do something like this sooner
well ig that assumes this works
instead of having massive blocks of code for every suit just call one other class that handles everything and give it the necessary info per suit
is this configured for like a suit by suit basis?
hmmm okay i got it to adjust height successfully but just for the first suit you try on, which i think is an issue mentioned here ^ i think i know how id fix that but im unsure what exactly is going wrong here
theres really not much im seeing that can return null
and the fact every suit works perfectly until you try on a different one is interesting
actually where is usingCameraVisuals even set back to false
actually why does that bool even exist

and why does every .Find have many nested .Finds instead of just one path
DetectCamera is such a cursed function lmao
my only guess is maybe it was designed as an update function or smth kinda thrown together
but when ported to a single call all the code was kept
actually
maybe this camvisuals thing is persistent so when i grab a new suit that bool stays the same
so id need to call this function to reset the bool
is my assumption? 
but even then idk why it would return null somewhere

hm im not sure what i really did but i cleaned up the code a bit and now its not erroring so uhh
ill try adjusting some heights and see if it seems to work
okay interesting
i have learned that the position actually does absolutely nothing
its the scale that controls everything i think?
confirming rn
oh wait
OHHHHHH
ITS FOR THE HUD
DUH
gonna try this code
basically each suit i have a float representing the models approximate height, relative to the base player model which i am assuming is 173cm because i said so
based off that we do some automatic calculations to infer the models scale relative to the defualt suit
luckily i already set up a measuring tape in my project for exactly purposes like this lmao
i scaled it so it aligns with the default player model on 173cm, so that i can scale every other model accordingly
in theory this means i can automate all of the height based code with just a float that represents the models height
game changing for some of my models tbh
i rely on a camera adjuster mod to manually do it
ngl didnt know there was a mod out there for it
π
im still trying to get this to work though im adjusting values for the hud
tbh tho its a lot easier if its just built into the models cause u have to manually toggle the camera until it fits ur model size
so imo still gamechanging stuff
OH OKAY i figured out the math
so the Y position is default set to -0.05f, the scale needs to lower that value the higher it is
so i need to do some funny math fuckery
basically we can do this by dividing 1 by the model scale BEFORE mutliplying the -0.05
to inverse the direction the scaling goes
the only problem using this method for anyone else curious is you need to know how large your model is proportionately to the player models height that i made up
fuck nvm thats not right LMAO
i somehow made the most accurate helmet vision mod ever
by accident
wondering if adding blinking means I can't have mouth movement anymore tbh
you can have both
goddd why wont it worrrk then
maybe im forgetting a bracket
somewhere
or it could be the fact that i need to revise cause there are multiple models
tutorial didn't specify adding more than one lmfao
i couldnt get the harmony patch part to work for whatever reason so i just rewrote it like how i usually do patches
i think ive got it all in a good state now for the most part, the hud looks ever so sliiightly off when using a model at a very different height but thats not that big of a deal imo
and i can always fix it later if i figure it out
the magic of making functions like this is if i ever want to adjust something i only need to adjust it once in that little function, rather than in like 80 spots for each individual suit
cannot get these damn mouths to move
oh my fucking god my mic has been off this whole time
somehow its inverted toooo wadda hell im cryinhg
Send me the measuring tape now
I mean Please
uhhhhhhhhhhhhhhh
heres the stock image i stole off google
and heres the material settings i set to crop it because i couldnt be assed to edit the image in photoshop
scuffed position/rotation/scale to get it roughly aligned in an empty scene for player model testing
Lol, thanks
saving lives
i have to see about copying ur POV code and getting my signalis models to be biblically correct.
public class ModelReplacementManager : MonoBehaviour
{
internal static void OverrideStart(Vector3 cameraLocalPosition, float modelHeight)
{
if (Plugin.cameraAdjustEnabled.Value) //only make camera adjustments if the player has the config enabled.
{
CameraVisuals.DetectCamera(GameNetworkManager.Instance.localPlayerController, cameraLocalPosition, modelHeight);
}
}
internal static void OverrideOnDeath(Transform replacementBodyTransform, string headAnimatorPath, string tailAnimatorPath)
{
if (replacementBodyTransform.Find(headAnimatorPath).gameObject.TryGetComponent<Animator>(out Animator headAnimator2))
{
headAnimator2.SetTrigger("OnDeath");
}
else Plugin.Logger.LogError("Head animator not found! Please report this and provide the log, thank you! <3");
if (replacementBodyTransform.Find(tailAnimatorPath).gameObject.TryGetComponent<Animator>(out Animator tailAnimator2))
{
tailAnimator2.SetTrigger("OnDeath");
}
else Plugin.Logger.LogError("Tail animator not found! Please report this and provide the log, thank you! <3");
}
}```
i have this in my BodyReplacements.cs
using BepInEx;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using ModelReplacement;
using UnityEngine;
namespace CamVisuals
{
[BepInPlugin("MRCameraVisuals(name)", "(name)", "1.0.0")]
public class CameraVisuals : BaseUnityPlugin
{
private readonly Harmony harmony = new Harmony("CameraVisuals(name)");
private static GameObject gameObject;
private static CameraVisuals Instance;
private static float currCameraLocalScale;
private static bool terminalDisable = false;
private void Awake()
{
if (Instance == null)
{
Instance = this;
}
harmony.PatchAll(typeof(CameraVisuals));
}
public static void DetectCamera(PlayerControllerB player, Vector3 cameraLocalPosition, float modelHeight)
{
float modelScale = modelHeight / 173f; //basically we input the characters height, then divide it by the default LC height (173cm because i said so) to get the characters height relative to normal.
gameObject = player.gameObject;
Transform childTransform = gameObject.transform.Find("ScavengerModel/metarig/CameraContainer");
if (childTransform != null)
{
Plugin.Logger.LogInfo(gameObject.transform.Find("ScavengerModel/metarig/CameraContainer/MainCamera/HUDHelmetPosition").localPosition);
Vector3 newLocalPosition = new Vector3(0.01f, -0.05f * (1 / modelScale), -0.05f); //we grab the default local position and multiply it by our scale, moving it automatically based on how tall we can gather our model is.
Vector3 newLocalScale = new Vector3(modelScale, modelScale, modelScale);
currCameraLocalScale= modelScale;
gameObject.transform.Find("ScavengerModel/metarig/CameraContainer/MainCamera/HUDHelmetPosition").localPosition = newLocalPosition;
gameObject.transform.localScale = newLocalScale;
}
else
{
Plugin.Logger.LogInfo("Camera Container not found!");
}
}
[HarmonyPatch(typeof(Terminal))]
internal class DetectCameraTerminalPatch : MonoBehaviour
{
[HarmonyPatch(typeof (Terminal), nameof(Terminal.BeginUsingTerminal))]
[HarmonyPostfix]
public static void DetectCamera()
{
PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
if (!terminalDisable)
{
((Component)localPlayerController).gameObject.transform.Find("ScavengerModel/metarig/CameraContainer/MainCamera").localPosition = new Vector3(0f, (-3*currCameraLocalScale)+2.95f, -0.05f);
terminalDisable = true;
}
}
[HarmonyPatch(typeof(Terminal), nameof(Terminal.QuitTerminal))]
[HarmonyPostfix]
public static void ResetCamera()
{
PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
if (terminalDisable)
{
((Component)localPlayerController).gameObject.transform.Find("ScavengerModel/metarig/CameraContainer/MainCamera").localPosition = new Vector3(0f, 0f, 0f);
terminalDisable = false;
}
}
}
}
}```
and this is the new script CameraVisuals
public class SILENCESUZUKA : BodyReplacementBase
{
protected override GameObject LoadAssetsAndReturnModel()
{
string model_name = "SilenceSuzuka";
return Assets.MainAssetBundle.LoadAsset<GameObject>(model_name);
}
protected override void Start()
{
base.Start();
ModelReplacementManager.OverrideStart(new Vector3(0f, 0f, 0f), 160);
}
protected override void OnDeath()
{
base.OnDeath();
ModelReplacementManager.OverrideOnDeath(base.replacementDeadBody.transform, "pfb_bdy1002_00/Position/Hip/UpBody_Ctrl/Waist/Spine/Chest/Neck/Head", "pfb_bdy1002_00/Position/Hip");
}
}```
heres an example body replacement in BodyReplacements.cs
Did u actually get this working
I think that was left over from my blendshape shenanigans idk
mostly
the camera gets a little funky when entering the terminal (i havent perfected the formula yet), and when you swap to a suit that doesnt have this camera functionality it doesnt revert to normal
Hm
both these problems make sense i just havent found solutions for em yet
Have you tried just undoing the scale and position edits in the suit destroy func
When I think abt it, it would probably be worth to store the values somewhere else and then call them as vars when u do the changes
To make the code more copyable
yeah
/easier to experiment
can store in plugin
actually
if its just restoring to default i dont need to
because default isnt gonna change
unless you mean having the default be a variable somewhere else and call that
which makes sense thats what im gonna do
that wont work if you go from one modded to suit then another then to a default suit
as itll just use the previous modded suit no?
Na
or do you mean very very beginning awake
The awake where it applies the height change
Take those values and do the negative kf them in destroy
Maybe prefix instead of postfix to make sure it works before doing the new suit
that wont work like i said though if you go from a custom height suit, to another custom height, to a non custom one tho
as itll restore back to the first custom suit
Hum
I wonder why
Ohhh wait
I do remember just making an actual reset
That was dependent on switching to suit id 0
Forces vanilla values
I guess you could force default in the destroy func and see how that goes
are we thinking of diff problems cuz im thinking when you swap to any suit that isnt one set up with my specific functionality
Yeah
I think i did per-suit reversing on my attempt and it wasn't working
So i made the orange suit reset to defaults
Maybe it would just be better to make each suit reset to default before putting the new one on
definitely
most players wouldnt know to swap to orange suit first, and some have it disabled entirely (like me)
somehow i broke the entire mod again and nothings working

hmmmmm
OH WAIT
IK WHATS GOING ON
the config i declared i didnt bind
completely forgot you have to do that
Btw if u get this working consistently do you think you'd upload it separately like a library so other mods can use it
im ngl i have no idea how to do that
ive never considered something like that
π
generally im the one just yoinking other things
sounds like i have to learn stuff about shaders to clean my models again 
ive never used the toon shader to begin with
okay done this seems to work
now regardless of what suit is put on next, the camera position and model scale is reset to default (in the case it is a custom model that has those properties, they will be overriden right away)
me either and idfk what im doing lmao
i dont even like the shader tbh
but if it makes my models clean i guess ill look into it
idk how i look into it but ill figure
honestly for most of my models i like the default shaders as it makes them blend with the game better
exactly
i do like glossy looks
and the games i take models from also run a more realistic shader compared to other anime like games
this is better than what i managed lol
on mine there was always 1 frame of default heigh before switching to the new one
thats because of the delay that was set
so it was swapping to default then after a delay swapping to the new height
i removed the delay because the ondestroy is being called first anyways
ah
i think i set that because the heights were just stacking instead of setting correctly
doesnt matter if you just do set instead of additive
Ah yeah, the toon shader was just an example of my current approach to try and get them more Genshin-like. If you're using shader graph or smth I think you should be able to just set them to transparent in the main graph inspector, same if you're just using a basic material. Sorry I can't help more, I've been completely learning as I go with my suits ;-;
well i generally dont know anything about shaders so that sounds like an adventure
having an issue with mouth movement on the model, for some reason it is crooked? fixing the initial and max opening does not seem to fix
its almost like i need to correct more than that. in blender though it works just fine as intended...
Girl looks like shes chewing gum T0T
btw did you make this an actual add on, or should i just yoink what you posted above?
its just in my project, it isnt really finalized
i havent tested much and i know using the terminal is jank with tall models
iirc it also breaks the camera completely on any model that isnt mine havent fixed that yet
remember there a bit to it when its comes to modding in games too π
as some shader features might be outright disabled for the game you trying to use it in
so then it requires using a different techinique or adding custom stuff to re-enable said feature but i dont think Lethal stripped out much
but ye make sure its a HDRP compatiable shader π
this is for lethal case atleast
anyone know how to get toon shading so clean in lethal?
@eager mural I decided to give it another shot, gave up and was like.. frick this and deleted the whole visual studio side of my project, before building the project again, made sure every thing that had my model name, was the same, even capitalizations lmao -- I built it, re-referenced the bepin and unity crap, built it... and it loaded in LC with no problems π π π
Run into a new issue, when updating another one of my mods, I get this when having both mods
[Error :meow.ModelReplacementAPI] Cannot register body replacement type ModelReplacement.MRMAYU, suit name to replace default is already registered.
[Error :meow.ModelReplacementAPI] Cannot register body replacement type ModelReplacement.MRMAYU, suit name to replace orangesuit is already registered.
[Info : mayumodel] Plugin com.wolfgang.mayumodel is loaded!```
Switching to Mayu just makes my playermodel default but with the mayu suit texture, same as my new one, but with their suit texture 
Okay, I figured it out. For some ungodly reason, all new suits you make with the latest thing that generates these configs, tries to patch Default,Orange Suit. If you have more than 1 of these mods, they conflict and break. So you need to make it point to itself.. why it doesn't do that by default is beyond me lol
when shipping the mod you can include a default config or edit the code so thats the default
but i think the reason is because you can have multiple suits in one mod
but ye i didnt really look at what it generates nor how
but i did patch mrapi for one of my mods but ye
Until I learn how, I just ship my suits with a notice in the readme to change the config to what it should be ;3;
i managed to poke bunya yesterday and hes atleast aware now that mrapi needs a small update
but also he sounded very busy and not very available
replying to me alone took him like 3 days 
you just add the config folder with your config for the final shipping
and it will just use that instead of generating one
So truuuuue
Anyone know what could be causing this? It's been plaguing me with the last 2 models i've tried building. I tried deleting the Library folder and let unity re-import it, which fixed the first model doing this annoying error, but that didn't work with this one.
I believe you created 2 assetbundle defines with same name so its screaming at you
Idk what that means
Can you show me an example?
this stuff
Oh! I'll have a look when I'm on my computer
I recommend adding AssetBundle Browser to your Unity if you dont have it makes a bit more user friendly imo
it gives you this panel which you can just right click delete the unwanted ones while the default thing in Unity is.. clear all refs manually to the bundle and hit Remove Unused Names..
So I nuked everything, made sure there was no bundles with the kobold. Enable Generate New project and it gives me the same error 
lmao if I click build on the Asset Bundle Browser with the director set to where I want my asset to be built, it works just fine. Using the SDK build button doesn't work xD
So, in the Asset Browser, I had to rename it there, and build for it to build lmao -- then I rename it to the proper name before turning it into a DLL
Did anyone figure out what causes the belt bags to bug with this mod?
This is like the error it spams when I'm holding the belt bag but I've no idea what it means
The bug seemingly happens when you pick something up with an "open" belt bag. It causes the bag to break and you can no longer open it
My friend said it's the new utility slot that bugs the bag. If it's in one of your normal 4 slots it works fine
Nvm some goat made a hotfix β€οΈ #thunderstore-releases message
How do people include 2 different model replacements in 1 mod? I wanna setup a cat and bunny version of basically the same model but as 2 seperate suit choices
put both of the models in the same assetbundle
it should be a drop down in the bottom right
both models in the same assetbundle?
ye
You mean like, have both the models in the same scene?
This look right?
Alright, so I built it. Have 2 seperate suits on the rack with the respective names. But they both just turn me into the bunny model
Sniffing in the built assetbundle, it has both prefabs in it with all of the assets
You can choose not to use Config
If you don't use other functions, you can do it like this:
@obtuse nebula
I have no idea what i'm looking at, i'm not a coder
lmao
Sorry, just woke up about an hour ago and had to do some stuffs

I have a super smart coder friend who was able to fix all that up!
This was the plugin.cs β€οΈ
Why can I not get emission to work on the HDRP/Lit material? It's showing on the material, not on the model
So, the emissions don't appear in-editor but they appear in-game. however, they don't actually glow in the darkness
if you have UnityExplorer installed you can mess with the material at runtime like turning up its Intensity to see if that helps
as i suspect maybe your Emission Intensity is too low
try values between like 50-500 for it lmao
or also this
wait you are wolfgang? cool
π
So, I got the emission to show up in-editor by setting Exposure weight to 0, but it still doesn't glow in-game 
i tend to do it like this
I'll give it a shot
set the nits to like 10 and then test
So, I mimicked your settings, still nothing π’
You might roflamo, so the emissions were workikng the entire time, it just doesn;ts show up in the mirror for some reason. Had a friend download my debug modpack and add the mod locally... and it glows
wooooo
that mirror is evil
thats why you confirm it using more than just one thing π
I expected the mirror to act like a mirror π
well its a camera that renders its view onto a texture
it just has some camera setting disabled that stops the emission glow from rendering
probs for performance reasons maybe
or a oversight
some mods add combatiablity to mirror mods by tweaking its camera settings to enable the stuff they need π
but that is via code
That mirror is a nightmare and has a stupidly long range with no framerate cap that renders even when youre not on the ship
When's someone going to fork that mod and unfrick it
ive capped it and disabled the camera when not on ship in nichetweaks
Yoooo ModelReplacement got an update!
Finally β€οΈ
Cute models btw uwu
It won't let me compile, do you know what the problem might be?
I created a template.
None of those should stop you from Building.
Something else is stopping you from building the DLL.
in Terminal just type dotnet build
thank you
When I try to add what you see selected, I get an error. I don't know why. I'm still learning.
aka no permission in that folder to do stuff
and should have asked in #dev-general would have gotten an answer faster
for anyone else with model replacement mods that exceed the moresuits limit, do you just add some info on your mod page that suggests to increase the limit? or have you found a way to make your mod increase the limit automatically?
the only other mod i can think of that has that many model replacements is the star rail mod lol
i think they just tell u to increase the max suits idk
you could include a moresuits config with a higher max suits but thats a bad idea
There's a mod that adds pages that I find works well though haven't been on in a bit
Because otherwise moresuits just crams them all on there until they overflow the rack and start floating
i use that already but i have 100 suits which with the vanilla suits exceeds the amount of suits moresuits can register by default
when it overflows the 100 the rest are ignored, but you can adjust the cap in moresuits config
Ah, admittedly haven't reached that point in the number of suits myself lmao
yeah i didnt even know there was a cap myself until i hit it
it looks really funny all together in the editor
π
oh.. oh my god...
Lord
MORE
throwing this here but i was making a suit for higgs from DS2 and wondered if anyone else wanted chars from the game included
Also for some reason in lethal the hair mesh is stretched but in unity and blender he is normal when I pose/move the mesh
found out the parenting was wild on the armature
hello! i've been told to ask here, i don't know if someone has already talked about this before because i couldn't find anything but is there a way for the model on the right to look like the one on the left?
these are screenshots from february vs today, and the shadows affect the models too much to my liking but removing/keeping post processing does not change anything
okay so i encountered a weird bug where literally no matter what i do this code seems to run for everyone
whenever a player changes suits it adjusts the height for everyone in the lobby
even though i already check to make sure that player is local, and even tried adding a check in the override itself where when the suit is equipped the code ONLY runs if the one who called it is the same player as the one having their height adjusted
somehow it feels like when someone interacts with a suit, every player in the lobby is running that code themself
honestly at this point i have no idea what to do
oh i see the genshin model mod code checks with GetComponent<modelreplacementname>
well shit
I just need to somehow get the player that equipped the suit but as far as I'm testing that's impossible for some bizarre reason
it aint impossible π
wait really??
yes i written a full API to modify stuff based on suits with support for MRAPI 2 years ago which i never published π
so i know its possible

okay so what you gotta do is Check the player current suit ye
then in MRAPI there is a Dictionary that holds all Suits that has a registered model
if you got a match for the x suit you know they wearing a model suit
and if you want to be more specific you can check the name of the model suit
i can do that?
ye? that is a base game thing
this..?
this?
yep



