Commits

Anonymous committed e10fd55 Merge

automated merge mesh-development -> mesh-development

  • Participants
  • Parent commits 2680e28, 26779b3

Comments (0)

Files changed (10)

 bb1075286b3b147b1dae2e3d6b2d56f04ff03f35 DRTVWR-52_2.6.6-beta1
 bb1075286b3b147b1dae2e3d6b2d56f04ff03f35 2.6.6-beta1
 5e349dbe9cc84ea5795af8aeb6d473a0af9d4953 2.6.8-start
+11d5d8080e67c3955914caf98f2eb116af30e55a 2.6.9-start
+11d5d8080e67c3955914caf98f2eb116af30e55a 2.6.9-start
+e67da2c6e3125966dd49eef98b36317afac1fcfe 2.6.9-start

indra/llprimitive/llmodel.cpp

 		scale.splat(1.f);
 		scale.div(size);
 
+		LLVector4a inv_scale(1.f);
+		inv_scale.div(scale);
+
 		for (U32 i = 0; i < mVolumeFaces.size(); ++i)
 		{
 			LLVolumeFace& face = mVolumeFaces[i];
 			// For all the positions, we scale
 			// the positions to fit within the unit cube.
 			LLVector4a* pos = (LLVector4a*) face.mPositions;
+			LLVector4a* norm = (LLVector4a*) face.mNormals;
+
 			for (U32 j = 0; j < face.mNumVertices; ++j)
 			{
 			 	pos[j].add(trans);
 				pos[j].mul(scale);
+				norm[j].mul(inv_scale);
+				norm[j].normalize3();
 			}
 		}
 

indra/newview/app_settings/settings.xml

       <key>Value</key>
       <string>http://search.secondlife.com/viewer/[CATEGORY]/?q=[QUERY]&amp;p=[AUTH_TOKEN]&amp;r=[MATURITY]&amp;lang=[LANGUAGE]&amp;g=[GODLIKE]&amp;sid=[SESSION_ID]&amp;rid=[REGION_ID]&amp;pid=[PARCEL_ID]&amp;channel=[CHANNEL]&amp;version=[VERSION]&amp;major=[VERSION_MAJOR]&amp;minor=[VERSION_MINOR]&amp;patch=[VERSION_PATCH]&amp;build=[VERSION_BUILD]</string>
     </map>
-    <key>SearchURLBeta</key>
-    <map>
-      <key>Comment</key>
-      <string>URL for Search website, displayed in the Find floater</string>
-      <key>Persist</key>
-      <integer>0</integer>
-      <key>Type</key>
-      <string>String</string>
-      <key>Value</key>
-      <string>http://beta.search.secondlife.com/viewer/[CATEGORY]/?q=[QUERY]&amp;p=[AUTH_TOKEN]&amp;r=[MATURITY]&amp;lang=[LANGUAGE]&amp;g=[GODLIKE]&amp;sid=[SESSION_ID]&amp;rid=[REGION_ID]&amp;pid=[PARCEL_ID]&amp;channel=[CHANNEL]&amp;version=[VERSION]&amp;major=[VERSION_MAJOR]&amp;minor=[VERSION_MINOR]&amp;patch=[VERSION_PATCH]&amp;build=[VERSION_BUILD]</string>
-    </map>
     <key>WebProfileURL</key>
     <map>
       <key>Comment</key>

indra/newview/llagentcamera.cpp

 	LLQuaternion inv_obj_rot = ~obj_rot; // get inverse of rotation
 	LLVector3 object_extents;	
 	const LLVector4a* oe4 = object->mDrawable->getSpatialExtents();
-	object_extents.set( oe4[1][0], oe4[1][1], oe4[1][2] );
+	LLVector4a size;
+	size.setSub(oe4[1], oe4[0]);
+	object_extents.set( size[0], size[1], size[2] );
 	
 	// make sure they object extents are non-zero
 	object_extents.clamp(0.001f, F32_MAX);

