Example: StaticModelLoader

A big new update is now available, introducing biomes, caves and much more!
Latest hotfix: 0.7.0.3 (2024-02-21)
  • Difficulty: Advanced


    This plugin allows you to select and upload a 3D model from your hard drive and place it in the world. The model is then saved automatically in a separate database file (so it will be loaded again after restarting the server).


    In order to upload the 3D model, this plugin creates a new custom item which is craftable at the workbench (workbench -> miscellaneous). This item is only craftable by admins, although they can still give this item to regular players.


    Be careful when uploading too many models with too many polygons, since this could have a major impact on the performance!

  • Erstmal danke für dieses nette Beospiel von Dir.


    Ich habe mir einige kostenlose 3d Objekte runtergeladen, bei einigen kam es zu abstürzen ( siehe error Log )


    Was jetzt aber wohl nicht sein sollte ist, nachdem ich ein 3D Objekt gesetzt habe ( geht nicht im Raster ), hat das
    Objekt auch kollision und man kann es mit Spitzhacke oder so wegschlagen.
    Nach dem ich von der Map im SP runter bin und dann wieder drauf, hatten die Objekte KEINE kollision mehr und
    liesen sich auch nicht mehr weg schlagen.
    Dazu kommt das wenn ich das Objekt aus dem Plug-in ordner nehm ist es auch weg. kopiere ich die daten rein ist das wieder
    da. Und zum letzten hatte ich eine kleine Vervielfältigung, bei Katze,Ente und Schwan, die Werkbank und der Ballon blieben einzeln.


    sauberes Bild
    hier haben sich tiere vermehrt, teilweise wurde diese als sie noch kollision hatten ( Große Ente ) weg geschlagen und waren dann später wieder da.


    Anbei noch eine der Log, von 3d Objekten wo es nicht funktionierte.



    Ich hab das Plugin runtergeladen, mir ein kostenloses 3D-Modell runtergeladen, die Datei entpackt in ein extra Verzeichnis und dann im Spiel den "Bauplan" gecraftet. Dann wollte ich das Modell platzieren. Es wurde auch kurz angezeigt aber dann ist das Spiel abgestürzt

    kann ich so bestätigen. Es wäre hilfreich wenn man wüste auf was man außer das es micht so viele Poligone sind achten muss ? und dazu, was sind eigendlich nicht zu viele Poligone ? diese Objekte auf den Bildern haben 10000

  • bei mir haben sich bis jetzt keine objecte vermehrt oder sind nach einem relog verschwunden. allerdings hab ich erst ein paar aufgestellt zum testen 5 stück und meine objecte selbsterstellt und somit verwende ich (abgesehen von der künstlerischen seite) fehlerfreie objecte.
    objecte runterladen und so wie sie sind ins spiel bringen ist keine so gute idee, da sehr viele fehler haben. zb. vielecke oder fehlende faces. also immer erst in blender laden auf fehler überprüfen ausbessern und dann im spiel testen.
    oder sucht nur nach modellen wo game ready dabei steht ;)

  • How to set the size of the model?

    This is what I eventually want to know.


    ------------


    Also, I wish this plugin could handle folders with textures in them, or even read from the singular file itself. Most files today contain both models & texture files. Also, I have model files bundled with many other models so I wish it would also pick out all those different models so I can then plop them into the world.


    I'd be amazed if it reads Unity extensions because that's where my hang up is, and that's where the Japanese are with their models. That's where VRchat and a few other VR games are at.

  • The size of the model is set by the model itself in the software used to make it or the scale factor in the plugin's code by the World3DModel.setScale(float) method.

  • Ich hab das Plugin runtergeladen, mir ein kostenloses 3D-Modell runtergeladen, die Datei entpackt in ein extra Verzeichnis und dann im Spiel den "Bauplan" gecraftet. Dann wollte ich das Modell platzieren. Es wurde auch kurz angezeigt aber dann ist das Spiel abgestürzt

    Hmm... scheinbar fehlen die "Normalen" des Modells. Diese sind für die korrekte Beleuchtung des Modells zuständig. Der StaticModelLoader geht generell davon aus, dass die Modelle, die platziert werden, von Licht beeinflusst werden sollen... ich werde eine kleine Änderung am Spiel vornehmen, sodass es in dem Fall zumindest keinen Absturz mehr zur Folge hat ^^ Allerdings werden diese Modelle mit fehlenden Normalen dann eine fehlerhafte Beleuchtung haben :/


    Ich habe mir einige kostenlose 3d Objekte runtergeladen, bei einigen kam es zu abstürzen ( siehe error Log )

    Das ist dasselbe Problem wie bei @Avanar: Bei diesem Modell fehlten scheinbar ebenfalls die Normalen. Wie @dagoline schon sagt, leider sind viele Modelle, die frei erhältlich sind, fehlerhaft oder unvollständig. In Kürze werden wir ein Mini-Update rausbringen womit solche Abstürze zumindest verhindert werden, allerdings ist der beste Weg tatsächlich, die Modelle vorher in einem Modell-Programm zu öffnen und von dort sauber zu exportieren ;)


    Was jetzt aber wohl nicht sein sollte ist, nachdem ich ein 3D Objekt gesetzt habe ( geht nicht im Raster ), hat das Objekt auch kollision und man kann es mit Spitzhacke oder so wegschlagen.

    Dass das Objekt Kollision hat und weggeschlagen werden kann ist tatsächlich gewollt^^


    Nach dem ich von der Map im SP runter bin und dann wieder drauf, hatten die Objekte KEINE kollision mehr und
    liesen sich auch nicht mehr weg schlagen.

    Das ist eigenartig... ich habe das Plugin nochmal geringfügig verändert und den Download oben ausgetauscht, probiere bitte, ob damit dieses Problem weiterhin auftritt 8|


    How to set the size of the model?

    You can use the + and - keys on your keyboard to resize the model :)


    Also, I wish this plugin could handle folders with textures in them, or even read from the singular file itself

    Unfortunately the internal World3DModel class requires a single texture per object atm :( Although you could create your own class which handles multiple "World3DModel" instances (one per texture) automatically.


    I'd be amazed if it reads Unity extensions because that's where my hang up is, and that's where the Japanese are with their models. That's where VRchat and a few other VR games are at.

    Basically that's possible, but we have to write our own extractor for Unity packages (in order to extract the models and textures from these container files). The other games you're referring to are probably made with Unity, so it's obvious that they can easily read Unity packages ^^ However, there are two big issues with Unity extensions when it comes to RW: On the one hand, Unity uses its own materials and shaders, which cannot be used in RW. You could use the textures though, but it's getting tricky if the material contains further information (or if it's a procedural material, or if the model just uses a plain color instead of a texture). On the other hand, Unity packages are sometimes pretty big (in terms of file size), especially if they contain lots of additional data which isn't used by RW at all (although this wouldn't be an issue if you create your own Unity packages)...

  • Dazu kommt das wenn ich das Objekt aus dem Plug-in ordner nehm ist es auch weg. kopiere ich die daten rein ist das wieder
    da.

    ja das ist aber klar - du musst die auch aus der datenbank löschen ;)


    @red51 mal ein herzliches dankeschön für das plugin - ich glaub ich bin jetzt wieder auf monate beschäftigt :)

  • Unfortunately the internal World3DModel class requires a single texture per object atm Although you could create your own class which handles multiple "World3DModel" instances (one per texture) automatically.

    Alright, I guess I'll have to eventually find a way to get single textures out of these models. I would create the "class" if I knew how so I may have to wait for an opportunity for when someone knows how to handle this so I can import 2 weapons, 2 characters, and such.


    Sorry for spamming your forums up so much but keep in mind when you see me venting just know that I'm just an inch away from FINALLY adding something I wanted to add since 2015 (and even earlier) just to be roadblocked by a single .png file & a .dds file. I'm so close, and this just pains me so much. I honestly want help here, and I do thank you for noting that.


    Multiple instances hmm..... Was wondering if that was even possible. May give that a whirl when I can hoping I can get it working then. As for the UNity bit, was worth a shot. I guess I'll have to forget about that trying to convert them into Rising World API side of things.

  • ja das ist aber klar - du musst die auch aus der datenbank löschen ;)

    Ja das ist klar, habe mich da etwas falsch ausgedrückt. Als das Objekt noch kollision hatte, es mir aber zu groß war, habe ich es mit der Spitzhacke weggeschlagen ( nun dachte ich sollte es auch aus der Datenbank raus sein ), nach neuem einloogen war in dem Fall die Ente wieder da und auch ohne Kollision.



    Das ist eigenartig... ich habe das Plugin nochmal geringfügig verändert und den Download oben ausgetauscht, probiere bitte, ob damit dieses Problem weiterhin auftritt

    werde ich testen und gebe dann bescheid :thumbup:


    Die Ente die frei zum download ist HIER

  • Finally got it working by using test models from:


    https://free3d.com


    Still noticing issues where the plugin needs have a new main menu with following options:
    1) Current (OBJ & Texture prompt)
    2) OBJ & Texture imported in one go
    3) OBJ & Multiple textures support.


    That is, if it that is possible. So close! There's so many models with many textures that it becomes a bit difficult finding ones with singular textures. Was told to add a 'Class', and I don't know how to do that.

  • Sorry for another posting but I seem to be having an issue where these blueprints keeps prompting me without giving me a chance to exit. Can it prompt less in multiplayer instances (Singleplayer seems to work fine). It also seems to auto-place the models without letting me orientate and etc. Can we get an 'X' button, and tone down the constantly prompting of the menu?

  • @red51 besteht die möglichkeit, dass das .db file im weltordner gespeichert wird ?
    wenn es im plugin folder ist, laden die objecte in jeder welt.


    auf einer neu kreierten welt sieht das dann so aus an den entsprechenden daten.

    Wenn man den Pfad der DAtenbank ändert zu String path = plugin.getPath() + "/" + plugin.getWorld().getName() + ".db"; sollte das kein Problem mehr sein. Dann wird im plugin ordner für jede Welt eine db angelegt

    Gamer aus Leidenschaft
    (Web) Entwickler aus Leidenschaft
    <3 Vater aus Leidenschaft <3
    (prio in aufsteigender Sortierung ;) )


    ~~~~~~~~~~~~~~~~~
    1. Entweder man macht etwas richtig oder lässt es bleiben!
    2. Egal wie lange etwas dauert, Hauptsache es wird fertig (irgendwann)
    ------------------------
    Discord: Devidian#1334

  • Sorry for another posting but I seem to be having an issue where these blueprints keeps prompting me without giving me a chance to exit

    Hmm... maybe it interfers with another plugin? 8| Can you get rid of the upload dialog when pressing ESC?


    @red51 besteht die möglichkeit, dass das .db file im weltordner gespeichert wird ?

    Ja, das ist vermutlich sogar sinnvoller. Wie @Devidian schon erläutert, müsste dafür im Grunde nur Zeile 83 im Code geändert werden. Falls es im Weltordner gespeichert werden soll, müsste die Zeile so aussehen: database = getSQLiteConnection(getWorld().getWorldFolder() + "/" + "WorldModels.db");


    Ich habe aber den StaticModelLoader nichtsdestotrotz geupdated ;) Jetzt werden die Modelle standardmäßig im Weltordner gespeichert. Um bereits bestehende Modelle mitzunehmen, müsstest du einfach die "WorldModels.db" Datei aus dem Plugin-Ordner in den entsprechenden Welt-Ordner verschieben :)

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!