Jump to content

Mesh with multiple maps along same "material" - How to texture it all with one click


xFlandrex
 Share

Recommended Posts

Greetings! 

I have made a bigger mesh which for resolution reasons I decided to break into 7 maps. I was wondering if it is possible to make a HUD that with one button changes the whole skin.  I know very little about HUDS i've only used the Renderworks texture change HUD.

Each face would have to be mapped to the right texture.

Thanks in advance, 

I hope i'm not posting in the wrong category!

Link to comment
Share on other sites

If you are a programmer and can understand LSL, then this fairly simple to create; the less you understand LSL the more difficult it could be. You have to add a script to the object you are changing and a script to the HUD, which have to talk to each other.

These are LSL functions that you can use in an object to set textures.
https://wiki.secondlife.com/wiki/LlSetTexture
https://wiki.secondlife.com/wiki/LlSetLinkTexture
https://wiki.secondlife.com/wiki/LlSetPrimitiveParams

The scripts with these Texture commands also needs to communicate with the HUD.

There are working examples in the "RuthTooRC3 BoM Mesh Female Body" which you can get full perm for free from here:
https://marketplace.secondlife.com/p/RuthTooRC3-Bakes-On-Mesh-Female-Body/18174055

There are several examples of scripts that do what you are asking in that body. Two that work together are:
RuthTooRC3_BoM_BODY_Upper-Lower
RuthTooRC3_HUD_BoM_Applier
Each contain a script that work with each other, a HUD script and an object (the body) script.
These could fairly easily be adopted to work in most other objects.

While this HUD uses a separate button for each texture face, adding more llSetTexture (llSetLinkPrimitiveParamsFast in this example) calls to the object script would set the textures for as many faces as you want via a single button.

Link to comment
Share on other sites

Posted (edited)
19 hours ago, Sean Heavy said:

If you are a programmer and can understand LSL, then this fairly simple to create; the less you understand LSL the more difficult it could be. You have to add a script to the object you are changing and a script to the HUD, which have to talk to each other.

These are LSL functions that you can use in an object to set textures.
https://wiki.secondlife.com/wiki/LlSetTexture
https://wiki.secondlife.com/wiki/LlSetLinkTexture
https://wiki.secondlife.com/wiki/LlSetPrimitiveParams

The scripts with these Texture commands also needs to communicate with the HUD.

There are working examples in the "RuthTooRC3 BoM Mesh Female Body" which you can get full perm for free from here:
https://marketplace.secondlife.com/p/RuthTooRC3-Bakes-On-Mesh-Female-Body/18174055

There are several examples of scripts that do what you are asking in that body. Two that work together are:
RuthTooRC3_BoM_BODY_Upper-Lower
RuthTooRC3_HUD_BoM_Applier
Each contain a script that work with each other, a HUD script and an object (the body) script.
These could fairly easily be adopted to work in most other objects.

While this HUD uses a separate button for each texture face, adding more llSetTexture (llSetLinkPrimitiveParamsFast in this example) calls to the object script would set the textures for as many faces as you want via a single button.

 

Thank you kindly for your reply.

I do not know scripting unfortunately but I got the gist of what you're talking about. The problem though is the following: each face has a different map.

 

So what I ideally need would be a script that with the click of 1 button that would change 7 faces with 7 different maps. 

I apologize if you explained how to do that and I didn't understand.

 

I will look into the Ruth body though to see if I can use parts of the script.

Edited by xFlandrex
  • Like 1
Link to comment
Share on other sites

1 hour ago, xFlandrex said:

 

Thank you kindly for your reply.

I do not know scripting unfortunately but I got the gist of what you're talking about. The problem though is the following: each face has a different map.

 

So what I ideally need would be a script that with the click of 1 button that would change 7 faces with 7 different maps. 

I apologize if you explained how to do that and I didn't understand.

 

I will look into the Ruth body though to see if I can use parts of the script.

The complexity of the scripts required to achieve what you're attempting to do will depend on

  1. If the object you're texturing is a single object with multiple faces or multiple linked objects.
  2. Whether you're dealing with just a single colour texture or additional maps like normal and specular maps or PBR materials.

If it's just a matter of texturing a single object with multiple faces then you'll likely find plenty of examples to choose from.  There are probably quite a few examples that cover texturing linksets too however, since it's a relatively new feature, there are likely to be fewer examples of how to achieve the same results with PBR.

Creating the HUD itself is by far the easiest part, setting up the communication between HUD and object is equally simple and (assuming you aren't dealing with multiple objects/maps) the process of applying the textures is fairly straight forward as well.  Storing and successfully retrieving all the necessary texture UUID keys is probably going to be the most laborious part of the process.

If I were approaching the problem I'd be using llRegionSay for communication, llSetLinkPrimitiveParamsFast to change the textures and quite possibly using llLinkSetDataWrite and llLinkSetDataRead for storing all the data (although most older scripts will likely still be using strided lists).

 

On 7/3/2024 at 8:51 AM, xFlandrex said:

I hope i'm not posting in the wrong category!

You may have more luck getting specific pointers and examples to work from if you posted in the LSL Scripting sub-forum (unless you really don't want to have to learn anything about scripting in which case you're probably better off posting in the Wanted section and just paying someone to do it for you).

  • Like 1
Link to comment
Share on other sites

4 hours ago, Fluffy Sharkfin said:

The complexity of the scripts required to achieve what you're attempting to do will depend on

  1. If the object you're texturing is a single object with multiple faces or multiple linked objects.
  2. Whether you're dealing with just a single colour texture or additional maps like normal and specular maps or PBR materials.

If it's just a matter of texturing a single object with multiple faces then you'll likely find plenty of examples to choose from.  There are probably quite a few examples that cover texturing linksets too however, since it's a relatively new feature, there are likely to be fewer examples of how to achieve the same results with PBR.

Creating the HUD itself is by far the easiest part, setting up the communication between HUD and object is equally simple and (assuming you aren't dealing with multiple objects/maps) the process of applying the textures is fairly straight forward as well.  Storing and successfully retrieving all the necessary texture UUID keys is probably going to be the most laborious part of the process.

If I were approaching the problem I'd be using llRegionSay for communication, llSetLinkPrimitiveParamsFast to change the textures and quite possibly using llLinkSetDataWrite and llLinkSetDataRead for storing all the data (although most older scripts will likely still be using strided lists).

 

You may have more luck getting specific pointers and examples to work from if you posted in the LSL Scripting sub-forum (unless you really don't want to have to learn anything about scripting in which case you're probably better off posting in the Wanted section and just paying someone to do it for you).

Hey there, thanks a lot for your reply!

The object concerned is a single object with multiple faces and I'm interested in just changing the colour textures since the normals and speculars will be the same along all versions. 

I appreciate your tips a lot, I will try to give scripting a try and I'll also keep the possibility of commissioning it in mind.

  • Like 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...