Jump to content

"Mesh Texture Changer" on one multitexture mesh object


Justyn Blackburn
 Share

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

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

Recommended Posts

Hi everybody,

I´m stuck in making a texture changer script for a mesh object that is one object with several materials.

That means in sl I can texture each part of the model, but the mesh just have one content I can put a script into it.

I also cannot edit linked objects I can just texture each part, caz the mesh is merged and I removed doubles in blender to reduce vertices.

I tried to find the object keys with an object group key finder script, but it says this object doesn't have any object groups.

So can anybody help me find a way to make one texture changer script for changing each material of the mesh model?

Here is the picture that shows the colored materials, that can be textured manually yet.

original.jpg

Link to comment
Share on other sites

The easiest way is to put a script in each material ("linked" object) of the mesh but i cannot go into the content of each material (texturable part of the mesh model) there is just one content to put a script into the entire Mesh model.

I dont know how the other texturable parts of the mesh model are named or what object keys they hide.

 

Link to comment
Share on other sites

Like Innula said, you'll have to use another script, or at least another command.

There are no links in your object, since it's a single object with "one content"  and one UUID. So trying to texture any links or using multiple scripts will never work.

However, each face/material has its own number, much like each link in a linkset has its own number. The llSetTexture will allow you to specify the correct face.

So instead of using llSetTexture(<texture name>,ALL_SIDES) which I suspect your "one script per linked object solution" uses, use llSetTexture(<texture>,0) and llSetTexture(<texture>,1) for the next face and llSetTexture(<texture>,2) for the next etc. All in a single script. (the <texture>'s you should replace with the textures corresponding with each face.

  • Like 1
Link to comment
Share on other sites

As far as texturing is concerned, each mesh is a single object with up to 8 faces (one per material -- they don't necessary have to be contiguous). 

To find out which face is which, it's probably easiest to drop this simple script into the object and touch each material in turn:

default{	state_entry()	{		//llSay(0, "Hello, Avatar!");	}	touch_start(integer total_number)	{		llOwnerSay("You touched face number "+(string)llDetectedTouchFace(0));	}}

 and it should tell you which face is which.  

What you do next really depends on how you want the item to change -- whether you want to be able to change the faces separately (decide what his jacket should be like and then decide what his shirt should be like) or whether you want to switch betwen several pre-set looks.   

You might want to see if you can find a scripter who understands strided lists to help you, or, if you want to try to write it yourself, we're happy to help over in the scripting forum.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
You are about to reply to a thread that has been inactive for 4246 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...