Question Plugin to trigger AFTER VAM finishes loading appearances?

pinosante

Well-known member
Messages
391
Reactions
478
Points
63
I'm loading 20 appearances at the same time. I want to do something after that is finished. But I can't find a plugin which triggers after loading is completed. Is something like this available?
 
Yeah, so my use case is that I have my tool (https://hub.virtamate.com/resources/vam-evolutionary-character-creation.17382/ ) and I've added a "variate" button which allows users to load 20 different appearances. If you click on a button, it triggers the load appearance action. This all works. But since each appearance is different, skins and everything need to be loaded, so there is like a 5 second loading time for each appearance. In this case, I have 1 Person, and each button loads a different appearance for that 1 Person.

My idea was, to solve the loading times for each preset, by "pre loading" all 20 appearances on 20 Persons. That all worked fine, except that there is no way to know when Vam is finished. So what I did was, have 20 persons, (without collission) at the same spot, and load all 20 appearances on each of the 20 persons. This would give a long loading time of maybe 30 seconds, but, after that, by using atomcontrol: Off on each of the 20 persons and letting the 20 buttons choose which of the 20 person to turn on (Atomcontrol: on) I had a situation where the loading time was 0 during usage. So clicking on different numbers, would instantly switch between characters. But: telling vam to load all the appearances, and then also telling vam to turn all AtomControl off for each person, resulted in Vam not loading the appearances. Since vam apparently is smart enough to not load appearance for atoms that are invisible. So now I have the problem: when do I know that VAM has finished loading the appearance for all the active persons, so I can turn them off.

But, long story short, it turns out that having a save file with 20 persons is a problem by itself. So that approach is not gonna work. Loading a savefile with 20 persons takes FOREVER.

So, what is my question:

How can I pre-load appearances for 20 persons or reduce loading time or use caching of some sort?
 
Upvote 0
Unfortunately I have no idea how you can overcome this. To me the inner workings of VAM is like magic and there's nothing I can think of.
Perhaps this recent plugin from JayJayWon might be of help?
 
Upvote 0
Unfortunately I have no idea how you can overcome this. To me the inner workings of VAM is like magic and there's nothing I can think of.
Perhaps this recent plugin from JayJayWon might be of help?
Yeah I asked JayJay when he released this, if it would speed up appearance loading, and it was unfortunately a no.
 
Upvote 0
@pinosante
Interesting project (y)

Assuming the appearances are loading with the scene:
I know VAM allows to register new EventHandlers for a 'OnSceneLoaded' - which is triggered when the scene is fully loaded.
So it's possible to create a Plugin for that.

But honestly I'm not sure it's worth it. I tried your project and for me appearance switching is not instant - but fast enough - takes a 1-2 seconds for me. Don't think it's worth to spawn 20 Person atoms just for appearance preloading - they eat up a lot memory even optimized without hair and clothing - this could make your project unusable for users of 16 GB RAM PCs (if I understood your post #3 correctly that's what you do? they only exist to "hold" the appearance in memory so to speak?).
Think I'd actually remove one of the 3 Person-Atoms to showcase the appearances.
 
Upvote 0
@Sally Whitemane
Yeah, there is a plugin that I'm using for on-scene load stuff. But in the normal use case, you're basically working with one VAM save the whole time, and in the background, the appearances are being updated by the python app. So the buttons are referencing the 20 child appearances, and the files themselves, change in the background. So in this situation on-scene load doesn't really work, since I'm not (re-)loading the actual VAM save.

But as you also mentioned, the 20 person atom approach is too costly and slow to use for preloading anyway, so I'm dropping the idea.

Regarding the switching being 1-2 seconds that is indeed the case if you use the template for all child appearances (which is the normal use case), but I am adding a feature where you can use "variate", which chooses 20 random appearance templates. That slows down the appearance loading, since each appearance has different skins, hair, etc., so then you can easily wait 5-10 seconds before the next appearance is loaded. That is the reason I was looking into pre-loading. I'm bug-testing this feature and then I'll release it and then you'll probably see what I mean.
 
Upvote 0
Back
Top Bottom