Coder Social home page Coder Social logo

muuetools's Introduction

muuetools's People

Contributors

muchenhen avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

linecode

muuetools's Issues

需要一个生成level sequence的功能

具体需求是这样的
打开一个文件夹--根据文件夹名称新建一个关卡序列--打开关卡序列--在序列上新建相机--导入相机--导入角色骨骼--导入角色动画

FString SSFMenu::OpenWindowsFiles()
{
	FString DirName;
	FString ExtensionStr = TEXT("*.*");//文件类型
	IDesktopPlatform* DesktopPlatform = FDesktopPlatformModule::Get();
	bool aSuccess = DesktopPlatform->OpenDirectoryDialog(nullptr, TEXT("创建镜头"), FPaths::ConvertRelativePathToFull(FPaths::ProjectDir()), DirName);

	if (aSuccess)
	{
		//文件选择成功,文件路径 path
		GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, DirName);
		//文件选择成功,文件路径 path
		UE_LOG(LogTemp, Warning, TEXT("打开成功"));
		//新建内存
		TArray<FString> Fenge;
		DirName.ParseIntoArray(Fenge, TEXT("/"), true);
		FString Changci = Fenge[4];
		GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, TEXT("场次:" + Fenge[4]));
		FString Jingtouhao = Fenge[5];
		GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, TEXT("镜头号:" + Fenge[5]));
		FString PackageName = "/Game/shot/";
		PackageName = PackageName + Fenge[4] + "/" + Fenge[5] + "/" + Fenge[5];
		GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, PackageName);
		UPackage* Package = CreatePackage(NULL, *PackageName);
		//新建关卡序列文件
		auto MaterialFactory = NewObject<ULSFN>();
		UObject* Guanqiaxulie = (UObject*)MaterialFactory->FactoryCreateNew(UFactory::StaticClass(), Package, *Jingtouhao, RF_Standalone | RF_Public, NULL, GWarn);
		FAssetRegistryModule::AssetCreated(Guanqiaxulie);
		Package->FullyLoad();
		Package->SetDirtyFlag(true);
		//打开关卡序列

		//新建相机
		//auto ss = new FSequencerEdMode();

			FStringAssetReference SequenceName(PackageName);
			ULevelSequence* SequenceAsset = Cast<ULevelSequence>(SequenceName.TryLoad());
			UMovieScene* MovieScene = SequenceAsset->GetMovieScene();
			//pNewCamera->CameraComponent->FieldOfView = ViewportClient->ViewFOV; //@todo set the focal length from this field of view

			//创建相机序列
			//MovieScene->AddCameraCutTrack(UMovieSceneCameraCutTrack::StaticClass());
			//MovieScene->AddNewBindingTag("SFPluginCamera");

			auto Dakai = NewObject<UEditorEngine>();
			Dakai->EditObject(Guanqiaxulie);

		//	UWorld* World = GCurrentLevelEditingViewportClient ? GCurrentLevelEditingViewportClient->GetWorld() : nullptr;
		//	if (!World)
		//	{
		//		return;
		//	}

        //	FSequencerCommands::Get().CreateCamera;
		//	Commands.CreateCamera;


		//遍历
	/*	TArray<FString> FoundFiles;
		FFileManagerGeneric::Get().FindFiles(FoundFiles, *aaa, TEXT(".ue4stats"));
		for (FString& FilePath : FoundFiles)
		{
			const TCHAR* PathDelimiter = FPlatformMisc::GetDefaultPathSeparator();

		}*/
	}
	return DirName;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.