Code_Man Posted February 28, 2018 Share Posted February 28, 2018 I would like to apply a material to specific instances of meshes in the game trough torquescript, but i dont know how to do this.Its fine if it applies to the whole model instead of just a specific material in a collada node.I also noticed that i seem to have to prepend the model name to a material when using collada models, this is a problem for me too since i reuse many materials for different models.I only use collada for now, though if have to i could convert them to dts.How could i go about this? Quote Link to comment Share on other sites More sharing options...
Duion Posted March 1, 2018 Share Posted March 1, 2018 Are you trying to apply lightmaps to the models? This is something I'm also interested in.From what I know it is possible to swap materials per instance of a mesh through chosing a different skin. A skin is a material using the same namespace as the original material, maybe this feature could be extended for what you need, but this would need to happen on the fly. Quote Link to comment Share on other sites More sharing options...
Code_Man Posted March 1, 2018 Author Share Posted March 1, 2018 Are you trying to apply lightmaps to the models? This is something I'm also interested in.Not really, at this stage atleast. From what I know it is possible to swap materials per instance of a mesh through chosing a different skin. A skin is a material using the same namespace as the original material, maybe this feature could be extended for what you need, but this would need to happen on the fly.Hmm, are the player models in uebergame using skins too for team colors?If so i might perhaps be a able to figure it out on my own Quote Link to comment Share on other sites More sharing options...
Duion Posted March 1, 2018 Share Posted March 1, 2018 I setup my rock models to use skins, so any instance of a rock model can have any other rock material I have in the game, simply by changing the skin, you can try them out.https://github.com/Duion/Uebergame/blob/master/art/textures/rock/materials.csThe base material is "base_rock_main" and each skin replaces the "base" part of the name, so in the skin field of the shape you enter "plain_01" if you want to use the material "plain_01_rock_main" then the instance of the rock will change to that, this can also be changed on the fly through scripts like I do with some objects using team colors. Quote Link to comment Share on other sites More sharing options...
Duion Posted March 13, 2018 Share Posted March 13, 2018 @DoyleWesAnything that you can imagine, I use it on rocks, because they all use a seamless texture, so every other seamless texture will fit as well, limitations are objects with unique UV layout, since then other textures will no longer fit well and the other limitation is objects with multiple materials and of course some ways that do not allow changing skins like forest objects, but they have two materials also.You could theoretically make anything into a skin so you can exchange anything with anything, but there are probably better ways through coding to do that. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.