diff --git a/autobuild.xml b/autobuild.xml
index a536294dfde01c8d4587fbff28a07a1e12387f78..ab39f8103f78f54de19b3dd07eabfbda58456115 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -1254,9 +1254,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>85536d2727faea140175a903db48b5d7</string>
+              <string>c3a9b30d49918d20d51d2aa8f444b9ef</string>
               <key>url</key>
-              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llappearanceutility-source/rev/265330/arch/Linux/installer/llappearanceutility_source-0.1-linux-20120930.tar.bz2</string>
+              <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llappearanceutility-source/rev/265409/arch/Linux/installer/llappearanceutility_source-0.1-linux-20121002.tar.bz2</string>
             </map>
             <key>name</key>
             <string>linux</string>
diff --git a/indra/llappearance/llavatarappearancedefines.cpp b/indra/llappearance/llavatarappearancedefines.cpp
index 0416309fc765fc3c57314e3309a38a3a78e6e6bf..f1c78946a11e95db72686ab1add4ccd04a788cd4 100644
--- a/indra/llappearance/llavatarappearancedefines.cpp
+++ b/indra/llappearance/llavatarappearancedefines.cpp
@@ -220,7 +220,7 @@ ETextureIndex LLAvatarAppearanceDictionary::bakedToLocalTextureIndex(EBakedTextu
 	return LLAvatarAppearanceDictionary::getInstance()->getBakedTexture(index)->mTextureIndex;
 }
 
-//static 
+// static
 EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByRegionName(std::string name)
 {
 	U8 index = 0;
@@ -238,6 +238,28 @@ EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByRegionName(std::stri
 	return BAKED_NUM_INDICES;
 }
 
+// static 
+EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByImageName(std::string name)
+{
+	U8 index = 0;
+	while (index < BAKED_NUM_INDICES)
+	{
+		const BakedEntry *be = LLAvatarAppearanceDictionary::getInstance()->getBakedTexture((EBakedTextureIndex) index);
+		if (be)
+		{
+			const TextureEntry *te = LLAvatarAppearanceDictionary::getInstance()->getTexture(be->mTextureIndex);
+			if (te && te->mDefaultImageName.compare(name) == 0)
+			{
+				// baked texture found
+				return (EBakedTextureIndex) index;
+			}
+		}
+		index++;
+	}
+	// baked texture could not be found
+	return BAKED_NUM_INDICES;
+}
+
 // static
 LLWearableType::EType LLAvatarAppearanceDictionary::getTEWearableType(ETextureIndex index )
 {
diff --git a/indra/llappearance/llavatarappearancedefines.h b/indra/llappearance/llavatarappearancedefines.h
index 2e073bf5d27ebea0c1efaff39aedcea13dea550e..496f85c107524af444fa9b2c266fa805110ec5e7 100644
--- a/indra/llappearance/llavatarappearancedefines.h
+++ b/indra/llappearance/llavatarappearancedefines.h
@@ -217,6 +217,7 @@ class LLAvatarAppearanceDictionary : public LLSingleton<LLAvatarAppearanceDictio
 
 	// find a baked texture index based on its name
 	static EBakedTextureIndex 	findBakedByRegionName(std::string name);
+	static EBakedTextureIndex 	findBakedByImageName(std::string name);
 
 	// Given a texture entry, determine which wearable type owns it.
 	static LLWearableType::EType 		getTEWearableType(ETextureIndex index);
diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp
index 6f079b4abbfa70a7f0a7c31aba767716885e3b36..16f94c48ddd801a84a28150d6b89be2ee1ca97b9 100644
--- a/indra/llappearance/lltexlayer.cpp
+++ b/indra/llappearance/lltexlayer.cpp
@@ -516,6 +516,21 @@ const LLTexLayerSetBuffer* LLTexLayerSet::getComposite() const
 	return mComposite;
 }
 
+void LLTexLayerSet::gatherMorphMaskAlpha(U8 *data, S32 origin_x, S32 origin_y, S32 width, S32 height)
+{
+	memset(data, 255, width * height);
+
+	for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ )
+	{
+		LLTexLayerInterface* layer = *iter;
+		layer->gatherAlphaMasks(data, origin_x, origin_y, width, height);
+	}
+	
+	// Set alpha back to that of our alpha masks.
+	renderAlphaMaskTextures(origin_x, origin_y, width, height, true);
+}
+
+
 void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height, bool forceClear)
 {
 	const LLTexLayerSetInfo *info = getInfo();
diff --git a/indra/llappearance/lltexlayer.h b/indra/llappearance/lltexlayer.h
index f9f8bdd817c9a9b2a13db01d61669831db06837d..405d2c7df428cb2e49730c4cff568df7a1ea5d30 100644
--- a/indra/llappearance/lltexlayer.h
+++ b/indra/llappearance/lltexlayer.h
@@ -194,6 +194,7 @@ class LLTexLayerSet
 	const LLTexLayerSetBuffer* 	getComposite() const; // Do not create one if it doesn't exist.
 	virtual void				createComposite() = 0;
 	void						destroyComposite();
+	void						gatherMorphMaskAlpha(U8 *data, S32 origin_x, S32 origin_y, S32 width, S32 height);
 
 	const LLTexLayerSetInfo* 	getInfo() const 			{ return mInfo; }
 	BOOL						setInfo(const LLTexLayerSetInfo *info); // This sets mInfo and calls initialization functions
diff --git a/indra/newview/llviewertexlayer.cpp b/indra/newview/llviewertexlayer.cpp
index b129c28e0d94c39445c32ece3e6356845816cad4..cd5e781d7117febf7eaed1c87eff447a597ed0ae 100755
--- a/indra/newview/llviewertexlayer.cpp
+++ b/indra/newview/llviewertexlayer.cpp
@@ -379,7 +379,9 @@ void LLViewerTexLayerSetBuffer::doUpload()
 	LLGLSUIDefault gls_ui;
 	LLPointer<LLImageRaw> baked_mask_image = new LLImageRaw(mFullWidth, mFullHeight, 1 );
 	U8* baked_mask_data = baked_mask_image->getData(); 
-	layer_set->gatherMorphMaskAlpha(baked_mask_data, mFullWidth, mFullHeight);
+	layer_set->gatherMorphMaskAlpha(baked_mask_data,
+									mOrigin.mX, mOrigin.mY,
+									mFullWidth, mFullHeight);
 
 
 	// Create the baked image from our color and mask information
@@ -700,23 +702,6 @@ void LLViewerTexLayerSet::setUpdatesEnabled( BOOL b )
 	mUpdatesEnabled = b; 
 }
 
