Commits

VirLinden committed 19585c2

sh-1491 WIP

  • Participants
  • Parent commits 91c8d39

Comments (0)

Files changed (2)

File 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

File indra/newview/llmeshrepository.cpp

 
 const U32 MAX_TEXTURE_UPLOAD_RETRIES = 5;
 
+void dumpLLSDToFile(LLSD& content, std::string filename);
+
 std::string header_lod[] = 
 {
 	"lowest_lod",
 							  const LLChannelDescriptors& channels,
 							  const LLIOPipe::buffer_ptr_t& buffer)
 	{
-		assert_main_thread();
+		//assert_main_thread();
 		llinfos << "completed" << llendl;
 		mThread->mPendingUploads--;
+
+		LLSD content;
+		LLBufferStream istr(channels, buffer.get());
+		if (!LLSDSerialize::fromXML(content, istr))
+		{
+			llinfos << "Failed to deserialize LLSD. " << " [" << status << "]: " << reason << llendl;
+		}
+		dumpLLSDToFile(content,"whole_model_response.xml");
 	}
-	
 };
 
 LLMeshRepoThread::LLMeshRepoThread()
 	}
 }
 
-#if 0
-void dumpLLSDToFile(LLSD& content, std::string& filename)
+#if 1
+void dumpLLSDToFile(LLSD& content, std::string filename)
 {
 	std::ofstream of(filename);
 	LLSDSerialize::toPrettyXML(content,of);
 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(mWholeModelUploadCapability, headers, model_data,
 					   new LLWholeModelFeeResponder(this));
 
+	do
+	{
+		mCurlRequest->process();
+	} while (mCurlRequest->getQueued() > 0);
+
 	// Currently a no-op.
 	mFinished = true;
 }