public void TestConcurrencyReadWriteAccess2() { Utils.CleanContext(); Utils.GenerateSourceFile("input1", "{99D73F8B-587A-4869-97AE-4A7185D88AC9}"); var inputDep = new ObjectUrl(UrlType.File, Utils.GetSourcePath("input1")); var buildStepList1 = new ListBuildStep(); var step = new ListBuildStep(); step.Add(new InputOutputTestCommand { Delay = 100, Source = inputDep, OutputUrl = "/db/url1", InputDependencies = { inputDep } }); buildStepList1.Add(step); buildStepList1.Add(new InputOutputTestCommand { Delay = 1500, Source = new ObjectUrl(UrlType.Content, "/db/url1"), OutputUrl = "/db/dump1", InputDependencies = { inputDep } }); var buildStepList2 = new ListBuildStep(); step = new ListBuildStep(); step.Add(new InputOutputTestCommand { Delay = 100, Source = inputDep, OutputUrl = "/db/url1", InputDependencies = { inputDep } }); buildStepList2.Add(step); buildStepList2.Add(new InputOutputTestCommand { Delay = 1500, Source = new ObjectUrl(UrlType.Content, "/db/url1"), OutputUrl = "/db/dump2", InputDependencies = { inputDep } }); var builder = Utils.CreateBuilder(false); builder.ThreadCount = 1; builder.Root.Add(buildStepList1); builder.Root.Add(buildStepList2); var buildResult = builder.Run(Builder.Mode.Build); Assert.Equal(BuildResultCode.Successful, buildResult); }
protected override void Compile(AssetCompilerContext context, string urlInStorage, UFile assetAbsolutePath, AnimationAsset asset, AssetCompilerResult result) { // Get absolute path of asset source on disk var assetDirectory = assetAbsolutePath.GetParent(); var assetSource = UPath.Combine(assetDirectory, asset.Source); var extension = assetSource.GetFileExtension(); var buildStep = new ListBuildStep(); var additiveAnimationAsset = asset as AdditiveAnimationAsset; if (additiveAnimationAsset != null) { var baseUrlInStorage = urlInStorage + "_animation_base"; var sourceUrlInStorage = urlInStorage + "_animation_source"; var baseAssetSource = UPath.Combine(assetDirectory, additiveAnimationAsset.BaseSource); // Import base and main animation if (ImportFbxCommand.IsSupportingExtensions(extension)) { buildStep.Add(new ImportFbxCommand { SourcePath = assetSource, Location = sourceUrlInStorage, ExportType = "animation", AnimationRepeatMode = asset.RepeatMode }); buildStep.Add(new ImportFbxCommand { SourcePath = baseAssetSource, Location = baseUrlInStorage, ExportType = "animation", AnimationRepeatMode = asset.RepeatMode }); } else if (ImportAssimpCommand.IsSupportingExtensions(extension)) { buildStep.Add(new ImportAssimpCommand { SourcePath = assetSource, Location = sourceUrlInStorage, ExportType = "animation", AnimationRepeatMode = asset.RepeatMode }); buildStep.Add(new ImportAssimpCommand { SourcePath = baseAssetSource, Location = baseUrlInStorage, ExportType = "animation", AnimationRepeatMode = asset.RepeatMode }); } // Wait for both import fbx commands to be completed buildStep.Add(new WaitBuildStep()); // Generate the diff of those two animations buildStep.Add(new AdditiveAnimationCommand(urlInStorage, new AdditiveAnimationParameters(baseUrlInStorage, sourceUrlInStorage, additiveAnimationAsset.Mode))); } else { // Import the main animation if (ImportFbxCommand.IsSupportingExtensions(extension)) { buildStep.Add(new ImportFbxCommand { SourcePath = assetSource, Location = urlInStorage, ExportType = "animation", AnimationRepeatMode = asset.RepeatMode }); } else if (ImportAssimpCommand.IsSupportingExtensions(extension)) { buildStep.Add(new ImportAssimpCommand { SourcePath = assetSource, Location = urlInStorage, ExportType = "animation", AnimationRepeatMode = asset.RepeatMode }); } } result.BuildSteps = buildStep; }