Jump to content

Texture change mesh


Sienia Trevellion
 Share

You are about to reply to a thread that has been inactive for 4194 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Okay, another question. I have created a mesh shirt in blender 2.66 that is one object. I have a v-shaped section on the front that I want to apply a fabric texture to (let's call this fabric 1) and I want the rest of the object to have a different fabric (let's call this fabric 2). I want the shirt to texture change so that the wearer can click on either "fabric 1" or "fabric 2" and have them change between 5 different fabric choices in each area. So two questions.

1.) Do regular texture change scripts work in mesh?

2.) I have defined the two different areas on the shirt with materials in blender and assigned the fabrics for each. Would I save my textures for each material area as a separate uv texture, or would I save them together on the same uv texure. Saving them alone would mean I'd create 10 different textures (5 for each area). Saving them together would mean I'd create 25 different textures.


I hope this makes sense.

Link to comment
Share on other sites

Sounds like you're better off in the wanted or scripting forums.

I think most "normal" texture changers work by object name (or linknumber?). For mesh you need a face number since everything is one object. It wouldn't take a whole lot to change the texture changers, as long as they are modifiable.

If you use one UV for everything that means you only have one material. The normal texture changers should work with this. Downside is you'll need more and bigger textures, so I wouldn't advice doing that. More and bigger textures = more lag.

Link to comment
Share on other sites

A texture change script can be written any way you like.  When you apply a texture to an object, you have to specify which face it is to be applied to, so if you have two materials -- and two UV maps -- you would simply write your texture change script to apply one set of textures with one map and the other set with the other map, applying them to the appropriate face in each case.  You could combine your two UV maps into a single one, but then you'd have to apply pairs of textures at the same time instead of giving your customer the freedom to mix and match.

  • Like 1
Link to comment
Share on other sites


Sienia Trevellion wrote:

1.) Do regular texture change scripts work in mesh?

Yes.

 


Sienia Trevellion wrote:

2.) I have defined the two different areas on the shirt with materials in blender and assigned the fabrics for each. Would I save my textures for each material area as a separate uv texture, or would I save them together on the same uv texure.

You can do it either way.  It all depends on how you want to set it up.  If the UV layout is such that both parts of the shirt can easily fit on one canvas, then you can put both sections on a single texture, and just apply the same texture to both materials.  If you'd rather give each section its own full canvas, then you'd need separate textures.

 

 


Sienia Trevellion wrote:

Saving them alone would mean I'd create 10 different textures (5 for each area). Saving them together would mean I'd create 25 different textures.

You wouldn't necessarily need 25.  The two sections each have their own material, right?  If they're both on the same UV map, then all you need is 5 textures, since each section is only using a part of each texture.  If we label the textures A through E, then here are your 25 combinations:

Fabric 1
       
Fabric 2

Texture A      Texture A

Texture A      Texture B

Texture A      Texture C

Texture A      Texture D

Texture A      Texture E

Texture B      Texture A

Texture B      Texture B

Texture B      Texture C

Texture B      Texture D

Texture B      Texture E

Texture C      Texture A

Texture C      Texture B

Texture C      Texture C

Texture C      Texture D

Texture C      Texture E

Texture D      Texture A

Texture D      Texture B

Texture D      Texture C

Texture D      Texture D

Texture D      Texture E

Texture E       Texture A

Texture E       Texture B

Texture E       Texture C

Texture E       Texture D

Texture E       Texture E

If you use two separate UV maps, then you'd need 10 textures.

There's no universally applicable right or wrong in which way to go.  As always, it all depends on what's going to yield the best looking results with the least amount of overhead.

  • Like 1
Link to comment
Share on other sites


Rolig Loon wrote:

You could combine your two UV maps into a single one, but then you'd have to apply pairs of textures at the same time instead of giving your customer the freedom to mix and match.

They WOULD have freedom to mix and match, since each "fabric" has its own material.  Only half of each "pair" would be shown on each individual "fabric", so as I said above, 5 textures yields 25 combinations.

  • Like 1
Link to comment
Share on other sites


Chosen Few wrote:


Rolig Loon wrote:

You could combine your two UV maps into a single one, but then you'd have to apply pairs of textures at the same time instead of giving your customer the freedom to mix and match.

They WOULD have freedom to mix and match, since each "fabric" has its own material.  Only half of each "pair" would be shown on each individual "fabric", so as I said above, 5 textures yields 25 combinations.

Yup, you're right.  My Monday afternoon brain wasn't up to speed. 

Link to comment
Share on other sites

Heya Siena,

in addition to what Chosen already said.

Since you said you have your 2 materials made, and thus 2 'faces' you can apply a texture to:

 

In general all mesh-textures can be changed with a llSetTexture

llSetTexture(texture, ALL_SIDES);

instead of All_Sides you put in the number of the face on your mesh you want to apply a new texture to.

If you are not sure which part has what face-number. 
Rightclick > Edit your mesh, then in the editor window activate > Select Face
then simply select one of the faces and do the following keystroke:
Ctrl+Alt+Shift ⇧+T
This will bring up a little pop-up window telling exactly which face you have selected, the Number of the face (to use for the script) and the opacity.

Cheers! Code

  • Like 1
Link to comment
Share on other sites

Hopefully to make it as clear as possible, here is what Chosen is suggesting (I think).

First, the meash on the left with the two materials; then the UV map*.

vmat2.png

Now the textures. This can be either all five together, as shown here, or five separate textures 1/5 the size.

vmat.png

If you use the one texture, it's more to upload for each new viewer, but it will give very fast changes. You change the textures of each material(=SL face) independently by using 5 horizontal repeats and setting the correct horizontal offset (or whatever for the appropriate layout). If the texture is to be changed rarely, use five separate textures and change by changing the texture. One or two of the small textures will have to be loaded by new viewers.

*Note that UV maps and textures are completely separate things. The UV map is part of the mesh data. The texture is not, even though you can upload it with the mesh if you like. In SL, you can only have one UV map. It is just a list of the positions of each triangle's vertices in the 2D texture space. It is independent of the assignment of materials (face textures in SL) to those triangles. The UV map display, with or without a texture, is just a convenient way of showing and editing it. 

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4194 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...