void FEdModeGeometry::PostUndo()
{
	// Rebuild the geometry data from the current brush state

	GetFromSource();
	
	// Restore selection information.
	for( int32 o = 0 ; o < GeomObjects.Num() ; ++o )
	{
		int32 Idx = 0;
		FGeomObject* go = GeomObjects[o];

		ABrush* Actor = go->GetActualBrush();

		// First, clear the current selection
		go->SelectNone();

		// Next, restore the cached selection
		int32 res = go->SetPivotFromSelectionArray( Actor->SavedSelections );
		
		//use the centre of the actor if we didnt find a suitable selection
		if( res == INDEX_NONE )
		{
			FEditorModeTools& Tools = GEditorModeTools();
			Tools.SetPivotLocation( Actor->GetActorLocation() , false );
		}
		
		go->ForceLastSelectionIndex( res );
	}
}
Esempio n. 2
0
void FEdModeGeometry::Enter()
{
	FEdMode::Enter();
	
	if (!Toolkit.IsValid())
	{
		Toolkit = MakeShareable(new FGeometryMode);
		Toolkit->Init(Owner->GetToolkitHost());
	}

	GetFromSource();
}
void FEdModeGeometry::Enter()
{
	FEdMode::Enter();
	
	if (!Toolkit.IsValid())
	{
		// @todo: Remove this assumption when we make modes per level editor instead of global
		auto ToolkitHost = FModuleManager::LoadModuleChecked< FLevelEditorModule >( "LevelEditor" ).GetFirstLevelEditor();
		Toolkit = MakeShareable(new FGeometryMode);
		Toolkit->Init(ToolkitHost);
	}

	GetFromSource();
}
void FEdModeGeometry::MapChangeNotify()
{
	// If the map changes in some major way, just refresh all the geometry data.
	GetFromSource();
}
void FEdModeGeometry::ActorSelectionChangeNotify()
{
	GetFromSource();
}
void FEdModeGeometry::UpdateInternalData()
{
	GetFromSource();
}