indra/newview/llfirstuse.cpp

 // static
 void LLFirstUse::viewPopup(bool enable)
 {
-	firstUseNotification("FirstViewPopup", enable, "HintView", LLSD(), LLSD().with("target", "view_popup").with("direction", "right"));
+//	firstUseNotification("FirstViewPopup", enable, "HintView", LLSD(), LLSD().with("target", "view_popup").with("direction", "right"));
 }
 
 // static

indra/newview/llfloatermodelpreview.cpp

 #include "llvfile.h"
 #include "llvfs.h"
 #include "llcallbacklist.h"
-
+#include "llviewerobjectlist.h"
+#include "llanimationstates.h"
 #include "glod/glod.h"
 
 //static
 {
 	sInstance = NULL;
 	
-	if ( mModelPreview && mModelPreview->getResetJointFlag() )
-	{		
-		gAgentAvatarp->resetJointPositions();
-	}
-
-	
 	if ( mModelPreview )
 	{
 		delete mModelPreview;
 									{
 										//llinfos<<"joint "<<lookingForJoint.c_str()<<llendl;
 										LLMatrix4 jointTransform = mJointList[lookingForJoint];
-										LLJoint* pJoint = gAgentAvatarp->getJoint( lookingForJoint );
+										LLJoint* pJoint = mPreview->getPreviewAvatar()->getJoint( lookingForJoint );
 										if ( pJoint )
 										{   
 											pJoint->storeCurrentXform( jointTransform.getTranslation() );												
 	mMasterLegacyJointList.push_front("mHipLeft");
 	mMasterLegacyJointList.push_front("mKneeLeft");
 	mMasterLegacyJointList.push_front("mFootLeft");
+
+	createPreviewAvatar();
 }
 
 LLModelPreview::~LLModelPreview()
 	
 	if ( mFMP && mFMP->childGetValue("upload_joints").asBoolean() )
 	{
-		gAgentAvatarp->setPelvisOffset( mPelvisZOffset );
+		getPreviewAvatar()->setPelvisOffset( mPelvisZOffset );
 	}
 
 	F32 streaming_cost = 0.f;
 		}
 	}
 
+
+	//make sure no hulls have more than 256 points in them
+	for (U32 i = 0; upload_ok && i < mModel[LLModel::LOD_PHYSICS].size(); ++i)
+	{
+		LLModel* mdl = mModel[LLModel::LOD_PHYSICS][i];
+
+		for (U32 j = 0; upload_ok && j < mdl->mPhysics.mHull.size(); ++j)
+		{
+			upload_ok = upload_ok && mdl->mPhysics.mHull[i].size() <= 256;
+		}
+	}
+
 	bool errorStateFromLoader = getLoadState() >= LLModelLoader::ERROR_PARSING ? true : false;
 
 	bool skinAndRigOk = true;
 	{
 		mFMP->childEnable("ok_btn");
 	}
+	else
+	{
+		mFMP->childDisable("ok_btn");
+	}
 	
 	//add up physics triangles etc
 	S32 start = 0;
 
 }
 //-----------------------------------------------------------------------------
