Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

If you have any questions, reports, suggestions, or requests about Live2D, please send them to this forum.
※We cannot guarantee statements or answers from Live2D staff. Thank you for your understanding in advance.
 
Live2D Cubism
Cubism Products and Downloads
Cubism product manuals and tutorials
Cubism Editor Manual    Cubism Editor Tutorial    Cubism SDK Manual    Cubism SDK Tutorial
[INFORMATION](03/28/2024)
Cubism Editor 5.1 alpha version is now available!
Find out how to use the new features here.
Please take this opportunity to use it and give us your feedback!

For more information and download, please check out the Cubism Editor 5.1 alpha category.

Dynamically Changing Model

edited December 2023 in Help
Heya ^_^

I'm trying to have the model be change-able mid-game, through a script.

My current attempt is to have the script set the path in LAppModelProxy to the path of the new model.json file. This resulted in nothing happening >.<

I then tried to force the Visible variable, call Awake and OnRenderObject methods. These haven't accomplished anything =/

If I set the starting path to the model, it loads the model, but doesn't override it when I change the path and/or try these method calls.

Any help would be appreciated :D

Comments

  • Turns out that the problem is trying to load resources outside of the Resource Folder -.- And it looks like it'll be a big headache to sort all of that out D:
  • i'm more of an artist than a programmer, but I'm sure it would make it easier for programmers to help you find a solution if you mention what programs you're using (Unity, Tyranobuilder etc) and what version SDK you have :)
  • renoa said:

    i'm more of an artist than a programmer, but I'm sure it would make it easier for programmers to help you find a solution if you mention what programs you're using (Unity, Tyranobuilder etc) and what version SDK you have :)

    Hello Renoa ^^

    I'm using Unity (as this is the Unity board :P), I'm writing my scripts in C# and am using whatever SDK was current a month ago. >_<

    Thanks :D
  • Hi Adura,

    do you want to swap models or do you want to swap parts of a model in game?
  • Hi Andi!

    My post was about swapping models mid-game (switching the model.json files). I got it to work, but only for files in the Unity Resource folder. And it looks like the FileManager, and many of the other classes, are designed to work that way. At this point, I'll probably just have to work within that restraint :x Not optimal, but I can live with it :p
    Thanks for the reply ^^
  • You could also create a game object for every model you want to use and one additional game object that works as a proxy for the models. You could then manipulate the proxy and control which model to display via the proxy. This would erase the necessity to put everything in resource folders.
  • You could also create a game object for every model you want to use and one additional game object that works as a proxy for the models. You could then manipulate the proxy and control which model to display via the proxy. This would erase the necessity to put everything in resource folders.

    But the Live2D class can only load textures, text assets and sounds (everything, basically) from the resource files. If I set the path to anything outside of the resource folder, the Live2D game object doesn't work, and I get errors from the FileManager class (which tries to gather the resources the model file uses, I think.)

    Is there something I'm missing? Or would I have to rewrite how the Live2D classes access their files (which I'd much rather not do >_<) (I had tried to alter how the Live2D FileManager gathers its resources, but loading a 'TextAsset' proved too annoying D: )
  • I posted a small app I created in another thread (http://community.live2d.com/discussion/295/what-are-you-working-on). For that app I wrapped a few Live2D classes so that I didn't have to put everything in resource folders. It ended up rather simple to implement. I didn't implement animations, though. Maybe you could give the project a look?
Sign In or Register to comment.