#Model Replacement API & SDK

1 messages · Page 4 of 1

median rain
#

Try throwing this next to your modelreplacement.dll in bepinex. (ModelReplacementAPI.pdb)

elder hill
#

do you know how many vertices are in your mesh?

median rain
#

Maybe it will give some more info.

#

Oh it renamed it.

little sandal
#

also yea seems that the error is making the code break and its not running the other things for blendshapes/materials

median rain
#

May need to restart the game, I don't know when pdb's are loaded in

little sandal
little sandal
elder hill
#

well, if they're above 65k, then you need to change the index format to 32bit

#

but where u change it? i have no idea

median rain
#

Seeing as the base model is fine, there's no way just the arms would be above the cap.

#

All I do is delete vertices.

little sandal
#

lol arms are 720 verts

#

tilted makes REALLY clean models

elder hill
#

hmm true

little sandal
#

okay gonna try that thing.
will that make errors read more clearly?

elder hill
#

i think so yeah but not by much more

#

error'ing here anyway i believe

little sandal
#

never used a .pdb before

elder hill
#

i've used it for LL and stuff before, though mods kinda just embed it in nowadays i think

little sandal
#

blegh, still cringe not very helpful error lol

#

or well

#

that has a little more info ig

elder hill
#

it just relies less on IL code to point to actual code, if im right hten its just what i screenshotted

median rain
#

Well Xu Xiaolan is probably right anyways

elder hill
#

yeah unfortunate, it was

#

hmm

little sandal
#

if i suppress the error will the code keep running?

#

the stuff that is not working is not working as the code breaks due to the error

#

due to my order of operations

median rain
#

I wonder if something gets messed up when you set the sharedmesh.

elder hill
#

i mean u can try catch in your own code, but that wont help with the actual thing you're trying to get working

median rain
#

^

little sandal
#

uh

median rain
#

is this in your body replacement class?

little sandal
#

i dont mean a catch though

little sandal
#

the one that was autogenerated a looong time ago. just built a lot onto it

median rain
#

Maybe try this

