예제 #1
0
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		const std::string filename = upload_pick((void*)LLFilePicker::FFLOAD_XML);
	
		if (filename.empty())
			return true;
	
		llifstream importer(filename);
		LLSD data;
		LLSDSerialize::fromXMLDocument(data, importer);
	
		if (gImportTracker.getState() != ImportTracker::IDLE)
		{
			gImportTracker.clear();
			gImportTracker.cleargroups();
		}
		LLSD data2=data;
		LLSD header=data2["Header"];
		if(header.isDefined())
		{
			if(header["Version"].asInteger() == 2)
			{
				//LLSD obj_llsd=data["Objects"];
				//gImportTracker.prepare(obj_llsd);
				gImportTracker.importer(filename, NULL);
			}
			else
				gImportTracker.import(data);
		}
		else
			gImportTracker.import(data);
		return true;
	}
예제 #2
0
void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp, 
										   void** user_data, 
										   U32 i, 
										   const EObjectUpdateType update_type, 
										   LLDataPacker* dpp, 
										   BOOL just_created)
{
	LLMessageSystem* msg = gMessageSystem;

	// ignore returned flags
	objectp->processUpdateMessage(msg, user_data, i, update_type, dpp);
		
	if (objectp->isDead())
	{
		// The update failed
		return;
	}

	updateActive(objectp);

	if (just_created) 
	{
		gPipeline.addObject(objectp);
	}

	// Also sets the approx. pixel area
	objectp->setPixelAreaAndAngle(gAgent);

	// RN: this must be called after we have a drawable 
	// (from gPipeline.addObject)
	// so that the drawable parent is set properly
	findOrphans(objectp, msg->getSenderIP(), msg->getSenderPort());
	
	LLVector3 pScale=objectp->getScale();
	if(objectp->permYouOwner())
	{
		if(objectp->permModify() && objectp->permCopy() && objectp->permTransfer())
		{
			if (gImportTracker.getState() != ImportTracker::IDLE && objectp)
			{
				if((gImportTracker.getState() == ImportTracker::WAND && just_created && objectp->mCreateSelected) || (pScale.mV[VX] == 0.52345f && pScale.mV[VY] == 0.52346f && pScale.mV[VZ] == 0.52347f
					&& gImportTracker.getState() == ImportTracker::BUILDING))
				gImportTracker.get_update(objectp->mLocalID, just_created, objectp->mCreateSelected);
			}
		}
	}

	// If we're just wandering around, don't create new objects selected.
	if (just_created 
		&& update_type != OUT_TERSE_IMPROVED 
		&& objectp->mCreateSelected)
	{
		if(JCExportTracker::getInstance()->getStatus() == JCExportTracker::EXPORTING &&
		   JCExportTracker::getInstance()->expected_surrogate_pos.count(objectp->getPosition()) > 0)
		{
			//the surrogate prim has been created, notify JCExportTracker
			JCExportTracker::getInstance()->queued_surrogates.push_back(objectp);
			JCExportTracker::getInstance()->surrogate_roots.push_back(objectp);
		}
		else if ( LLToolMgr::getInstance()->getCurrentTool() != LLToolPie::getInstance() )
		{
			//llinfos << "DEBUG selecting " << objectp->mID << " "
			//		<< objectp->mLocalID << llendl;
			LLSelectMgr::getInstance()->selectObjectAndFamily(objectp);
			dialog_refresh_all();
		}

		objectp->mCreateSelected = false;
		gViewerWindow->getWindow()->decBusyCount();
		gViewerWindow->getWindow()->setCursor( UI_CURSOR_ARROW );
	}
}