-// changeAvatarsJointPositions()
-//-----------------------------------------------------------------------------
-void LLModelPreview::changeAvatarsJointPositions( LLModel* pModel )
-{
-	if ( mMasterJointList.empty() )
-	{
-		return;
-	}
-
-	std::vector<std::string> :: const_iterator jointListItBegin = pModel->mSkinInfo.mJointNames.begin();
-	std::vector<std::string> :: const_iterator jointListItEnd = pModel->mSkinInfo.mJointNames.end();
-
-	S32 index = 0;
-	for ( ; jointListItBegin!=jointListItEnd; ++jointListItBegin, ++index )
-	{	
-		std::string elem = *jointListItBegin;
-		//llinfos<<"joint "<<elem<<llendl;
-
-		S32 matrixCnt = pModel->mSkinInfo.mAlternateBindMatrix.size();
-		if ( matrixCnt < 1 )
-		{
-			llinfos<<"Total WTF moment :"<<matrixCnt<<llendl;
-		}
-		else
-		{
-			LLMatrix4 jointTransform = pModel->mSkinInfo.mAlternateBindMatrix[index];
-
-			LLJoint* pJoint = gAgentAvatarp->getJoint( elem );
-			if ( pJoint )
-			{   
-				pJoint->storeCurrentXform( jointTransform.getTranslation() );												
-			}	
-		}
-	}
-}
-//-----------------------------------------------------------------------------
 // getTranslationForJointOffset()
 //-----------------------------------------------------------------------------
 LLVector3 LLModelPreview::getTranslationForJointOffset( std::string joint )
 	return LLVector3(0.0f,0.0f,0.0f);								
 }
 //-----------------------------------------------------------------------------
+// createPreviewAvatar
+//-----------------------------------------------------------------------------
+void LLModelPreview::createPreviewAvatar( void )
+{
+	mPreviewAvatar = (LLVOAvatar*)gObjectList.createObjectViewer( LL_PCODE_LEGACY_AVATAR, gAgent.getRegion() );
+	if ( mPreviewAvatar )
+	{
+		mPreviewAvatar->createDrawable( &gPipeline );
+		mPreviewAvatar->mIsDummy = TRUE;
+		mPreviewAvatar->mSpecialRenderMode = 1;
+		mPreviewAvatar->setPositionAgent( LLVector3::zero );
+		mPreviewAvatar->slamPosition();
+		mPreviewAvatar->updateJointLODs();
+		mPreviewAvatar->updateGeometry( mPreviewAvatar->mDrawable );
+		mPreviewAvatar->startMotion( ANIM_AGENT_STAND );
+		mPreviewAvatar->hideSkirt();
+	}
+	else
+	{
+		llinfos<<"Failed to create preview avatar for upload model window"<<llendl;
+	}
+}
+
+//-----------------------------------------------------------------------------
 // render()
 //-----------------------------------------------------------------------------
 BOOL LLModelPreview::render()
 	
 	mFMP->childSetEnabled("upload_joints", upload_skin);
 