#
            replacementViewModel = LoadViewModelreplacement();
            viewModelAvatar.AssignViewModelReplacement(controller.gameObject, replacementViewModel);
            SetAvatarRenderers(true);
            viewState.ReportBodyReplacementAddition(this);
            cosmeticManager.ReportBodyReplacementAddition(this);```
#

This should just refresh your viewmodel entirely.

elder hill
#

the things i would check for:
if sharedmesh is null after instantiating it.
if the vertex count/submesh count is 0 which means it wasnt properly initalised

median rain
#

Might want to consider a destroy as well.

#

So you don't create a memory leak.

little sandal
#

man im confused lol

#

uhm,, hold on so ConvertModelToViewModel pulls from the current suit state so to speak right?

median rain
#

That doesn't pull from anything. It takes whatever gameobject you put in and returns a gameobject with only arms.

#

My suggestion is to replace ConvertModelToViewModel with that code block entirely.

#

So just generating a new viewmodel entirely.

little sandal
#

wait, so what mesh is it getting to start with?

#

it uses the skeletal data right?

elder hill
#

the one u give it as an argument

little sandal
#

no i mean when you first put a suit on

median rain
#

Whatever mesh(s) is in the skinnedMeshRenderers of the gameobject you give it

little sandal
#

does it get all SMR child objects?

elder hill
#

yea

little sandal
#

ahh okay that checks out

#

i was like "wait if my model is made of 5 SMR's how does it know what one to pick that has the arms"

#

okay so i feel the error may be my fault due to a misunderstanding?

#

i was just doing this

#

that doesn't seem right at all with my understanding now

#

ide need to feed it the arm mesh i want to swap to

median rain
#

Yeah it looks like your system is a bit more complex than I originally thought.

little sandal
#

i mean feel free to check out the github

#

its not 100% up to date, but gets the point across

elder hill
#

and you're sure that the mesh you're trying to use is instantiated?

little sandal
#

lemmy explain

elder hill
#

yeah but u need to instantiate it

#

alright

little sandal
#

each "FemmployeePart" is a Scripted Object that holds some data, the part name, the list of materials in order and the mesh the part uses, these parts are stored in the asset bundle and when a suit is put on it grabs all the parts and puts them into a list, this list is used for getting what mesh is needed via a dictionary that uses strings as the key

#

meshes are never instantiated, i just change out the SharedMesh of the body region

#

maybe i misunderstand what you mean, dunno

elder hill
#

hmmm

#

bunya already does instaniate the relevant parts anyway actually

median rain
#

It saying that the index buffer is null is the strangest thing to me.

elder hill
#

yea

median rain
#

Maybe it has to be instantiated in game, physically?

elder hill
#
    skinnedMeshRenderer.sharedMesh = Object.Instantiate<Mesh>(skinnedMeshRenderer.sharedMesh);
    Mesh sharedMesh = skinnedMeshRenderer.sharedMesh;
    
    if (sharedMesh == null)
    {
        Debug.LogError("Shared mesh is null after instantiation.");
        continue;
    }
    
    // make sure the mesh has vertices and submeshes
    if (sharedMesh.vertexCount == 0 || sharedMesh.subMeshCount == 0)
    {
        Debug.LogError("Mesh is not properly initialized (vertex count or submesh count is zero).");
        continue;
    }

    // make sure the index buffer is valid
    GraphicsBuffer indexBuffer = sharedMesh.GetIndexBuffer();
    if (indexBuffer == null)
    {
        Debug.LogError("Index buffer is null for the shared mesh.");
        continue;
    }

i would maybe add this logging at your for loop bunya

median rain
#

Since the index buffer is on the graphics card, not the CPU, and the game isn't going to send an object that doesn't need to be rendered yet.

little sandal
elder hill
#

loadviewmodel does the Convert function thats causing you problems

little sandal
#

ah, just asking as it says its not a thing

elder hill
#

oh publicise the dll

#

its a private method

little sandal
#

it should already be publicized?

#

hold on lemmy check

#

i did mess with the .cspj so may have removed it by mistake

median rain
#

Oh my bad if it's not public. You will need to publicize the dll.

elder hill
#

oh yeah definitely, i still think it could be a problem due to the argument not being instantiated or smthn like that

little sandal
#

whats strange is its working to a point

#

as the broken arm things are gone

median rain
#

I think there's some Next update behind logic going on in unity, that has prevented the mesh from actually being instantiated at this point.

#

So because it hasn't been rendered yet, it doesn't have an index buffer.

little sandal
#

i dont remember how to do the thing with the AssemblyPublicizer

#

i suck with .cspj files

elder hill
#

you need this

little sandal
#

yeah

#

ik

elder hill
#

then you'd add Publicize="true"

#

at the beginning

little sandal
#

ah, i was close

#

i had

  <Publicize Include="ModelReplacementAPI"/>
#

k ty

elder hill
#

im not sure if i'd call that close but wel done

little sandal
#

well when i cant even edit these files properly its close

#

like i hate the formatting, it makes no sense to me

little sandal
#

tried putting it in a few areas after i include the api

elder hill
#

do you have the path stuff

little sandal
#

oh

#

well had 0 clue that was needed

elder hill
#

well its gotta find the dll somehow

elder hill
#

true

little sandal
#

i assumed it would get it as a reference or something dunno

#

ookay its happy now

#

this is what you want right?

#

@median rain tried to @ you in that msg but discord is annoying lol

#

ik its prob just gonna do the same thing, but figured its worth a shot

#

oh um

#

well no more error, but uhhhh

#

thats new

#

makes that copy when i press apply

shadow path
#

Oh. Oh god.

#

You could make a summoning circle!

little sandal
#

yea lol

#

but yea, error gone with that new code, just a more,, visual error XD
other than the duped arms its working 99% correctly

median rain
little sandal
#

o right

#

lol my bad

median rain
#

Glad to see it's working better this way.

#

There are still some bugs that may or may not have slipped through the cracks, since this is definitely not my original intentions.

#

So don't forget to be on the lookout

little sandal
#

yeaa i know lol

#

you have gotten after me before XD. ive been doing some very non typical things with this API lol

#

but hey, it aint fun if we aint pushing boundary's

median rain
#

From my perspective, it's way cooler when people do non-typical things.

little sandal
#

mhm, i feel the same

median rain
#

Though it also shows the many flaws that the API has.

little sandal
#

hey its great imo

#

its the straw holding the Femmployee mod up XD

shadow path
#

This api is awesome bunya

little sandal
#

yea, one of the top shelf LC mods imo
its a mod that lets peeps be what they want, that cant be passed up

median rain
#

👍

little sandal
#

also yeah, that code works now

#

its what i like to call magic code!

median rain
#

Nice, glad it's working.

little sandal
#

no clue why it works, just does

median rain
#

Yeah it's time like these where I wish I had a bit more forethought in my design. For instance I could have thrown all that in a RefreshViewModel() function if I wanted to.

#

To be fair, the API probably won't get any more major updates, other than fixing updates as they come, so there probably won't be any risk of back compatability breaking down the line, but still.

little sandal
#

yeah,, kinda one of those make your bed and lie in it type things

#

glad you still plan on keeping it updated though

median rain
#

Well, it would be kind of ridiculous for it to just stop working at this point in time.

little sandal
#

yea ik lol

#

ive seen it happen though with larger projects

little sandal
#

ahhh, people can be happy now lol

#

im,, very glad that did not turn into a whole thing.
this mod has had too many of those lol
ty lots @elder hill and @median rain

shadow path
#

HELLO ITS ME BACK AT IT AGAIN AT THE KRUSTY KRAB

To update a texture do I just need to go in and remake the ModelAPI?

#

wel its not a texture it's a rig that is behaving WAY too freely

#

I just need to stiffen the physics a little

#

@median rain
(SORRY)

shadow path
#

or anyone else that knows

elder hill
#

If you're changing anything in Unity you need to rebuild yes, you don't have to make an entirely new project, just rebuild

shadow path
#

Ight cool, ty!

#

Just wanna make sure the model updates

median rain
#

If it's just model things, you don't need to change anything in code, you just rebuild your project in unity to get a new assetbundle, and then rebuild your VS project to get a new dll.

little sandal
#

how much is known about the 2 handed item bug?

#

in first person the 2 handed item is not visible due to being out of view, so it just looks like your holding nothing

prime galleon
#

not a bug. it is based upon the positioning of the item within unity

#

so if it is in the same position as the players in the unity project, it'll be the same in the game

#

default player's hand*

little sandal
#

i dont understand

little sandal
#

like the item offset?

prime galleon
#

yeah

little sandal
#

but thats where it should be

#

one handed items work fine

prime galleon
#

sorry, I think I misunderstood

#

nevermind

little sandal
#

oh das fine

little sandal
median rain
#

Item positioning is a pretty big bug at the moment.

little sandal
#

yea, i read about it a bit in the thread from before

median rain
#

Something got messed up with the positioning when I added viewmodels, no clue what.

#

From experience I can say that it doesn't affect things like weapons, but sometimes the big gear will completely obscure your vision.

little sandal
#

or just be offscreen

#

yea, about what we've seen

#

okay, well i wish you luck with finding a fix!

shadow path
#

GUESS WHAT Im here again with questions.
What is causing my model to not show up after updating it? All that gets equipped is the suit png now

shadow path
#

hnnn

#

@median rain please dont shoot me

#

OR @elder hill

long hinge
# shadow path

Is it not importing into the game? Does your console log show any red text when it loads up the mod when you're starting the game or when you put on the suit?

shadow path
#

it doesnt! I just rebuilt it entirely and Im going to see if that fixes it

shadow path
#

spoilers it didnt

#

it??? Tried to move my entire bepinex folder

#

jesus

prime galleon
# shadow path spoilers it didnt

yeah, at that point, you might just need to remake it. you broke something somewhere and with more information we might be able to figure it out, but it probably would just be easier to redo it

prime galleon
# shadow path spoilers it didnt

tried rebuilding it in unity, or have you messed with the project files in visual studio in some way? (other than changing the default suit for the model?

shadow path
prime galleon
#

yeah, welcome to the club happens sometimes. I just keep a copy of the old one in unity so I know what I did and can recreate it easily after it happens

shadow path
#

damn alright. Good to know Im not alone in the struggle at least!

prime galleon
#

btw, @shadow path were you unhappy with the shemp suit or something? it seemed pretty good

shadow path
#

the tail physics were driving me up the wall!

#

the new one I uploaded is the same model but with a better rigged tail and ears, and post processing turned off

prime galleon
#

ah. that' explains things. btw, the config for that is weird, it shows at replacing the default, orange suit while still replacing the suit you want it to

#

I'm assuming you hard-coded suit replacement but left in the old code

shadow path
#

Ah. Yeah that would do it.

prime galleon
#

if you ever need any help (and I'm available) I can help you hammer out some problems in a vc sometime

shadow path
#

sure!

prime galleon
#

just @ me or something, idk

shadow path
#

I just need to figure out why her feet are clipping into the floor when ive pulled the model up to match 😭

#

dunno why theyre falling through

shadow path
#

I DID IT, ITS DONE. TAIL HAS COLLISION AND ISNT FALLING THROUGH THE FLOOR, HER FEET ARE OIN THE GROUND, JIGGLES ARE DOING WHAT I WANT THEM TO

#

IT IS DONE

#

🙏

elder hill
#

sick

shadow path
#

gonna go pull my brain out and scrub it

#

or just make some tea

delicate glade
#

So this might be a bit ambitious but I've been considering expanding my player models mod a bit by adding an in-game menu where you can enable/disable certain meshes on each suit or switch outfits for that suit according to your liking... How uh.. easy do we think that may be? I'm more than confident I can make the menu as I've made many before but the coding functionality behind making it work for lethal I'm unsure on

#

Essentially each suit on the rack is tied to a character, that character has different models representing their outfits which is controlled through a menu is the endgoal

elder hill
#

@little sandal might be able to help you there

delicate glade
#

👀

#

Awesome

little sandal
#

um, im not very good at explaining things

#

the way the Femmployee mod works is the suit is split into 5 regions, head, chest, arms, waist and legs in that order ID wise.
I use a single FBX that has all the 3d meshes on it, but I only have the 5 default meshes on the suit in unity. when you change a suit region it sets the SharedMesh of the respective suit region's SkinnedMeshRenderer to the mesh that was selected.

the hard part is storing that data in a networkable way. I use 5 NetworkVars that store a string, this string stores the name of the mesh that is currently equipped. so when a suit needs to sync to everyone they have the values for that suit to set it properly

I also use more complext network structs that can store things like blendshape values along with the mesh ID and blendshape ID, this allows for in game sliders

#

i hope that makes some amount of sense lol

#

o, also @delicate glade sorry took a min to get back, was in a war thunder match lol

delicate glade
#

No worries! I'm at work right now so I'm not in a rush haha I'll take a look through this when I get home!

#

Much appreciated ❤️

little sandal
#

ye!
hope it helps

delicate glade
# little sandal ye! hope it helps

okay so this did help me start thinking of how to do this but honestly im still a little lost as to how id handle it, immediate question though is how is this structured in your project? thats the biggest thing im lost on as for how to start

#

i just have a basic model replacement project with just the models and the api, would i need to set up the asset ripper for this or is that not necessary?

#

just trying to visualize in my head how this would work

little sandal
#

Once I had the basic mod generated and set up I started to build upon it

#

The Femmployee class is the one that was Auto generated for the suit from the start, I just renamed it

#

It's the class that the API puts on to the suit when you're wearing it

#

You can set up a patched environment in unity alongside the model replacement API and you can put your dll file into the project to use script references on game objects

#

You do have to be careful not to change any namespaces that were generated from the project before, you also can't reference the Auto generated suit script directly within a script you plan on using on a game object in unity

#

If you do either of these things Unity will refuse to properly load the mod assembly and you won't be able to use any of your script references on game objects

#

Our mod has a network object that is created and destroyed alongside the suit when someone puts it on and it's linked to their suit.

This object is what stores that individuals suit data

delicate glade
#

that sounds like a solid place to start if im understanding right

little sandal
#

I just took the auto-generated project that the API in unity created and I just built upon it

delicate glade
#

oh 🤔

#

so adding scripts into the .csproj..?

little sandal
#

Yeah

delicate glade
#

oh okay cool

little sandal
#

As if you were making a Unity project or just a mod

delicate glade
#

my experience with unity coding FAR outshines my modding experience (only this one mod) so i both understand well and dont understand at all 😅

median rain
#

Everyone starts somewhere.

little sandal
#

Then once you have your compiled mod you can put that into unity and use properly formatted scripts that will act as references in game, sort of like how Unity normally works except they're not really scripts being added to the game object just references that Unity can interpret

#

Just be aware when you start putting assembly dlls into Unity it tends to get very crash happy

#

So compulsive saving is your best friend

median rain
#

Funnily enough, Avali has done exactly what you want to do already. You would probably gain a lot just from dissecting their github project until you understand how it works.

#

At least that's how I start when I want to achieve things.

delicate glade
#

that would probably be good as i am very lost

little sandal
#

Like I said you can also always ask if you're curious about specifics! Including General modding things like setting the project up in unity

#

My code is a mess as far as I'm concerned but it's a mess that I for the most part understand

#

Got to get around to adding those comments,,,

delicate glade
little sandal
#

You need to make the UI into a prefab and then put that prefab into a folder that has the asset bundle your mod uses

#

Look up how to set a folders asset bundle in unity

#

It's like a little drop down in the very bottom of the inspector when you're selecting a folder

delicate glade
#

oh okay got it

little sandal
#

Then when you click build project on the API project asset it will pack that UI prefab into the asset bundle

#

You'll need to make some sort of control script for it, then like I said put your compiled mod dll somewhere within your Unity project

#

If all goes well you should see a little expansion arrow on your dll file icon within the asset Explorer, if you expand this you'll see your UI control script

#

You can then put that script ref on to the prefab just like normal unity, just make sure you're editing the prefab itself, not just editing the existing scene prefab instance

#

Look into the lethal company input utils API, it will allow you to easily integrate controls into the game, say for opening a menu

delicate glade
#

speaking of which i added the .dll for that but it doesnt seem to like the using statement

elder hill
#

Did you add it as a reference in the csproj

little sandal
#

I don't know if they know what that means

delicate glade
#

i indeed do not! :)

little sandal
#

Man I don't know what it's called

elder hill
#

In your .csproj file, you need to add a "package reference" to the mods nuget source

little sandal
#

Right click on the topmost thing in your Visual Studio Explorer

#

You can then add a reference with GUI

elder hill
#

Oh if you're using vs then u can just add references normally

delicate glade
#

oh cool

little sandal
#

You could just look up "how to add dll package reference Visual Studio"

#

If you're not able to figure it out

#

I'm in bed so my usual technique of doing it myself to then explain it is not possible lol

#

If you haven't already start out by following the model replacement apis Wiki for Unity project workflow

#

It's on the GitHub page

delicate glade
#

think i got it

little sandal
#

Uh

#

I don't recognize that ui

delicate glade
#

hm

little sandal
#

You should just be able to download the mod from thunderstore manually then put the dll into your mod folder then add it as a reference

#

If you can wait till tomorrow I can walk you through a lot of this stuff over VC or something

#

I've just been trying to sleep for the past like 4 hours now lol

delicate glade
#

oh shit sorry

#

yeah that works

little sandal
#

Nah your fine!

#

There's too many bees in my brain for me to fall asleep anyways

little sandal
#

But yeah, send a message in our mods thread tomorrow and find time just got to remind me

elder hill
delicate glade
#

sounds good

elder hill
#

It's preferable to use package references instead of dll referenfes

little sandal
little sandal
elder hill
#

Hmm is it? I'm not familiar with vs so I assumed it was the package reference ui

delicate glade
elder hill
little sandal
#

Okay I asked about that and I was told it's not a thing

elder hill
#

As you're not allowed to include other mod dlls etc in your github because

#

Not a thing?

little sandal
#

I specifically asked if there was a way to have a reference to an online package similar to nuget

elder hill
#

It's just using nuget

little sandal
#

And I was told no

elder hill
#

Weird

#

Cuz we use it for LC itself and a bunch of other api mods lol

delicate glade
#

nvm it cant install it 💀

elder hill
#

It might not exist for modelreplacemntapi itself maybe

little sandal
#

I could add a check into my csproj that if dll not present download from GitHub repo

#

That's what I was told

#

Was a couple days ago

elder hill
#

@median rain do you know if modelreplacementapi has a nuget?

delicate glade
#

oh wait its looking for a diff package

#

AinaVT-LethalConfig

elder hill
#

Just look for the file that ends in .csproj

#

Open that

little sandal
#

Or just wait

elder hill
#

Then screenshot what you see

#

It's a one liner lol

delicate glade
#

ye im in csproj rn

elder hill
#

Here I'll get my mods csproj ss sec

median rain
#

The stuff that people actually implement in their mods is set in stone.

#

So regardless of how old someone's modelreplacementapi.dll is, it should still work

elder hill
median rain
#

Originally I wanted the SDK to do the downloading, but it seemed needlessly complicated, so I just decided not to.

delicate glade
#

oh nice that fixed it

#

thanks

little sandal
#

I know lethal lib has a nuget package

#

That's at least nice

#

I have a reference to it in my file

elder hill
#

Honestly github action stuff is pretty magical, I need to set that up at some point, would upload to nuget, thunderstore, github releases etc with the creation of a tag

little sandal
#

Oh by the way xu, I essentially merged the fork of your friend

elder hill
#

Oh nice, as long as u keep nullable enabled kitty_sip

little sandal
#

I fixed it it's way better now

elder hill
#

Sick

elder hill
#

It's one of the properties that they got rid of cuz they prefer kotlin's nullable to C#'s, it'll be near the top of your csproj, I can check if u still have it rq

#

But it helps a lot with null checking stuff

little sandal
#

Dunno feel free to check

elder hill
#

Rip you don't, oh well its fine, might be a hassle to set it up this far in anyway

little sandal
#

Why would it be a hassle

#

I just add it back right?

#

There's not really any big differences in my project since I changed that file to make it more clean

#

The only things that I had to fix and adapt was references

#

Oh and adding in the latest Lang line

elder hill
#

Add*

little sandal
#

Oh then I don't think I ever had that set up

#

I get like 50 warnings for a bunch of things saying they should be marked as nullable or whatever but they don't affect anything

#

Or maybe I used to get them and that was from that?

#

Don't know haven't been paying attention

elder hill
#

Lol yeah it's just warnings to help you write better code to show whether something CAN or CANT be null

little sandal
#

Yeah I know

#

It was something I was going to get around to

#

Famous last words though

elder hill
#

Mhm

#

It's very nice but took me a few hours to set it up for coderebirth, mostly because I set it up late and had like 100 different scrips to add it too

little sandal
#

Oh well I don't have that many lol

#

Probably would only take at worst an hour

elder hill
#

Probably

#

If you dont know how to set it up then its just:
If one of your field types CAN be null sometimes, you'd add a ? To the type, I.e.
private PlayerControllerB? player;
If it CANT be null then:
private PlayerControllerB player = null!; (and then you'd set the value in Unity or Start)

little sandal
#

Yeah I did that for a few

elder hill
#

It's terms to help your IDE figure out while you're coding whether what you're writing has a null vulnerability

#

Nice

little sandal
#

Like I said it was something I was going to get around to

elder hill
#

Like if I'm writing a function involving playercontrollerb, it'll want me to null check first erc

little sandal
#

Yea

elder hill
#

when you've got time

little sandal
#

Anyways I really need to keep trying to sleep, having my phone in my hand is leading me into Doom scrolling on shorts lol

elder hill
#

Lol yeah gogo

delicate glade
#

i suppose i should sleep as well

#

🫡

limpid pebble
#

@median rain think you could push to github? the last push looks like it was 7 months ago and I'm trying to track something down that might be caused by ModelReplacementAPI

#

wait sorry I might be dumb

#

I was looking at a file history, although I'm still not sure if it's totally up to date

#

seems like there's a good possibility that this BodyReplacementBase.LateUpdate() is running after your patch to GrabbableObject.LateUpdate(), so the body replacement doesn't know the held item is held until a frame late

median rain
#

Yeah that's very likely.

#

I think I moved the held item logic into BodyReplacementBase.LateUpdate() to try and mitigate the ghosting that items were doing.

#

a tradeoff between items always being a frame behind in position, and items being a frame behind in position when you pick them up.

#

If this causes a real compat issue, I can look into solving. I forget the verbage, but there is a way to sequence one particular LateUpdate() to go after another LateUpdate()

long briar
#

so many hours of messing around just to find out that my waifus are at fault perceive

elder hill
#

Lol

limpid pebble
long briar
#

so today i also went onto a model replacement journey with this video and im at the point now where im supposed to open the csproject file but i cannot open it perceive

long briar
#

k fixed it

long briar
#

works well but performance is not too good

long briar
#

is there anything that can be done about the poor positioning of items that are actualy being held by both hands? i positioned this socket properly and small items like flashlight or hairdryer etc are pretty well placed but things like Shovel or jetpack or large Axle are kinda poorly placed still

prime galleon
#

that's if you are using generated viewmodels, if you aren

#

't, it shouldn't be a problem

prime galleon
long briar
#

was hoping i wouldnt have to go through that but will see

#

those MMD models always go for visuals over performance since they were never meant for games

#

i have some character from Wuthering Waves and Tower of Fantasy wich i wanna do this upcoming week, im just gonna monitor how their performance is since those models have much less polys

#

maybe ill go through the effort of optimizing my karin some other time

prime galleon
#

yeah mmd files are for animating, they are normally more heavy

long briar
#

its not but im lazy for these kind of things e.e

prime galleon
#

I mean...

  1. import into blender
  2. decimate
  3. export?
long briar
#

the thing that confuses me is that in UE the extra poly's dont do anything literally since its GPU load and both, LC and the ue game i have been modding for a while now are cpu bound entirely

#

its a bit weird to me that those 2 engines behave so differently

median rain
#

Lc is not cpu bound. I know this because the function that generates viewmodels operates entirely on the gpu copy of the mesh.

long briar
#

My GPU always sits only at 60% usage so idk

long briar
#

It's just weird to me that my model loses me around 35fps in solo play when my GPU usage doesn't change at all

#

Otherwise I would have jumped to the conclusion that I have to reduce some polygons as well right away

primal pier
#

Any chance the "generate viewmodels" config option can be made a clientside thing?

#

If it isnt already

prime galleon
#

all of this mod is clientside, you can use them in public lobbies without bothering anyone else

shadow path
#

anyone know how I make metallic bits stay shiny when importing?

delicate glade
shadow path
delicate glade
#

If they aren't already extracted you can extract them from the model by going to the material tabs with the imported model selected

shadow path
#

Downside is I have to reimport everything, but at least now it works

delicate glade
#

Gotcha, glad ya got it working 👍

median rain
# shadow path

Usually this means unity made a mistake when packing your materials into your assetbundle.

#

SOmething went wrong in the model export process, and the materials weren't included, so now LC can't find them.

#

I don't think a fix was ever found for this, just another irritating bug on unity's end.

shadow path
#

throws unity

#

I did fix it by just saving the file and opening a different project

#

super weird

shadow path
#

any idea what causes this?

#

the seperation on the arm/hand

median rain
#

Would have to be something related to your model.

delicate glade
#

Yeah I'd inspect the rig in blender

shadow path
#

rrr
ok thank

shadow path
#

well I attached everything

#

HOWEVER BLENDER IS TAKING 700 YEARS TO EXPORT

#

okay nevermind it just crashes blender instantly on export

#

I love this

shadow path
#

I

:C
I quit

long briar
#

Was the model 1 piece or was it split into multiple pieces?

#

If it was multiple pieces with different armatures then you probably have to dig through the bones and parent some

#

I had to do this on my Lyra model because the hat was completely separate and already in unity in the preview everything was moving except the hat wich was not moving with the character

long briar
#

When I had this issue I didn't even know what I was looking for because I never encountered this issue befor either concern took me like an hour to to figure it out

slate iris
#

Hi, I'm at the coding step. I'm not seeing the option for "build," and am wondering how to enable that?

grim scarab
#

cus if you're doing it in something like vscode, it doesn't have an option to build

#

if you're using something like visual studio 2022, the build option should show up when you right click the .csproj file

slate iris
#

I did manage to figure that out, for some reason VS didn't include some of the packages. Though there are a few other issues I am having, but gonna try to problem solve on my own first so I have more of a feel for the Model Replacement stuff

obtuse nebula
#

Anyone know how to fix JigglePhysics compile errors?

#

It's preventing me from building my project

obtuse nebula
shadow path
obtuse nebula
shadow path
# obtuse nebula Did you have any issues with JigglePhysics? I'm getting compiler errors and can'...

I do not! The modelreplacemntAPI comes with a built in jiggle rig where you can select parts of the skeleton you wish to move- if it's ears and tails you're working with, you can usually start at the parent bone and build it from there.
If you are really struggling, @long hinge made an excellent video on what to do and how to add special things to your model! https://youtu.be/Wnobg8zFFK0

obtuse nebula
#

aaaa I see, I bet they were contradicting each other, removing the package fixed the compile errors

shadow path
#

...weird!

obtuse nebula
shadow path
obtuse nebula
#

Very pog 😄

shadow path
#

you can preview the player model on top of it and itll be doing the same thing

obtuse nebula
#

Pog. I was trying to figure out how to set up colliders for the jiggle bones but couldn't figure it out to prevent the tail from clipping through the body but I might just crank up the friction value so it just can't move that much

elder hill
#

angle elasticity helps too

obtuse nebula
#

I hate watching a tutorial, they do one thing, I do that thing but my thing looks or reacts different to their thing.

obtuse nebula
#

I don't have a build button either, I don't know what i'm missing

obtuse nebula
#

I think I found my problem, when I was installing visual studios 22, I didn't select one of the workload thingies it requires. Going back to that video above, he selects that. Hope this fixes my woes

It did :sigh:

vast warren
#

say, are there an examples on mouth flapping? i've been considering making a model myself, and it'd be awesome to know if anybody has figured that out yet! thanks :)

obtuse nebula
#

lmao "Mouth flapping" (I know what you're talking about, just a funny sentence)

#

Hey @shadow path ❤️ I have 1 last quesiton. I have everything setup, and the model appears in-game. But when I equip it, I start getting thrown around the ship, have you encountered this?

I re-built the avatar and it's not doing it anymore X_X Sussy

obtuse nebula
vast warren
obtuse nebula
prime galleon
obtuse nebula
#

i didnt bother coding in the jaw movements in mine, did 1 attempt, kept getting errors and just called it a night lol

prime galleon
#

I can help you with that if you want

vast warren
#

okay, another question: has anyone done anything with eye movement at all?

gilded orchid
#

not that im aware of,
most i've seen is just wiggles and mouth moving from voice activation

vast warren
#

a shame, but i imagine the implementation would be difficult anyway. after all, how do you determine what the player is looking at? :P

median rain
#

That would be insanely model dependent.

#

I know that some MMD models have "eye bones", and some go even further with a controller bone that will point in the direction of what you're looking at.

#

So the final implementation of your eye controller is going to rely entirely on how your model has it configured, if at all.

#

If you can achieve that, I bet you can write a script that lets you look at scrap, or other players, etc...

#

Probably with ray casts to find a target.

obtuse nebula
#

I don't care about eye looking, I just want my models to be able to blink, even if I make my own animation for arbitrary blinking which is simple as heck

elder hill
#

usually models do a blendshape for blinking

#

and i did it for my model replacements

#

just putting it to 100 and back to 0

obtuse nebula
#

Oh, it can be done for LC?

#

Is it just creating a animation controller with a looping animation in the animator?

elder hill
#

i mean i just wrote a script to change the blendshape value

obtuse nebula
#

oh 😢

elder hill
#

you can probably use an animator controller for it

#

i dont see the problem with that

obtuse nebula
#

I figured putting an animation controller in the animator would break the game's walking animations and stuff but ig it doesn't hurt to try

#

Yoooo you can make the models blink! Just created a simple looping animation for smooth blinking and it just, works

long briar
#

i do believe ive seen a model blink ingame aswell

obtuse nebula
long briar
#

ye but outside of that ive seen it befor

obtuse nebula
#

I can probably make the eyes move around too. Not really looking at actual things but at least not staring blankly straight to give it more life

long briar
#

i wanted to look into it too for my karin model too at some point

spare oyster
#

so my character feet are reversed how do i fix that

#

my feet are inverted how do i fix that

vast warren
#

i'm still very confused about the player model. the wiki says the model should be in a t-pose with palms facing downwards, like the default player model...

issue is that every single player model i've seen is in a slight a-pose with the palms horizontal... so what is the rig based on if not the actual player model & rig?

#

the model i'm creating is essentially a retopped player model, and it lines up nearly perfectly with the original model. i was under the impression that the closer to the player model, the more accurate.. but i suppose not?

#

even the example model provided in the package uses the a-pose and horizontal palms.. i'm so confused @^@

prime galleon
# vast warren i'm still very confused about the player model. the wiki says the model should b...

Which part of the model do you mean? When. It is pulled into the project or when you look at it after setting it up? Before setup, it is arranged however it was from what it was exported from. That position shouldn't matter though. What matters is after setup which is based upon the pose it is in after setting up a humanoid rig for the model. Those bone positions are what the setup is based on

#

Btw, this is also an answer for @spare oyster

spare oyster
median rain
#

I had to modify the base player model a fair bit to get it to work, but the reason for that discrepancy is because most models are palm down by default. People wouldn't rotate their hands, and then their fingers would get destroyed.

#

it makes more sense to align the player model I packaged with the SDK to the models people will actually use.

vast warren
obtuse nebula
#

Trying to figure out the Jiggle Rig Builder. I have it set up nicely in Unity, but when it's in-game, how it acts is totally different. Any real way to get it to act the same between the editor and in-game than constantly exporting, trying, rinse repeat?

slate iris
#

I'm having an issue where my models aren't having their textures appear in game. I see them in Blender and Unity, but porting them in-game isn't working

median rain
obtuse nebula
#

That is fair. And it's hard to mimic the movement and stuff in unity

obtuse nebula
median rain
#

Is your VC project in your unity project?

obtuse nebula
#

my VC project?

#

I set up the avatar in unity, then build it into a folder thats on my desktop

#

Is it possible I don't have the right .net thing installed? I had to rollback my computer after breaking a thing when trying to fix phasmophobia (I disabled a bunch of services and couldn't login haha) so it's possible I don't have the .net package anymore

elder hill
#

I was always wondering but never looked into it, how are you replacing the players body? I'm curious to see if there's an easy way to fix the slightly small delay at high speeds with the models body catching up to you, with how it's being done it feels like it's being lerped at Update or smthn lol

obtuse nebula
elder hill
#

It's been a while I didnt remember how bad it was lol

obtuse nebula
#

It's worth it though being able to have kitty hand paws haha

median rain
# obtuse nebula my VC project?

If it's on your desktop then that's probably not the issue. I haven't seen those errors before, so there's not a ton I can do to help, unfortunately.

median rain
#

I know why we have ghosting on the replacement viewmodel, it's because unity is stupid and doesn't expose an AfterIKApplied event on the animator, so when I get the arm positions and rotations for the viewmodel, those are before IK is applied to the player hands.

#

Hence, a frame behind.

#

Yeah, for some reason they decided to run IK after LateUpdate.

elder hill
#

amazing

#

is it possible to use some sort of client network transform on the replacement models to get interpolation?

#

thats like the only way i can think of to stop this frame behind shenanigans.
either that or just parenting, which i must ask why that didnt work/wasnt tried?

#

lol

median rain
#

Parenting caused all kind of shenanigans and so I decided to stop using it, I suppose I could try it out for the viewmodel and see how that works out.

obtuse nebula
obtuse nebula
#

Back to trying other methods, installing other .NET frameworks and they're just not appearing as possible ones. What am I meant to use?? 😭

obtuse nebula
median rain
#

Honestly I would think that's a nuget issue, seeing as nuget oversees the downloading of dependencies.

#

But I don't know enough about VS or Nuget to help you out.

#

Have you considered just making a new VS project, or restarting?

obtuse nebula
#

I was actually going to try that now. This entire time all fingers were pointing to VS lol but now its time to point fingers at unity

obtuse nebula
#

I'm on the verge of fresh windows installing because even a fresh install of unity 2022.3.9f1 is spewing compiler errors, what the hell happened to my computer?! I'm like, actually irrationally mad right now haha

median rain
#

Oh wow, something got seriously messed up on your system.

#

Best of luck there

little sandal
#

hey @median rain
does the OffsetBuilder/RotationOffset system on suits take up a little fps?
hunting down performance issues right now and just having the suit on drops it by about 15 ~ 25 fps.

and the suit class does nothing in update nor has things called per frame

median rain
#

OffsetBuilder/RotationOffset exist purely to store information from the SDK.

little sandal
#

ah thought they were doing stuff

#

noted

median rain
#

If you're looking for performance issues, those are probably in LateUpdate.

#

I do a fair bit of stuff that could be cached.

little sandal
#

my mod doesnt use LateUpdate

median rain
#

Things like GetComponentsInChild, etc...

little sandal
#

yeah but like i said none of that is being called on my mod

#

nothing is happening when the suit is on unless you press apply settings

#

thats why i thought to ask here, thought maybe there might be a small loss with the API suits

median rain
#

Regardless of what your mod is doing, the API has to do stuff in behind to make it all work, and it could certainly be optimized better.

#

Do you have any physics?

little sandal
#

no

median rain
#

Ah then that's not it.

median rain
#

Well if you're asking whether I have any plans to fix it, not at the moment.

little sandal
#

im not?

#

was just wanting to know if a 15 ~ 25fps loss is expected

median rain
#

I've never experienced anything like that myself, so I can't say what the expectations are. I think it's pretty system specific.

little sandal
#

kk

long hinge
#

I'm trying to help someone make their mod, they seem to get this
"[Error:Unity Log] ArgumentNullException: stream
Parameter name: ManagedStream object must be non-null"
error when the game tries to load the mod.
Any idea what may be the cause of this?

median rain
#

They either don't have an assetbundle, or their assetbundle isn't an embedded asset, or maybe it broke in some other way I forgot.

obtuse nebula
#

@shadow path did you intend to mark your TarTheProtogen as NSFW?

obtuse nebula
shadow path
obtuse nebula
shadow path
#

I uh...the tag isnt there for me?

#

Im not sure how to remove it

#

or how it got there

obtuse nebula
#

The tag isn't obvious directly on the mod page but searching for your mod doesn't show unless I enable NSFW. I'll get it cleared ♥️

shadow path
#

no it's doing it for me too

#

why on earth

obtuse nebula
#

Don't worry about it ♥️ I'll get the tag removed

obtuse nebula
shadow path
#

im so confused, I never put anything nsfw on it

long briar
#

what i do with this

#

i have 5 models exported from another game, the first 4 models had no issues at all and the 5th now does show this

long briar
#

fixed it concern very simple if i would know anything about unity wich i dont

grim scarab
#

something weird happened with LC v65 regarding this api, involving the weird movement issues I encountered before, but only on my larger modpack. I can't replicate it with a profile with only MC/MRAPI/TME. before this update, MC cosmetics didn't load on any model, including the default employee model. now, MC will load on the employee's model, but still be invisible on modelswaps. additionally, when modelswaps do emotes with cosmetics on, it causes the weird movement from before. There aren't any errors being shown in unity log, so i don't know where to go with this. i'll get a recording of it to show what i mean

#

i should clarify that movement with the modelswap is perfectly fine until an emote is used, then it starts acting up

#

this also doesn't happen if you aren't wearing MC cosmetics

#

it seems to specifically be caused by cosmetics that are large and on the head, so i wonder if it's something to do with colliders

obtuse nebula
#

I have 1 error and idk how to fix it myself owo

obtuse nebula
# grim scarab

I had this issue when putting a collider on my character (I was trying to add it for the wiggle joints) haha it would fling me everywhere. I wonder if those cosmetics have colliders on them and it doesn't really mess with your character till you do those emotes since those colliders would move around with the object

grim scarab
#

it probably is that the cosmetics are set up with colliders when they shouldn't

#

i tested with and without the computer head, while keeping the hat, and no problems

#

it probably is that some of the hats aren't configured right but the issues only arise when wearing a model replacement

#

so i don't get what the api is doing to cause it

obtuse nebula
median rain
#

Even if they aren't visible due to jank, the API does move the cosmetics to where they would be on the replacement model.

#

Definitely a combination of bad cosmetic colliders + different position on replacement model + emotes

#

But honestly I'm not sure what I can do for you here. It's not like I can disable the cosmetic's colliders.

grim scarab
#

yea since it's only a few of them i'll try to remove them from my package

#

i'm still not sure why it started working on showing the cosmetics for default model again though, cus it used to hide them on that as well

median rain
#

I don't even wonder what's going on with morecompany cosmetics anymore. If they start working again, great, if they stop working again, it's not like they worked to begin with.

long briar
#

I feel like someone should make a replacement for Mc and separate cosmetics and the other features

#

It's so annoying how the entire mod becomes bad just because of these stupid cosmetics

grand cape
#

i love the cosmetics

#

i just wished they worked with any of the other cosmetic type mods

prime galleon
#

honestly? Morecompany has several intrustive features such as the insistance of A CUSTOM MAIN MENU

prime galleon
sonic atlas
prime galleon
#

idk, think it should be configurable and find it quite annoying. Not the version number, the main screen and loading screen

#

also with the layer it loads in on, it can go in front of other mods that change the screen which is annoying

hollow oracle
#

so i can see why swipez doesnt want a toggle for it (plus u can use the NoMoreCompanyLogo mod anyway)

prime galleon
#

kinda the point. and having to use a mod that is a solution to a problem that shouldn't exist is wild

hollow oracle
#

well its only a problem if you care about it

#

like I personally don't care about it being different but some people do

#

in fact i find it useful to know that i loaded up modded

prime lintel
#

Might be a question with no immediate answer, but anyone know why whenever I have this mod active it shows another pair of arms of the original player model?

primal pier
#

this might be it

#

either that or

#

you have viewmodels turned on in the debug settings

#

and its generating extra arms

#

i think

sonic atlas
#

Never this one though

prime lintel
#

only occurs when I turn this mod on, I mean doesn't mean its not meshing well with another mod though

I don't have the pinata mod

sonic atlas
#

Weird

#

I would suspect an interaction with MoreCompany's update tbh

prime lintel
#

ah so its a morecompany issue messing with model replacement

sonic atlas
#

Idk

#

I said I would guess it's that, idk what you have in your mod pack

#

It could be an interaction with anything

prime lintel
#

thats fair
sad cause it used to work with my mod pack, guess something and it just aren't getting along anymore
wasn't sure if it was a known issue with a known fix already but guess not

#

oh well

#

thanks anyways

sonic atlas
#

Well for all we know right

#

It could be a bug now cus of the changes in v66

#

Which would mean the API needs updated

#

I guess checking anything you added recently and doing some trial and error is the best bet rn

median rain
#

Haven't checked into lethal in a while, but this is the first time I've heard of such a bug.

prime lintel
livid tide
#

Hey was just curious as to if someone might have had an issue with their models getting progressively wider every time it's loaded? Seems to be multiplicative as it's not really noticeable at the start but very quickly gets wider than the ship

obtuse nebula
#

I'd help but silvy with the somehow broken unity is still trying to figure out this nonesense. I fixed all my other red text problems but stumped on this one lol

obtuse nebula
#

What the hell, I decided the edit those 2 cs files and remove those 2 lines and everything compiled properly

long briar
#

The extra arms is a thing with the mirror decor but they are not visible otherwise for me atleast

obtuse nebula
#

Yeah, thats a mirrordecor problem. I noticed it too but others don't see it on you so 🤷🏻‍♂️

obtuse nebula
#

Now I'm getting this when making the model, aaaaaa it creates everything needed for the project but the actual model aaaa

haha

hollow oracle
#

@median rain not sure if u saw my ping the other day but just so you know, ModelReplacementAPI needs re-building with the latest MoreCompany dll

median rain
#

I'll see if I can't take care of that this weekend. This week is particularly busy.

long briar
#

in solo play when i was trying out new stuff i havent seen any issues with custom models or so

long briar
#

wth is with her arms concern

#

the moment i click on Setup Model it just becomes like this

elder hill
#

rip

long briar
#

looks kinda funny but i have absolutely no idea what im supposed to do about this

long briar
#

well turns out it just has something to do with the way the character is rigged

#

the upper arm is like made out of 2 bones instead of 1

vestal dew
long briar
#

good old new player experience

vestal dew
#

Almost gave up when I checked everything (as I thought) and model was just flying around detatched from player completely. And then I checked Unity Editor version... (it was 6000 something)

long briar
#

fixed my squidwards arms

median rain
long briar
#

also love the goofy default icon, the amount of people uploading their mods with it

#

gorgeous every time

long briar
#

been messing around with materials since im new to unity in general and my previous 2 mods just used the default materials completly without changes

median rain
#

Particularly with anime models like this, I would recommend using a toon shader like lilToon.

#

HDRP does not do them justice.

long briar
#

ill look into it next time

#

ive spend so many hours on these models now

#

î added some emissive to the eyes agony

#

i hope someone whos gonna use my mod is gonna freak out inside the facility someday

#

i realy wanna figure out lod's to see how far i can push performance without realy sacrificing quality when just chillin and goofin around in orbit but some things i just dont get like, Distance what? 0 meters? cm? feet? potatoes? do i have to figure this on my own where i dont even know how i could do that without bothering a friend every 5 to 10 minutes

median rain
#

I asked naelstrof about that a while back, and I believe it just lowers the physics refresh rate depending on distance, so it's not a LOD in the typical sense, being lower detail models, just slower physics.

#

Which may or may not be worth the effort.

median rain
grim scarab
#

got this error while adjusting the avatar definition of a model, along with a ton of missing bone logs. Does this mean my model isn't rigged correctly? i assume that's the case considering it looked terrible ingame. how would i go about fixing it?

grim scarab
#

i've also started getting "ArgumentException: Can't save persistent object as a Prefab asset" and i'm not sure what that means

median rain
#

Are you on the right version of unity?

#

We don't usually get real errors in the SDK, other than there also being missing bones in the avatar that ideally shouldn't be missing.

grim scarab
#

yknow i realized that as i was going to sleep last night

#

i don't think i have the same unity version the game uses

#

i'll try it again today with the right version and see how it goes

#

my editor was on 2021.3.18f1

#

no wonder

quiet grotto
#

I'm not sure what would be the best way to fix this—something on Mirror's end, something on MRAPI's end?

#

Without the fix versus with the fix.

eager jolt
#

yo some of the models and model-suit-packs ive downloaded arent loading as custom models. anyone know why that might be?

elder hill
#

i wanna say my custom models no longer work with the latest version? testing it a bit more rn

#

nah must be a skill issue since it didnt work even with downgraded version

median rain
# quiet grotto

This won't be fixed. Mirror is fundamentally incompatable with TooManyEmotes, which is what we have chosen to support.

quiet grotto
#

Fundamentally incompatible? It seemed to work alright with the culling mask changes.

median rain
median rain
quiet grotto
#

Honestly, it's more likely I could just update Mirror's culling mask instead and you wouldn't have to deal with any changes on your end. I'll ask around, thanks for the help

elder hill
#

i believe the reason was mirror was using a horrible layer for where it assumed cosmetics should be put on

#

and that caused a whole bad standard iirc?

median rain
#

Yeah, I recall that as well.

#

I don't think mirror decor is still updated, so changing its culling mask likely isn't possible without some really funky patches.

#

I think I had one working for a time, but it probably hasn't bveen maintained.

elder hill
#

not me wasting 2 hours because i forgot to add more suits as a mod Deadge

long briar
#

how would i set up LOD's? do i have to Setup the model with ModelReplacementAPI just like the normal models?

#

and how would that work when i build the project or set them up in the cs project

long briar
#

actualy nevermind i think i figured stuff out

elder hill
#

@median rain do you recall if you left a way for people to define where the item holder can be on the view model? (im assuming the view model item holder transform is where the item position's position that you're holding gets set to), its just that i need to add a bit of an offset to the holder for the model im usin

long briar
elder hill
#

yeah that socket

#

is there a way for us to give it an offset?

long briar
#

it does have item position offset

elder hill
#

i must've been blind

#

ty

elder hill
# long briar

is there something similar for the player's camera? or nah

long briar
#

not that i know

#

this 1 guy that made most of the genshin character models has custom camera positions for small characters but i think i read somewhere he got some custom code for that

elder hill
#

time to give lethalboykisser's a code a look lol

elder hill
#

im fine with writing code for the stuff

#

tacocat12's mod?

long briar
#

KinkyDeathMagic i think

elder hill
#

alright ty

long briar
#

i wish i could adjust the position of items further too

#

2 handed items are horrible

#

my models hold their shotguns like im aiming down the sight

#

covers like half the screen

elder hill
#

rip

median rain
grim scarab
# long briar

also this code doesn't reset the camera to the right position when you switch off the suit

long briar
#

oh realy? xD ive only tested very few of them but threw them out again because they have insanely bad performance so ive never properly used them

grim scarab
#

i just tested to see if the camera worked

#

and it did shrink to the right position

#

but switching to any other suit after those didn't reset it to the default position

#

also is there a way to adjust where the jetpack and beltbag positions on a model are? it looks like they're attached to the player object itself instead of the model, which makes it look a little weird on models that don't exactly match the proportions

grim scarab
long hinge
#

Any idea what's happening here? Is the model just stretching to the center of the map?

median rain
long hinge
#

Coo

long briar
#

Isn't that something that should already throw errors in unity and was talked about in the tutorial? concern

#

Or not errors but warnings

long hinge
#

Oh well

#

At least he's the first to ask about that specific problem

#

So if anyone else goes in the comments they can see the answer

long briar
#

I was expecting something with the rig too but I didn't know unparanted bones stretch the model across the entire map lol

median rain
#

I mean, you should expect a model's bones to be attached to each other, right?
It's certainly not the first time it's happened, though.

grim scarab
#

does the root position offset work? i'm trying to adjust the height of a model, but changing this and building the project again doesn't seem to affect it ingame

long hinge
#

what the hell?

long hinge
median rain
median rain
elder hill
grim scarab
#

also didn't you mention before that the item transform values didn't work atm?

#

or am i misremembering

median rain
#

Yeah. Root offset is fine, though.

grim scarab
#

gotcha

long briar
#

yea the item offset doesnt seem to work, been reworking my strinova bundle and just now got to actualy testing that

long briar
#

also i cant get any better performance out of this model and idk why at this point because i decimated the mesh a bit now but it just did not change at all

#

it actualy has like 10k less triangles than any of the strinova models ive been doing lately but has noticably worse performance

long briar
#

actualy its not noticably worse after testing some more but it is worse still despite the lowered amount of triangles

long briar
#

do i even need Physics LOD if i have distance culling from the LOD group component? imhuhimwuh

glacial tartan
#

Is anyone else experiencing these types of bugs when using a model? Without a model everything is held correctly but when I have a model equipped it's all weird.

long briar
#

thats kinda normal

#

especialy 2 handed items

glacial tartan
#

Ah. It's somewhat managable except when using XL Scrap as it forces us under the ground and we die

long briar
#

thats.... interesting lol

median rain
#

Also if you're talking about the base game LOD group, with the base game player models, it doesn't do anything to affect the performance of replacement models.

long briar
median rain
#

Yeah, it is unfortunate, but if you have tons of physics on a model, like I see you do with that one, there's little that can be done to improve performance. (physics is far and above tri count)

#

For one, unity jiggle physics is already incredibly performant software. It exceeds dynamic bones in just about every way.

#

I guess just leave a warning on the model?

long briar
#

i mean, i can think of another thing to improve performance a tiny bit but thats like, effort i dont realy wanna get into

#

mh ill figure something out someday

elder hill
# long briar especialy 2 handed items

i wonder why that is, i wanna look into it later on why two handed items are being weird even though everything should just be based on offset from hand position

#

rn in my model i have an offset placed that works for all 2 handed items afaik but looks really weird for one handed items, so i might just make a script that changes the offset depending on whether player is holding 1 handed or two handed with the model

prime galleon
#

is there any reason that jiggle physics colliders don't seem to work?

median rain
#

Did you put the collider reference in the jiggle rig component?

prime galleon
#

I think so? it works in the Unity simulation

prime galleon
#

nevermind, I figured it out

#

nevermind again, when I load them now, it just does this sort of thing

#

and no, no colliders should be intersecting

prime galleon
#

yeah, it seems like when you put anything in the colliders field, the jiggle rig in question just freaks out

#

it also doesn't seems to relate to the jiggle rig interacting with the collider

grim scarab
#

got this error when trying to load my modelswap on a pack with a lot of mods, not entirely sure what it means but this part specifically was only present in my large modpack. It caused a script for camera modifications to break down and not adjust after the suit gets put on the first time

#

and this error gets spammed while the suit is on in every profile i try it with, not just the big pack. I imagine i messed up something in the model to cause it

median rain
#

You should probably ask whoever made the mod that broke.

grim scarab
#

like the camera script? cus it's included in my model

grim scarab
#

nevermind, found the fix for both problems

#

the first error was caused by redundant code and the second was caused by a typo on a blendshape

grim scarab
#

is there a way to access what suit the player is currently wearing?

#

i have a script relying on gameObject.GetComponent<ModelReplacement.(model)>(), and it doesn't work on non-modelswaps, so i'm trying to convert it to read the current suit

median rain
#

Check the documentation on the wiki. There's a MRAPI static method you can use for this, provided that you have the playercontrollerB

#

Also, make sure to do proper null checks. Since it can return null.

grim scarab
#

thanks about that. I've narrowed down the problem to [HarmonyPatch(typeof(ModelReplacementAPI), "RemovePlayerModelReplacement")]. this line causes the error:

Failed to patch static void ModelReplacement.ModelReplacementAPI::RemovePlayerModelReplacement(GameNetcodeStuff.PlayerControllerB player): System.ArgumentNullException: Invalid argument for call NULL

on startup. It's not exclusive to my suit and happens to other modelswaps that use that harmony patch. I'm not sure if it's something I can fix, because removing that line stops the error from showing but doesn't allow my code for removing modelswaps to run. I also tried keeping that line while removing all the code from my remove method, and it still caused the problem. [HarmonyPatch(typeof(ModelReplacementAPI), "SetPlayerModelReplacement")] doesn't have this issue

elder hill
#

can you send the code?

#

a screenshot of it would bne preferrable

grim scarab
#

ignore the error on MRMODEL, i have it right already

elder hill
#

oh this patch

#

i've seen this one before

#

you remember your bodyreplacementbase class? just put this code in it

#

and then after base.OnDestroy(); write the code that's in the patch

#

and remove the log about the player.currentSuidID, i imagine that's what's erroring right now

grim scarab
#

i just added the mls logger so i could see if it was actually running, but i get it

grim scarab
karmic hamlet
#

I want to create a model from scratch for me and my friends. Does anyone have any tips or is there a loose set of directions for someone starting from the ground up? Ive seen these directions (https://github.com/BunyaPineTree/LethalCompany_ModelReplacementAPI/wiki/Using-the-Unity-Workflow) but I do not have a "rigged 3D model with human shaped armature, preferably as FBX."

GitHub

Contribute to BunyaPineTree/LethalCompany_ModelReplacementAPI development by creating an account on GitHub.

elder hill
#

You need a rigged 3d model with a humanoid shaped Armature to make a model replacement

long briar
#

he wants to create it

karmic hamlet
long briar
#

then look up a character rigging tutorial

elder hill
#

im messing with a bunch of items to test offsets and im seeing a lot of weird stuff lol

grim scarab
#

that's really weird

#

does it happen with automatic viewmodels off as well?

elder hill
#

idk about belt bag but the jetpack one wouldnt be a view model bug as far as i can tell

#

looking at the code i've been trying to solve it for well past an hour

#

and i dont get why it's not working

grim scarab
#

i'd imagine it's a collider problem

#

my models don't have the issue with the actual holding but don't play well with the jetpack in specific scenarios

#

like crouching i think?

elder hill
#

so when u hold the jetpack with your model, it actually shows the full jetpack?

#

and not just the buttons

grim scarab
#

it shows the handles and i think the belt, i don't fully remember

#

i could check real quick

elder hill
#

the belt is what i've been trying to solve

#

cuz its handled differently

#

would be appreciated

#

this is the code for the belt of the jetpack too

grim scarab
#

your shockwave model replacement is standalone on ts right

elder hill
#

it's part of coderebirth but there's a standalone version i deprecated yeah

grim scarab
#

you havent modified it since it was deprecated right

elder hill
#

nope

grim scarab
#

ok

#

i'll test yours and mine

elder hill
#

bet Pray

grim scarab
#

your model does this on my end with viewmodels on. mine does it too but not as extreme of a degree. with viewmodels active, the belt does not appear on either mine or your models, and dropping the jetpack either prevents the backpack from rendering or forces it through the floor. belt bag is unaffected once dropped, but didn't render when in offhand. once i switched back to orange suit and picked up the jetpack, it reset to normal when dropped. jetpack belt was visible on base model

#

not entirely sure how the viewmodels are generated but the beltbag and jetpack controls might be due to how the arms are rigged

elder hill
#

the holding of the controls/beltbag itself will be because of the item hold offset (which, probably due to my model size?, needs to be a different value for 2 handed and 1 handed items, which i havent yet implemented)

#

but yeah the part about the jetpack's belt just didnt seem to be near the model itself for whatever reason

#

the position of it is taken from the jetpack's code's lateupdate, so i modified the player's spine that it takes from and it still didnt like that for whatever reason

grim scarab
#

are you doing item hold offset from your project code?

elder hill
#

yeah, i changed it to be smthn different so that it looks good with 2 handed items (not on the release you're using i think)

grim scarab
#

ic

#

when you change the lowerspine position/rotation does it move at all?

elder hill
#

oh wait misread

#

havent tried that actually, but it is from the field so it would change ye

grim scarab
#

i was gonna suggest maybe using something like gameObject.transform.Find("ScavengerModel").Find("metarig").Find("spine").Find("spine.001").localPosition, where gameObject = player.gameObject. since this is what i used for the camera code on my models, but i'm not sure if it would help you

#

i'm also not sure which bone specifically jetpack uses to attach to

elder hill
#

it would be spine.001 yeah, looking at the player script and the jetpack script

elder hill
grim scarab
#

even if you set it to a super high value it doesn't change?

elder hill
#

im guessing it does change, it's just very weirdly offset for some odd reason

#

offset/forced in a specific location

grim scarab
#

which is unusual since the offsets from my experience are very sensitive

#

i wonder if you moving spine.001 around is moving the rest of the body's upper half, which makes it seem like it isn't moving?

#

so maybe setting spine.002 to move the opposite of what 001 does will make it more apparent?

quiet fox
#

Has anyone figured out how to implement something like blinking on an model? Just curious! :)

elder hill
quiet fox
#

Thank you! ^^

hollow oracle
median rain
paper hearth
#

hell ya!

sonic atlas
grim scarab
#

i was considering looking over code for both to see if i could experiment with compat between the two eventually, but i haven't got around to it yet

hollow oracle
#

Cosmetics seemed to work fine during my testing 🤔

#

I tested with the thicc model and the only issue I noticed was the cosmetics not being completely aligned with the player whilst they were moving

grim scarab
#

The thicc model should be mostly fine since its rig is similar to default scavenger

#

But some other models have cosmetics spawn in weird positions

#

E.g. lethalfortress2, the demoman suit causes head cosmetics to spawn upside down

hollow oracle
#

That'd just be the suit creator positioning the bones weirdly i'd guess

grim scarab
#

probably, but it happens on both models that are nothing like the employee, and models that are really close to the employee, so i don't think it's just weird rigging

long briar
#

i dont know if you can even move anything on the models besides the socket for 1-handed items

vital raft
#

Some modded 2-handed scraps are definetely offset when using a different model

long hinge
#

Any idea why this happens? They're definitely referring to this code segment.

grim scarab
median rain
brazen sparrow
#

Is there a good cel shading pack for unity to use for models?

#

Mostly for like anime characters

brazen sparrow
median rain
#

I use LilToon

long hinge
median rain
#

Oh, there's a couple causes that can result in models not loading, the awake function not running probably isn't one of them.

#

What they can do is look in the console when the mods are being first loaded in, and see if a message is posted that states that their model was registered.

#

If it is, they should be sure that the suit name is correct, and if so, be extra sure that there are no errors in the console.

#

If there is a message in the console regarding the model change when they put on the suit, and no error, they will have to investigate with something like unityexplorer, sonce then it's a model specific problem

prime galleon
long hinge
#

I think the whole greyed text thing is they panicked when they saw that the private void awake() was slightly darker given it wasn't being referenced by anything on their visual studio, which was confusing for me since my visual studio showed it as equally bright even if it wasn't being referenced

elder hill
long hinge
#

Yeah that just doesn't show on my visual studio lol

grim scarab
#

How do you add audio clips to the model so it plays them when you do something like emote ingame?

median rain
#

You can add this to your body replacement class.

        {
            if (emoteId == 1)
            {
                var clip = // your audio clip
                controller.movementAudio.PlayOneShot(clip, 0.8f);
            }
            if (emoteId == 2)
            {
                var clip = // your audio clip
                controller.movementAudio.PlayOneShot(clip, 0.8f);
            }
        }
#

I can't remember which emoteID is which, though.

grim scarab
#

Do I have to add the audio through unity or can I just have it in my project file and add it through c#?

elder hill
#

I think you need to add ur audioclip through assetbundle

grim scarab
#

Thought so

#

I'll look into the audio clips in unity tomorrow

grim scarab
#

When adding the audio clips to the model itself do I do it by adding Audio Source component for each one on the model? I haven't worked with audio in unity very much so I apologize if its a stupid question

elder hill
#

nah you can play multiple clips on one audio source

grim scarab
#

i'm guessing you drag multiple onto the AudioClip tab?

delicate glade
#

where it says "clip" is the clip its referencing each time, youd specify each clip at the top of the script

#

then add the references in the inspector

grim scarab
#

Yea I get that

#

I just don't know how to add the clips to the assetbundle

vital raft
#

Is it normal that players logging out leave behind their model floating?

grim scarab
#

yes

#

it's some issue with OnDestroy() where it doesn't remove the model when they leave

#

the function works fine when switching suits though

median rain
#

That's a bug that morecompany added. They disable the script when players log out, which prevents OnDestroy from being called.

grim scarab
#

it took me way too long to realize adding audio is done with this

#

chat i might be immensely stupid

elder hill
#

You might be

light wadi
#

Would there be anyway to get the models out of the compiled DLL after its made? i made a thing like 4 months ago and wana recover it to use in unity again because i dont have the origional unity project anymore...

light wadi
#

also i think it would be cool if you could add a config option to force change the default orange suit to any suit you want by puttint the suits name in config, so any server you join client side it will be that suit (some mods dont have that option)

vital raft
#

The generated view models tend to offset items in odd ways, so that could be weird for physics?

alpine vortex
#

sup gang

#

i wana know how i can add, import or replace skin player models

alpine vortex
#

or if anyone can do it for me and add a skin

grim scarab
#

you can watch naqibam's tutorial in the pins

hollow relic
#

@alpine vortex

alpine vortex
#

Awesome

unreal heron
#

i can't figure out how to rotate my model and apparently this was already answered here?

#

i can't find it tho

#

nvm i just kept trying it over and over and eventually it stopped being rotated!

prime galleon
olive eagle
#

@long hinge sorry to bother but whenever I equip my model, It appears very far outside of the ship/moon and I do not know why any info to fix would help thanks!

long hinge
olive eagle
long hinge
#

Are you trying to add the modelreplacementsdk via the github url?

olive eagle
#

yes

#

it comes up with this error in console: Failed to find entry-points:
Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'ModelReplacementAPIEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' ---> System.Exception: Failed to resolve assembly 'ModelReplacementAPIEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' in directories: E:\Unity\Unity 2022.3.9f1\Editor\Data\MonoBleedingEdge\lib\mono\unityjit-win32
E:\unity projects\My project (10)\Library\PackageCache\[email protected]
E:\Unity\Unity 2022.3.9f1\Editor\Data\Managed
E:\unity projects\My project (10)\Library\PackageCache\[email protected]\Unity.Burst.CodeGen
E:\unity projects\My project (10)\Library\PackageCache\[email protected]\Editor\VisualScripting.Core\Dependencies\DotNetZip

long hinge
#

Try restarting your computer. I've had trouble adding the package sometimes

olive eagle
#

ok

olive eagle
#

managed to fix everything thank you so much for the support!!!

long hinge
#

neat

prime galleon
#

is anyone else having a problem where modelreplaced suits get stuck in doorways?

prime galleon
#

wait, I bet it's the step mod I have

median oracle
#

i tried to mod models into lethal but every time i try it out the models are just invisible
someone might know what i did wrong?

long hinge
median oracle
#

i did not use that version
im gonna try it out with 2022.3.9f1

median oracle
#

the model is still invisible when i use unity 2022.3.9f1

long hinge
median oracle
#

i made a new HDRP project and followed the steps in the video

median oracle
#

i tried reinstalling unity and it seems to work now
ty for the help