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
[About macOS Sequoia] (Updated October 22, 2024)
Live2D Cubism Editor 5.1.02 now supports macOS Sequoia.
Other Live2D Cubism products currently released are not guaranteed to work on macOS Sequoia.
Please refrain from upgrading macOS, as it may not operate properly.

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.