-	//poke at avatar when we upload custom joints
-	/*	
-	if ( upload_joints )
-	{
-		for (LLModelLoader::scene::iterator iter = mScene[mPreviewLOD].begin(); iter != mScene[mPreviewLOD].end(); ++iter)
-		{
-			for (LLModelLoader::model_instance_list::iterator model_iter = iter->second.begin(); model_iter != iter->second.end(); ++model_iter)
-			{
-				LLModelInstance& instance = *model_iter;
-				LLModel* model = instance.mModel;
-				if ( !model->mSkinWeights.empty() )
-				{
-					changeAvatarsJointPositions( model );
-				}
-			}
-		}
-	}
-	*/
-	
 	F32 explode = mFMP->childGetValue("physics_explode").asReal();
 
 	glClear(GL_DEPTH_BUFFER_BIT);
 
 	if (skin_weight)
 	{
-		target_pos = gAgentAvatarp->getPositionAgent();
+		target_pos = getPreviewAvatar()->getPositionAgent();
 		z_near = 0.01f;
 		z_far = 1024.f;
 		mCameraDistance = 16.f;
 		}
 		else
 		{
-			LLVOAvatarSelf* avatar = gAgentAvatarp;
-			target_pos = avatar->getPositionAgent();
+			target_pos = getPreviewAvatar()->getPositionAgent();
 
 			LLViewerCamera::getInstance()->setOriginAndLookAt(
 															  target_pos + ((LLVector3(mCameraDistance, 0.f, 0.f) + offset) * av_rot),		// camera
 
 			if (joint_positions)
 			{
-				avatar->renderCollisionVolumes();
+				getPreviewAvatar()->renderCollisionVolumes();
 			}
 
 			for (LLModelLoader::scene::iterator iter = mScene[mPreviewLOD].begin(); iter != mScene[mPreviewLOD].end(); ++iter)
 							LLMatrix4 mat[64];
 							for (U32 j = 0; j < model->mSkinInfo.mJointNames.size(); ++j)
 							{
-								LLJoint* joint = avatar->getJoint(model->mSkinInfo.mJointNames[j]);
+								LLJoint* joint = getPreviewAvatar()->getJoint(model->mSkinInfo.mJointNames[j]);
 								if (joint)
 								{
 									mat[j] = model->mSkinInfo.mInvBindMatrix[j];

indra/newview/llfloatermodelpreview.h

 	
 	LLVector3 getTranslationForJointOffset( std::string joint );
 
+	void		createPreviewAvatar( void );
+	LLVOAvatar* getPreviewAvatar( void ) { return mPreviewAvatar; }
+
  protected:
 	friend class LLModelLoader;
 	friend class LLFloaterModelPreview;
 	std::deque<std::string> mMasterLegacyJointList;
 	std::deque<std::string> mJointsFromNode;
 	JointTransformMap		mJointTransformMap;
+	LLPointer<LLVOAvatar>	mPreviewAvatar;
 };
 
 #endif  // LL_LLFLOATERMODELPREVIEW_H

indra/newview/llfloatersearch.cpp

 #include "llui.h"
 #include "llviewercontrol.h"
 #include "llweb.h"
-#include "llversioninfo.h"
 
 // support secondlife:///app/search/{CATEGORY}/{QUERY} SLapps
 class LLSearchHandler : public LLCommandHandler
 
 	// get the search URL and expand all of the substitutions
 	// (also adds things like [LANGUAGE], [VERSION], [OS], etc.)
-	std::string url;
-	if (LLVersionInfo::getChannel().find("Beta") != std::string::npos)
-	{
-		url = gSavedSettings.getString("SearchURLBeta");
-	}
-	else
-	{
-		url = gSavedSettings.getString("SearchURL");
-	}
+	std::string url = gSavedSettings.getString("SearchURL");
 	url = LLWeb::expandURLSubstitutions(url, subs);
 
 	// and load the URL in the web view

indra/newview/llmeshrepository.cpp

 
 const U32 MAX_TEXTURE_UPLOAD_RETRIES = 5;
 
+void dumpLLSDToFile(const LLSD& content, std::string filename);
+
 std::string header_lod[] = 
 {
 	"lowest_lod",
 		mThread(thread)
 	{
 	}
-	virtual void completedRaw(U32 status, const std::string& reason,
-							  const LLChannelDescriptors& channels,
-							  const LLIOPipe::buffer_ptr_t& buffer)
+	virtual void completed(U32 status,
+						   const std::string& reason,
+						   const LLSD& content)
 	{
-		assert_main_thread();
+		//assert_main_thread();
 		llinfos << "completed" << llendl;
 		mThread->mPendingUploads--;
+		dumpLLSDToFile(content,"whole_model_response.xml");
+
+		mThread->mWholeModelUploadURL = content["uploader"].asString(); 
 	}
-	
+};
+
+class LLWholeModelUploadResponder: public LLCurl::Responder
+{
+	LLMeshUploadThread* mThread;
+public:
+	LLWholeModelUploadResponder(LLMeshUploadThread* thread):
+		mThread(thread)
+	{
+	}
+	virtual void completed(U32 status,
+						   const std::string& reason,
+						   const LLSD& content)
+	{
+		//assert_main_thread();
+		llinfos << "upload completed" << llendl;
+		mThread->mPendingUploads--;
+		dumpLLSDToFile(content,"whole_model_upload_response.xml");
+	}
 };
 
 LLMeshRepoThread::LLMeshRepoThread()
 	
 	mUploadObjectAssetCapability = gAgent.getRegion()->getCapability("UploadObjectAsset");
 	mNewInventoryCapability = gAgent.getRegion()->getCapability("NewFileAgentInventoryVariablePrice");
-	mWholeModelUploadCapability = gAgent.getRegion()->getCapability("NewFileAgentInventory");
+	mWholeModelFeeCapability = gAgent.getRegion()->getCapability("NewFileAgentInventory");
 
 	mOrigin += gAgent.getAtAxis() * scale.magVec();
 }
 	}
 }
 
