Texture Buttons

1. Load images into the HUD

Drop all the textures you want to use into the HUD contents

  • Edit the HUD, and go to Contents tab
  • Drag and drop all textures you want to use from inventory to HUD. All textures must be full perm; otherwise, the script won’t work

The HUD should say something similar to this:

[07:09] Poncho Hud: AH Texture Master 3.9.7 refreshed inventory; 31 textures loaded. 50.965130% memory available

If any of the textures are not full perm, the HUD will say something like this:

[07:48] Poncho Hud: Texture “ExclusiveRFLBunnys” is not full perm. Ignoring

2. Create HUD Buttons

  1. Copy some of the texture buttons in the Components object onto your HUD. There are three kinds available: square, round, and text. Use whichever you like. You can also create your own. The name of the buttons must be “texture basic”
  2. Replace the prim description with the name of the face group that the button should texture, or the special name CURRENT (all caps, described below, under Technical Notes).
  3. Once you have a texture button named with each face group, use shift-drag to duplicate as many buttons as you have textures, and arrange them how you want
  4. Lastly, link all texture buttons to your HUD

3. Associate a texture with each button

  1. Drag and drop a texture that each button should apply onto the front face of the button. The button will now apply this texture to your clothing prims. Repeat for each button, until all buttons are showing the texture they will apply.
  2. Rez or wear your clothing item, and place it behind the hud so that you can watch it during the next step
  3. Close the edit window, and click each button. Each button will say something like this each time you click it:

    [16:59] Template Color/Texture HUD: Texture not found: “”; Using button texture “safetypin-horse” instead. Prim description updated

    This means the button has saved this texture; you will now see the name of the texture in the button’s prim description if you edit it. If, instead, you see a message like this:

    [17:13] Template Color/Texture HUD: Texture not found: “”

    This means you forgot to drop that texture into the HUD contents in section 1. Edit the HUD, and drop the missing textures into it’s contents, then close the edit window and click the button again. (Note: You should also see the correct faces of the clothing item being retextured; if the clothing is not updating, check out XXXXXXX Troubleshooting XXXXXXXXX)

  4. Make sure you click every button a few times, until none of them are chatting at you. Important: If you do not do this step, the texture button will not work after it is sold
  5. The buttons now know which textures they will apply. If you like, you may now put a different texture on the buttons. Each button will continue to apply the texture that it saved to it’s prim description

4. Remove the textures from inventory

You may have noticed that the hud is chatting this message at you every time you rez it:

[16:59] Template Color/Texture HUD: chat /74finalize when you are done setting up all texture buttons, and before selling the hud, to protect your textures

Once your hud is complete and about ready to box up, we will do this. First, make sure you have a final copy of the hud, before finalization. Then rez the final copy of the hud, and type

/74finalize

The HUD will say something like this:

[17:22] Template Color/Texture HUD: Cleaning textures from inventory

You may see this error message:

[17:32] Template Color/Texture HUD: Please remove the no-copy texture “ExclusiveRFLBunnys” from my contents

If so, move that texture back into your inventory where it belongs; the HUD is trying to avoid deleting your only copy of a texture if you accidentally dropped in something that’s no copy. The HUD cannot use textures that aren’t full perm anyway (as mentioned in section 1 above)

If you edit the HUD, you will now see that all textures are gone. The hud has moved them out of inventory and into it’s hidden memory contents, where your customers can’t get to them and use them in ways you don’t want

If you forget to do this before selling the HUD, the HUD will try to cover for you and silently delete all textures as soon as it’s rezzed the first time by someone other than you (XXXX CHECK THAT THIS ACTUALLY HAPPENS XXXXX). However, If the customer is clever and rezzes the HUD in a no-script zone, the script will be prevented from running the cleanup code, and your customers will have full access to the texture files. So, it’s best to always run this before boxing up the HUD

Troubleshooting

Are your texture buttons not causing the faces on your clothing item to change texture? Here’s a troubleshooting checklist

XXXXXX improve the troubleshooting XXXXXXXX

Security Errors

Pick up and re-rez both the HUD and the clothing item. Do any of them chat “Security check failed”? If so, fix the other errors mentioned in chat. More details on the security error messages can be found in the script installation article

check that the face name in the texture button description matches the face name in the clothing description

ERROR: No face names have yet been defined for any prim in this linkset. Here are the instructions for setting them up.

check that the passphrases in the texture master script and color slave script match

ERROR: I recieved an encrypted message, but my passphrase is not set. Please set my passphrase to the same one used in the AH Texture Master script. See the manual for more information

check that the channels in the texture master script and color slave scripts match

Technical Notes

The format of the text button description is:

<face name>,<texture name>,<face name>,<texture name>,...

The script uses the texture’s name, rather than the more common UUID, because:

  1. Name does not need to be kept secret, so is suitable to show in the prim description without worrying about customer’s abusing it
  2. Name is more readable; you can read the description and know what texture it is, whereas uuid is just a random set of numbers

Every time a texture button is clicked, the following happens (in the function “fixAndSendConfig”, in AH Texture Master, line 145:

  1. The script reads the prim description
  2. The script checks that all the named textures are in the texture registry
  3. If any are missing, and the texture on the face of the button is known, the unknown textures are replaced with the name of the button texture, and the prim description is updated with the changes
  4. All texture names are replaced with uuid’s from the texture registry
  5. The special face name “CURRENT” is replaced with the face names in the currently active color button
  6. The list of face names and uuid’s is sent, encrypted, to the Color Slave script in the clothing, where it is applied

So, that means, you can put multiple textures in one texture button, such as a matching upper/lower body texture, although you may need to copy/paste the texture names, rather than using the convenient drag and drop. But for the common case of one texture, one button, drag and drop makes configuration easy

Texture Registry

The texture registry is a list of texture names and uuid’s that the AH Texture Master script knows about. The texture registry can be either editable or finalized

The texture registry starts out editable. In this mode, the texture registry keeps a copy of the full-perm texture names and UUID’s you add to the HUD’s inventory. During this time, you can add and remove textures from inventory, and the texture registry will keep a copy. Every time the registry is updated, it says something like this:

[07:09] Poncho Hud: AH Texture Master 3.9.7 refreshed inventory; 31 textures loaded. 50.965130% memory available

The other state is finalized. This means the texture registry is no longer editable; and there are no longer any textures in inventory. The registry is stored only in the script. When it is finalized, the registry is perfectly safe from snooping; nobody can look at any prims or any script to see the contents of the texture registry

Once the registry is finalized, it cannot be modified, even by the creator. The only option is to purge it and start over, by typing

/74 reset

This is why it’s recommended to only finalize it when you are about to sell your product

The registry can be finalized in one of two ways:

  1. The owner, who has modify permissions on the AH Texture Master HUD, types /74finalize
  2. A new owner rezzes the hud while no security errors are active, IE, when it is sold

If you have an alt or business partner and want to transfer the HUD without the inventory being wiped, you should set the hud to transferrable, or set the AH Texture Master script to modifiable (or both), to trigger a security error. Then, you can transfer the hud to your business partner, let them set the permissions properly, and they will have the hud in a texture-editable state

 

Leave a Reply