Multi-Texture Support for custom static models

  • Hello all!
    So as most of us know, we have the amazing plugin allowing us to import custom 3D models and placing them in game! (Example: StaticModelLoader)

    I absolutely love everything about this plug-in, but a very limiting problem exists when a model has more than 1 texture. Take a stove for example, it will usually have a texture for the range, another one for the body, and another one for the buttons/knobs. But in its current state, the plugin only supports ONE of those textures so you get one funky looking stove.

    Does anyone know of/know how to create something for this plugin that allows for multiple textures? I have ZERO knowledge of any coding/writing and dont even know where I would begin. If not, is it possible to edit the model in blender or something to combine all the textures into one? Thank you in advance for any help!

  • Currently the only solution for this would be to load multiple models (1 model per texture). Basically this could be incorporated into the plugin to handle this automatically, but it's a bit tricky. Under the hood the game still requires a separate model per texture (unless a TextureArray is used, but that requires a special setup and introduces a few limitations).


    We're thinking about adding a better way to handle this in the new version, maybe it will use submeshes.


    The only thing you could do now as a workaround would be to merge all textures into a single atlas. For 3ds max, there is a plugin out there which bakes all used materials into a single texture automatically, but I'm not sure if there is also a similar thing for Blender :thinking: If there is no such tool available for Blender, you have to do that manually :silenced:

  • I'm not really used in model using, but is there a way to pretent i. E. To show false models at start up?"otherwise the game could fail

    This wouldn't necessarily help regarding the issue raised by the OP (depending on what's considered a "false model"), but irrespective of that, I agree that it would be helpful if the game could at least detect "broken" models. However, this is only possible to a certain degree - the game (or more specifically the server, where the plugin is actually executed) could only check a few basic things. Not sure what's happening right now if a broken model is loaded, does the game actually crash? :huh: IIRC there should be just an error message in the console :thinking:

  • This wouldn't necessarily help regarding the issue raised by the OP (depending on what's considered a "false model"), but irrespective of that, I agree that it would be helpful if the game could at least detect "broken" models. However, this is only possible to a certain degree - the game (or more specifically the server, where the plugin is actually executed) could only check a few basic things. Not sure what's happening right now if a broken model is loaded, does the game actually crash? :huh: IIRC there should be just an error message in the console :thinking:

    An error message occurs, that' right. I thought it was my fault, so I didn't send the log. I'm not particularly familiar with model usage, so I just have to test every model. Sometimes the same model worked, but next time the game crashes.

  • This wouldn't necessarily help regarding the issue raised by the OP (depending on what's considered a "false model"), but irrespective of that, I agree that it would be helpful if the game could at least detect "broken" models. However, this is only possible to a certain degree - the game (or more specifically the server, where the plugin is actually executed) could only check a few basic things. Not sure what's happening right now if a broken model is loaded, does the game actually crash? :huh: IIRC there should be just an error message in the console :thinking:

    i can say that some models do crash it. i have been using this plugin to test .obj and .dds textures for the customitemloader before i worry about the itemdef and icon files. ive had some .obj files not allow the server to boot as well it will load it then crash the server and not allow it to restart. i could try to find the error logs if it would help in any way

  • i can say that some models do crash it. i have been using this plugin to test .obj and .dds textures for the customitemloader before i worry about the itemdef and icon files. ive had some .obj files not allow the server to boot as well it will load it then crash the server and not allow it to restart. i could try to find the error logs if it would help in any way

    Can you maybe send me one of the models in question (+ the according texture) via PM? If there is an issue with the model, maybe it's something the game can catch (so at least it doesn't crash anymore) :) If you have an additional error log, that would also be helpful

Participate now!

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