-#if 0
-void dumpLLSDToFile(LLSD& content, std::string& filename)
+#if 1
+void dumpLLSDToFile(const LLSD& content, std::string filename)
 {
-	std::ofstream of(filename);
+	std::ofstream of(filename.c_str());
 	LLSDSerialize::toPrettyXML(content,of);
 }
 #endif
 void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
 {
 	// TODO where do textures go?
-	
+
 	LLSD result;
 
+	LLSD res;
 	result["folder_id"] = gInventory.findCategoryUUIDForType(LLFolderType::FT_OBJECT);
 	result["asset_type"] = "mesh";
 	result["inventory_type"] = "object";
 
 	// TODO "optional" fields from the spec
 	
-	LLSD res;
 	res["mesh_list"] = LLSD::emptyArray();
-	res["texture_list"] = LLSD::emptyArray();
+// TODO Textures
+	//res["texture_list"] = LLSD::emptyArray();
 	S32 mesh_num = 0;
 	S32 texture_num = 0;
 	
 		LLQuaternion rot;
 		LLMatrix4 transformation = instance.mTransform;
 		decomposeMeshMatrix(transformation,pos,rot,scale);
-		
+
+#if 0
 		mesh_entry["childpos"] = ll_sd_from_vector3(pos);
 		mesh_entry["childrot"] = ll_sd_from_quaternion(rot);
 		mesh_entry["scale"] = ll_sd_from_vector3(scale);
+#endif
+		mesh_entry["position"] = ll_sd_from_vector3(LLVector3());
+		mesh_entry["rotation"] = ll_sd_from_quaternion(rot);
+		mesh_entry["scale"] = ll_sd_from_vector3(scale);
 
 		// TODO should be binary.
 		std::string str = ostr.str();
 	}
 
 	result["asset_resources"] = res;
-#if 0	
-	std::string name("whole_model.xml");
-	dumpLLSDToFile(result,name);
+#if 1	
+	dumpLLSDToFile(result,"whole_model.xml");
 #endif
 
 	dest = result;
 
 	mPendingUploads++;
 	LLCurlRequest::headers_t headers;
-	mCurlRequest->post(mWholeModelUploadCapability, headers, model_data.asString(),
+	mCurlRequest->post(mWholeModelFeeCapability, headers, model_data,
 					   new LLWholeModelFeeResponder(this));
 
+	do
+	{
+		mCurlRequest->process();
+	} while (mCurlRequest->getQueued() > 0);
+
+	mCurlRequest->post(mWholeModelUploadURL, headers, model_data["asset_resources"], new LLWholeModelUploadResponder(this));
+	
+	do
+	{
+		mCurlRequest->process();
+	} while (mCurlRequest->getQueued() > 0);
+
+	delete mCurlRequest;
+	mCurlRequest = NULL;
+
 	// Currently a no-op.
 	mFinished = true;
 }

indra/newview/llmeshrepository.h

 	LLHost			mHost;
 	std::string		mUploadObjectAssetCapability;
 	std::string		mNewInventoryCapability;
-	std::string		mWholeModelUploadCapability;
+	std::string		mWholeModelFeeCapability;
+	std::string		mWholeModelUploadURL;
 
 	std::queue<LLMeshUploadData> mUploadQ;
 	std::queue<LLMeshUploadData> mConfirmedQ;