-
-void LLViewerTexLayerSet::gatherMorphMaskAlpha(U8 *data, S32 width, S32 height)
-{
-	memset(data, 255, width * height);
-
-	for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ )
-	{
-		LLTexLayerInterface* layer = *iter;
-		layer->gatherAlphaMasks(data, getViewerComposite()->getOriginX(),
-								getViewerComposite()->getOriginY(), width, height);
-	}
-	
-	// Set alpha back to that of our alpha masks.
-	renderAlphaMaskTextures(getViewerComposite()->getOriginX(), 
-							getViewerComposite()->getOriginY(), width, height, true);
-}
-
 LLVOAvatarSelf* LLViewerTexLayerSet::getAvatar()
 {
 	return dynamic_cast<LLVOAvatarSelf*> (mAvatarAppearance);
diff --git a/indra/newview/llviewertexlayer.h b/indra/newview/llviewertexlayer.h
index 9df9474eff1bef9735d08caabf82a1c48c45796c..959c883da86d9789427e18b89e6d3e5068545749 100644
--- a/indra/newview/llviewertexlayer.h
+++ b/indra/newview/llviewertexlayer.h
@@ -55,7 +55,6 @@ class LLViewerTexLayerSet : public LLTexLayerSet
 	/*virtual*/void				createComposite();
 	void						setUpdatesEnabled(BOOL b);
 	BOOL						getUpdatesEnabled()	const 	{ return mUpdatesEnabled; }
-	void						gatherMorphMaskAlpha(U8 *data, S32 width, S32 height);
 
 	LLVOAvatarSelf*				getAvatar();
 	const LLVOAvatarSelf*		getAvatar()	const;