parameters: (self)
docstring: Resets our avatar to the defaults
docstring_summary: Resets our avatar to the defaults
docstring_tokens: Resets our avatar to the defaults
function: def IResetAvatar(self):
          "Resets our avatar to the defaults"
          # reset our clothing
          PtDebugPrint("Resetting avatar...")
          avatar = PtGetLocalAvatar()
          # remove all accessories that aren't in our accessory list
          for item in WornList:
              if item.accessoryType >= 0:
                  found = 0
                  for acc in DefaultClothing:
                      if acc.name == item.name:
                          found = 1
                          break
                  if not found:
                      avatar.avatar.removeClothingItem(item.name)
          # add all the default clothing items back
          for i in range(len(DefaultClothing)):
              item = DefaultClothing[i]
              color1 = DefaultColor1[i]
              color2 = DefaultColor2[i]
              avatar.avatar.wearClothingItem(item.name,0)
              avatar.avatar.tintClothingItem(item.name,color1,0)
              avatar.avatar.tintClothingItemLayer(item.name,color2,2)
              # add the matching item, if it exists
              matchingItem = avatar.avatar.getMatchingClothingItem(item.name)
              if isinstance(matchingItem, list):
                  avatar.avatar.wearClothingItem(matchingItem[0],0)
                  avatar.avatar.tintClothingItem(matchingItem[0],color1,0)
                  avatar.avatar.tintClothingItemLayer(matchingItem[0],color2,2,0)
  
          # reset skin color
          avatar.avatar.tintSkin(DefaultSkinColor)
  
          # reset geometry morphs
          for morphID in range(len(DefaultGeomMorphs)):
              gender = avatar.avatar.getAvatarClothingGroup()
              if gender == kFemaleClothingGroup:
                  avatar.avatar.setMorph("FFace",morphID,DefaultGeomMorphs[morphID])
              else:
                  avatar.avatar.setMorph("MFace",morphID,DefaultGeomMorphs[morphID])
  
          # reset texture morphs
          for morphID in range(len(DefaultTexMorphs)):
              avatar.avatar.setSkinBlend(morphID,DefaultTexMorphs[morphID])
          avatar.avatar.setSkinBlend(4,DefaultAgeMorph)
  
          # give the avatar a bit of time to update before trying to update the controls
          PtAtTimeCallback(self.key, 1, kTimerUpdateControls)
function_tokens: def IResetAvatar ( self ) : # reset our clothing PtDebugPrint ( "Resetting avatar..." ) avatar = PtGetLocalAvatar ( ) # remove all accessories that aren't in our accessory list for item in WornList : if item . accessoryType >= 0 : found = 0 for acc in DefaultClothing : if acc . name == item . name : found = 1 break if not found : avatar . avatar . removeClothingItem ( item . name ) # add all the default clothing items back for i in range ( len ( DefaultClothing ) ) : item = DefaultClothing [ i ] color1 = DefaultColor1 [ i ] color2 = DefaultColor2 [ i ] avatar . avatar . wearClothingItem ( item . name , 0 ) avatar . avatar . tintClothingItem ( item . name , color1 , 0 ) avatar . avatar . tintClothingItemLayer ( item . name , color2 , 2 ) # add the matching item, if it exists matchingItem = avatar . avatar . getMatchingClothingItem ( item . name ) if isinstance ( matchingItem , list ) : avatar . avatar . wearClothingItem ( matchingItem [ 0 ] , 0 ) avatar . avatar . tintClothingItem ( matchingItem [ 0 ] , color1 , 0 ) avatar . avatar . tintClothingItemLayer ( matchingItem [ 0 ] , color2 , 2 , 0 ) # reset skin color avatar . avatar . tintSkin ( DefaultSkinColor ) # reset geometry morphs for morphID in range ( len ( DefaultGeomMorphs ) ) : gender = avatar . avatar . getAvatarClothingGroup ( ) if gender == kFemaleClothingGroup : avatar . avatar . setMorph ( "FFace" , morphID , DefaultGeomMorphs [ morphID ] ) else : avatar . avatar . setMorph ( "MFace" , morphID , DefaultGeomMorphs [ morphID ] ) # reset texture morphs for morphID in range ( len ( DefaultTexMorphs ) ) : avatar . avatar . setSkinBlend ( morphID , DefaultTexMorphs [ morphID ] ) avatar . avatar . setSkinBlend ( 4 , DefaultAgeMorph ) # give the avatar a bit of time to update before trying to update the controls PtAtTimeCallback ( self . key , 1 , kTimerUpdateControls )