You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb none #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 4073383 by Patrick.Boutot [AJA] Set base timecode for AJA TimecodeProvider Change 4075631 by Patrick.Boutot Change icon for TimecodeSynchronizer. Update TimecodeSynchronizer with the new AJA delayed open sources. Add TimecodeProvider to TimecodeSynchronizer. Can now sync with TimecodeProvider or a master. Make sure the source are ready before viewing them. Remove PreRoll command. Change 4077328 by JeanMichel.Dignard Fixed SoftObjectPtr/Paths becoming invalid when saving a new world since it's being moved from /Temp/Untitled to its own package. #jira UEENT-1423 Change 4077338 by Rex.Hill USD plugin updated to v8.4 with python support Change 4079063 by Rex.Hill USD sdk recompiled as vs2015 targeting older version of CRT, also dependency added for PythonScriptPlugin Change 4079911 by Rex.Hill USD pyd files recompiled Change 4080058 by Rex.Hill Fix usd plugin loading, added missing libtrace.dll Change 4080376 by Matt.Hoffman Improvements to Sequence Recorder's public API to expose more functionality for third parties. Change 4084984 by Matt.Hoffman Sequence Recorder can now set a global time dilation when recording starts, optionally ignoring the dilation when recording keys. This is useful for recording objects in your scene that move too fast to track with a camera but still ending up with the same length recording in the end. #jira UESP-670 Change 4086688 by Matt.Hoffman Exposes getting and setting keys from sequencer sections via the scripting layer. Examples for how to work with Python and key data can be found in /Plugins/MovieScene/SequencerScripting/Content/Python in the form of "sequencer_examples.py" and "sequencer_key_examples.py". Documentation on how to use these examples is included in the python file. #jira UESP-547 Change 4088904 by Max.Chen Sequence Recorder: Set actor tags as unique Change 4089176 by Max.Chen Sequence Recorder: Add option to record to the target level sequence playback range length. Change 4089180 by Max.Chen Sequence Recorder: Add protection agains null movie scene sections Change 4089205 by Max.Chen Sequence Recorder: Save recorded audio files if auto save is on. #jira UESP-660 Change 4089206 by Max.Chen Sequencer: When importing fbx, if a camera is created, force mapping to be by name matching only so that other nodes in the fbx file do not get mapped onto the newly created camera. #jira UE-59347 Change 4089214 by Max.Chen Sequence Recorder: Add support for looping/rolling takes #jira UESP-658 Change 4089280 by Max.Chen Sequence Recorder: Added support to specify properties from actor classes (camera rig rail - current position on rail) Change 4093824 by Andrew.Rodham Editor: Added option to class pickers to force use of class Display Names Change 4093826 by Andrew.Rodham Removed implicit gamma to linear conversion from EXR writer - This was only implemented for exr data that was supplied as 8 bits per channel (ie. uint8), but there is no way of communicating with the Image Writer API to tell it whether you want it to do that conversion. This code is too low level to be making assumptions about what color-space the data is in. - This ensures that R8G8B8A8 render targets exported as EXR are exported as-is without any modification #jira UESP-545 Change 4093830 by Andrew.Rodham Fixed shutdown crash when destroying a media player that was still playing Change 4093831 by Andrew.Rodham Fixed exception handling in png image wrapper Change 4093833 by Andrew.Rodham Slate: Fixed not being able to set a hyperlink on notifications with unbound attributes that had explicit values set Change 4093841 by Andrew.Rodham Added a utility struct for dealing with editor actor layers from within Blueprints Change 4093867 by Andrew.Rodham Sequencer: Added the ability to implement custom capture protocols for movie scene captures - Converted capture protocol settings and instances to be single UObjects. This unifies the two concepts, and allows for Blueprint implementations. - Removed capture protocol registry since it is no longer required. - Removed FCaptureProtocolID in favor of class discovery at runtime. - Added new module "ImageWriteQueue", responsible for asynchronously managing a queue of image file write operations. - Added new capture protocol for capturing final pixels to EXR (including burn-ins) - Added a new BP function, ExportToDisk, accessible on all UTexture properties for writing texture and render target data to image files - New global BP nodes for querying movie capture status: IsCaptureInProgress, FindCaptureProtocol - Removed Flush On Draw functionality from viewports and frame grabber since it is unnecessary. #jira UESP-545 Change 4094239 by Rex.Hill Export sequence to usd #jira UESP-563 Change 4094393 by Andrew.Rodham Renamed references of 'BufferName' to 'StreamName' for user defined capture protocols Change 4094622 by Patrick.Boutot Add MediaFrameworkUtilitites plugin. Add MediaBundle. An asset that create a MediaPlayer, MediaSource, MediaTexture and MaterialInstance. Add MediaBundleActor. Can auto play a MediaBundle when click & drag in the viewport. Add the Media category in placement mode. Add flag on the MediaPlayer that prevent it from closing when PIE is started or closed. Change 4094673 by Anousack.Kitisa Created widget to display metadata as list view of tags/values. #jira UEENT-1296 Change 4094795 by Simon.Therriault MediaFrameworkUtilities - Adding default media texture for default media bundle material - Changed default material to unlit Change 4094867 by Rex.Hill Usd sequence exporter camera rotation corrected Change 4096426 by JeanLuc.Corenthin - Fixed logic of FLayoutUV::FindCharts to properly extract the list of triangles based on a mesh description. - Fixed logic in FMeshDescriptionOperations::ConverToRawMesh & FMeshDescriptionOperations::ConvertHardEdgesToSmoothGroup to take in account the fact that the arrays are sparse arrays - Fixed logic in FQuadricSimplifierMeshReduction::ReduceMeshDescription which wrongly assumed that number of vertex instances equals three times the number of triangles. - Added early-out in UMeshDescription::ComputePolygonTriangulation when perimeter has 3 vertex indices - Changed version of static mesh and mesh description - Fixed issue with mismatching attribute set when generating LOD meshes #jira UEENT-887, UE-59474, UE-59471 Change 4097101 by Patrick.Boutot Remove warning in PropertyEditorClass when trying to load the "None" class. Change 4097443 by Rex.Hill USD export bake keys Change 4097468 by Patrick.Boutot Edit and initialize the timecode provider of the editor. Change 4097479 by Anousack.Kitisa Added support for commandlet and unattended script modes to Plugin Warden. #jira UE-57333 Change 4097578 by Rex.Hill USD export tweaks Change 4098257 by Simon.Therriault GarbageMatteCaptureComponent - Adding spawned actor tracking to be able to use GarbageMatteActor spawned in editor. Change 4100072 by Jamie.Dale Updated wrapped enums to be more consistent with native Python enums - Wrapped enums now generate values that are instances of the enum type itself, containing a name and value field (like native Python enums). - Wrapped enums are now strongly typed and do not allow implicit conversion from numbers (explicit casting is available, but throws if the value is unknown). - Wrapped enum entries may be compared against numbers (even numbers that don't have valid values) via the == and != operators (like IntEnum in Python). - Wrapped enums may now be iterated (like native Python enums). - Wrapped enums now return a length based on their number of entries (like native Python enums). - ScriptName meta-data can now be used with enum entries. Change 4100255 by Patrick.Boutot [MediaBundle] Modify the base shader to support "failed texture" Change 4103838 by Simon.Therriault MR Garbage Matte Component - Adding FocalDriver interface to be able to poll focal information from outside (cinecamera). Could be updated to be event driven. Change 4115616 by Rex.Hill USD Exporter now exposed to UI Change 4116333 by Simon.Therriault MediaBundle - Updated default media bundle to include lens distortion and chromakeying - Added possibility to spawn material editor for MediaBundle inner material - Fix for inner objects flags preventing asset deletion - Fix for CloseMedia not being called when changing map Lens Distortion - Fix for not being able to generate a Identity lens displacement map Change 4117952 by Rex.Hill Expose OpenEditorForAssets to python Change 4118498 by Rex.Hill Sequencer USD export can now export properties of actors in levels Change 4118515 by Rex.Hill Update sequencer export task comment Change 4118706 by Rex.Hill Sequencer USD updates Change 4118968 by Rex.Hill Sequencer USD export now supports visibility Change 4119702 by Simon.Therriault MediaBundle - Fix crash when changing MediaBundle on Actor multiple times. - Fix crash when Undoing after placing a MediaBundle and pressing Stop then Undo. - Fixed bad reference count in MediaBundle when undo/redo of MediaBundle setting changed on MediaBundleActor - Added PostEditChange after setting MaterialProperty to fix potential propagation. Change 4120060 by Patrick.Boutot Fix typo for TimecodeProviderClassName. Add "Config required restart" Add a button to reapply the CustomTimeStep or TimecodeProvider Change 4122062 by Krzysztof.Narkowicz Fixed movie burnout fixed timestep. Engine didn't use a fixed time step due to a following bug: 1. UAutomatedLevelSequenceCapture::Initialize calls UMovieSceneCapture::Initialize. 2. UMovieSceneCapture::Initialize creates FRealTimeCaptureStrategy and calls CaptureStrategy->OnInitialize(). 3. UAutomatedLevelSequenceCapture::Initialize changes CaptureStrategy to FFixedTimeStepCaptureStrategy, but no one calls CaptureStrategy->OnInitialize(); after that and this function is required to set the fixed time step. 4. Result: movies are burned out with variable time step, causing different inconsistencies between frames, settings and HW configurations. #jira none Change 4122236 by Anousack.Kitisa Made the "Import Into Level..." File menu action follow the EditorImport flag of a SceneImportFactory. #jira UE-57612 #jira UEENT-762 Change 4122588 by Rex.Hill Sequencer Export USD lights now supported Change 4122822 by JeanMichel.Dignard Fix for UV packing FlipX. Don't flip the empty columns at the end since they are always expected to be on the right side. The same was already done for FlipY. #jira UE-56664 Change 4123009 by JeanMichel.Dignard Copied fixes from MeshUtilities LayoutUV to MeshDescription LayoutUV Change 4123517 by JeanLuc.Corenthin Fixed crash when running cooked game crash with asset imported from datasmith #jira UE-60173 Change 4124569 by Patrick.Boutot [AJA] When the CustomTimeStep & TimecodeProvider signal is lost in the editor (not in PIE), try to re-synchronize every second. Change 4126421 by Max.Chen Sequencer: Add the ability to switch the takes of all the selected shots/subsections. #jira UESP-761 Change 4133010 by Simon.Therriault MediaBundle - Made assets in the bundle visible in the content browser (different package per asset) and updated to support duplication correctly - Quick fix for MaterialDynamicInstance garbage matte parameter not going back to default value when cleared. - Added looping option on the bundle Keyer and lens materials - Renamed some parameter groups to Keyer_XX Change 4135728 by Rex.Hill MovieSceneCapture crash fix when iteration on classes defined in python Change 4135732 by Rex.Hill Sequencer scripting: expose get playback range, sub sequence get sequence Change 4135734 by Rex.Hill USD python code refactored Change 4136017 by Matt.Hoffman Fixes FrameNumber nodes tripping an ensure when using them via Blueprints and fixes FrameNumbers & friends not being properly breakable in BP. #jira UE-60188 Change 4147959 by Patrick.Boutot Media Output Architecture. Support 8bits & 10bits color. Capture the buffer as is with the correct pixel format and the corredt target size. Change 4147962 by Patrick.Boutot Remove AjaMediaViewportOutput && AjaMediaViewportOutputImpl. Refactor AjaMediaOutput to extend MediaOutput. Refactor AjaMediaGrameGrabberProtocol to use AjaMediaCapture. Create AjaMediaCapture. Change 4148395 by Rex.Hill USD python code cleanup Change 4152901 by Rex.Hill Fix crash when recompiling blueprint or script class that serializes an object reference manually Change 4152906 by Rex.Hill USD level import/export exposed to UI Change 4152956 by Rex.Hill Rename unreal_usd to usd_unreal to avoid future module name conflicts Change 4153331 by Rex.Hill Simplify USD attribute definitions Change 4155472 by Rex.Hill USD level import now handles cameras and lights Change 4155832 by Patrick.Boutot Fix Packaging for MediaFrameworkUtilities Fix MediaPlayer that crash on close when the engine is closing. Change 4156020 by Mike.Zyracki LIVE LINK Sequencer Recording and Playback #jira UESP-714 #jira UESP-715 Support for Live Link Recording/Playback with Sequencer. Basically if we see a MotionController controlled by a LiveLink Subject or a LiveLink Component on a Actor we create a LiveLinkTrack for it that will record raw sequencer data into. We currently do that at the end of recording but will investigate saving it as we record. For Playback we create a Live Link Subject per recorded track and push up interpolated data per Engine Tick on Evaluate. We need to see if we need to send out raw data but that's complicated due to the fact that sequencer time may not be sequential but random, Moved FLiveLinkTimeFrame to LiveLinkTypes so we can grab raw data. Added functions to LiveLinkClient/Subject to get raw data so we dont' need to do expensive searches. Also changed that code so that we can only save the LiveLinkData when specified. We decided to have the sequencer own saving of the live link data so we explicilty turn on saving when we start to record and then turn if off at the end. Without this it's possible to easily run out of memory while LiveLink records. In order to record LiveLinkComponents under Actors we had to change ActorRecording to record ActorComponents and not jus SceneComponents. Not sure of any drawbacks with this but it seems to work well. Had to make sure we stll keeped attach/parent/child logic when recording. Change 4158488 by Rex.Hill USD scene import/export now uses UsdLux lights Change 4158742 by Rex.Hill USD: Add test for level export and import Change 4161645 by Patrick.Boutot Update MediaRecorder to use the ImageWriteQueue. Add flag in IImageWriteQueue.Enqueue to prevent block if the queue is full. Change 4161651 by Patrick.Boutot Modify MediaCompositing to use an existing MediaPlayer Change 4161657 by Patrick.Boutot Extend the SequenceRecorder to support additional object to record from other plugins. Add SequenceRecorder for MediaPlayer. Will record every frame to disk that the MediaPlayer produce. Change 4162699 by Rex.Hill USD export sequence updates Change 4163138 by Rex.Hill USD sequence export test added Change 4163426 by Mike.Zyracki Fix for Curve Names being kept and AutoSetting Tangents on Live Link Recording Change 4165714 by Patrick.Boutot [MediaCapture] Remove color box that tell the status of the MediaCapture. Add MediaCapture's name and use an image to represent the status. Use a ScrollBox around the "preview" output. Can select any actors. Only show the selectable camera grid when there is more than one camera. Change 4166652 by Rex.Hill Expose SetMobility to scripting Change 4167292 by Mike.Zyracki Make sure we call Finalize Evaluation when closing or deleting the Sequencer. This will make sure TearDown is called on sections which fixes issues with LiveLink Sources not getting deleted and probably also issues with MovieScenePlayers not getting released correctly. Also includes addition to show the SubjectName next to the Sequencer Source in the LiveLinkClient UI. Change 4170578 by Rex.Hill PackageTools exposed to scripting Change 4170619 by Rex.Hill Fix ReversePolygonFacing crash Change 4170621 by Rex.Hill USD mesh import can now be given list of individual meshes Change 4172495 by Matt.Hoffman Fixes some flipped logic in Sequencer Media Track that was preventing it from working as expected. Slightly simplifies the logic on setting up movie data, and ensures that the external movie player has a callback registered so that SeekTo calls will work. Makes it so that you can specify your own sound component with an external media player as a media player can have multiple sound components listening to it. Adds support for flagging the media player to loop to help cue some media sources like EXR to handle loop points better. #jira None Change 4173387 by Jon.Nabozny Bookmark usability and extensibility improvements Change 4173755 by Rex.Hill PackageTools namespace deprecation Change 4181799 by Patrick.Boutot Fix precesion error when importing a camera switcher in sequencer #jira UE-61212 Change 4184435 by Patrick.Boutot Only show the MediaCapture tab spawner in the level editor. Make sure the Material used to draw the render target is GCed. Change 4195803 by Patrick.Boutot Warn user if the AJA CustomTimeStep is used with VSync enabled. Change 4195866 by Patrick.Boutot Remove mention of CharBGR10A2 in AJA. The feature is not yet ready. Change 4196059 by Rex.Hill Fix linux compile due to a .cpp including BookMarkBase.h instead of BookmarkBase.h Change 4196380 by Patrick.Boutot MediaCapture capture the backbuffer when the Viewport don't use an internal texture. #jira UE-61601 Change 4199378 by Patrick.Boutot For MediaFramework, add support for 10bits RGB texture Change 4199380 by Patrick.Boutot [AJA] Add support for 10bits RGB texture in input Fix interlaced format that wasn't using the proper Stride value. Change 4200359 by Jamie.Dale Renamed some "K2_" prefixed functions for Python Change 4203016 by Max.Chen Sequencer: Add movie scene locking/read only. Fixed a few bugs with locked sections - shouldn't be able to create or move keys on locked sections #jira UESP-867 Change 4203018 by Max.Chen Sequencer: Test for movie scene read only before calling modify/transactions. #jira UESP-867 Change4203622by Simon.Therriault Bringing Aja MediaOutput MediaMode fix from Release 4.20 Change 4204895 by Rex.Hill Expose several file path functions to scripting Change 4206747 by Rex.Hill USD level import and export updates Change 4206783 by Rex.Hill USD updates Change 4207021 by Rex.Hill USD, fix rotation on level import when there is non-uniform scale Change 4207414 by Rex.Hill USD import static mesh material improvements Change 4209733 by Patrick.Boutot Change the log time to use the current frame Timecode #jira UEENT-1107 Change 4209738 by Patrick.Boutot Option to automatically try to reopen the MediaSource again if an error is detected Change 4210385 by Max.Chen Sequencer: Fix CurrentShot LocalTime computation by using sequence time in playback resolution to compute the local shot time. Also, fixed the burnin asset so that CurrentShotLocalTime is hooked up to ShotFrame instead of MasterTime. This fixes a bug where the burnin's {ShotFrame} is not reporting the local shot frame number. #jira UE-61728 Change 4219824 by Patrick.Boutot Use the correct EditorCondition for property MaxNumAncillaryFrameBuffe Change 4220706 by Louise.Rasmussen Sequencer: Syncronizes Sections using Source Timecode Relative to the first Selected Section #JIRA UESP-826 Change 4220708 by Louise.Rasmussen Sequencer: Adds SourceTimecode option to the Render Movie Settings Burn In #JIRA UESP-826 Change 4226970 by Patrick.Boutot Add a Timecode widget, TimecodeProvider widget and a TimecodeProvider Tab Change 4227333 by Rex.Hill USD Sequencer export now supports deltas Change 4227455 by Matt.Hoffman Adds support to the Audio Mixer Submix to pause and resume a recording. #jira UESEQ-77 Change 4230963 by Patrick.Boutot Make the namespace an import option Change 4234208 by Jon.Nabozny Fixed crash when 5 or more LiveLink sources were connected at the same time Change 4234273 by Jon.Nabozny Add methods in FApp to get the current Timecode FrameRate. Change 4237170 by Simon.Therriault MediaCapture Fix for MediaCapture panel not working in PIE Change 4243758 by Andrew.Rodham It's now possible to resolve pixel data from a render target whose texture resource is still pending creation Change 4244790 by Matt.Hoffman This adds experimental support to Sequencer's Render to Movie for exporting audio via rendering a second pass. This requires the new audio mixer (launch editor with "-audiomixer") and currently supports exporting to .wav. The second pass disables rendering in the Viewport and disables capturing frames during this pass which removes the overhead caused by rendering the scene. Complex scenes still evaluate the sequence which may impact performance in complex situations (such as the Fortnite Launch Trailer). Current Limitations: Requires the new audio mixer ("-audiomixer") The second pass must acheive real time framerates. The audio engine is only built to handle real time situations (due to the high precision needed, gotten via the platform clock) so any drops in engine framerate during the second pass will cause a desync of the audio (as there will be more samples captured than frames of video). The editor has significant overhead which often prevents achieving consistent real-time rates. Using "Capture in New Process" alleviates this issue, even without closing the Editor. Audio has been enabled for both image capture and audio capture passes, which means stuttery audio now plays back during image capture. Attempts to alleviate this issue ended up conflicting with some editor code that forces the audio multiplier to 1.0 each Tick(), so audio has to play on both image and audio passes. Forces background audio (otherwise your output audio wav will be blank!) when app is not in focus, though users should leave the app in focus for best performance. #jira UESEQ-77, UESP-669 Change 4246443 by Simon.Tourangeau Remove Beta flag from nDisplay plugin #jira UEENT-1716 Change 4246480 by Simon.Tourangeau Fix nDisplay plugin icon #jira UEENT-1715 Change 4246571 by Simon.Tourangeau Merging Lauren's VR Editor fixes 4085915 Gamma correction fixes for VR Mode Content Browser icons and camera previews 4087955 Adding a third looping option to the Sequencer Radial Menu. Selecting the Looping option now cycles through No Looping > Loop All > Loop Range 4089914 Adding set start/end range buttons to radial menu 4090502 Fixing sequencer looping not being set correctly 4092824 Cameras are now visible in VR Mode - interim implementation until Game Mode works entirely 4095161 Fix for opening a sequence blocking level editor tab drag and drop 4096999 Making a VR Edit show flags mode that is similar to Game Mode but without the Game flag set to true, does hide billboards. Camera hide/show behavior is now correct. 4097286 Placing cameras now only summons the preview panel once you release 4100941 New spawn location for camera preview window (in front and to the side, on whichever side matches your UI hand) 4102732 Hiding VR editor elements from camera preview 4103378 Added camera burnin text on preview windows as well. 4103466 Fixes for camera text 4103779 Fix for the actor previews not unpinning when entering VR mode. 4105722 Adding support for multiple viewport previews in VR mode, and not creating a new viewport interaction if one already exists when getting it. 4106982 Any dockable window can now be placed in the world. 4107298 Fix for crash when closing multiple camera previews 4107426 Fix for crash when connecting node with no texture set 4136343 UI windows docked "to the world" no longer scale with you and stay the size they are docked at. 4136345 Settings for tweaking VR mode movement 4147473 Fix for controllers not showing up 4147734 Sequencer scrubbing will now pause when removing your thumb from a Vive touchpad4171489Added external UI panel support to VREditor module. Created an example camera-adjusting UI 4186392 Second fix for sequencer scrubbing on the radial menu Change 4247984 by Jamie.Dale Fixed potential memory corruption caused by Python glue code generation #jira UE-62397 Change 4255471 by Anousack.Kitisa Added functionalities to add/insert/remove UV channel from a StaticMesh accessible through the StaticMeshEditor and scripting. #jira UEENT-1592 #jira UEENT-1597 #jira UEENT-1660 Change 4256323 by Anousack.Kitisa Added Polygon Selection Mode by smoothing group in the MeshEditor. #jira UEENT-1594 Change 4258012 by Homam.Bahnassi Extending UVEdit material function to support mirroring. #jira UE-57306 Change 4258231 by Jamie.Dale Fixed GetHostName failing to convert UTF-8 data correctly Change 4258579 by Jamie.Dale Ensure that packages re-created after deleting their only asset are marked as fully loaded Change 4258652 by Jamie.Dale Added script exposed method to convert an Unreal relative path to absolute Change 4259124 by Patrick.Boutot For MediaBundle, show or hide the failed texture on console. #jira UE-61672 Change 4259264 by Jamie.Dale Show an error if trying to use ExecutePythonScript without Python enabled #jira UE-62318 Change 4259451 by Jamie.Dale No longer use stale subtitles in dialogue waves #jira UE-61500 Change 4259511 by Jamie.Dale Fix crash when passing None as the class for find/load_asset #jira UE-62130 Change 4259542 by Patrick.Boutot Can select the TimecodeSynchronizer from the Toolbar menu. Add option to show it in the toolbar. Can be defaulted by user/machine. Change 4259582 by Patrick.Boutot Hide Edit & Paste from PropertyMenuAssetPicker Change 4260760 by Max.Chen Sequencer: Fix dereferencing null pointer - CameraNode Change 4260895 by Jamie.Dale Changing localization target settings now updates the gather INI files immediately Change 4262166 by Patrick.Boutot Add support for MediaSourceProxy and MediaOutputProxy. Change 4262535 by Andrew.Rodham Sequencer: Added a method for user-defined capture protocols to resolve a buffer and pass it directly to a bound delegate handler Originating source CL#4261391 Change 4262669 by Patrick.Boutot Add MediaProfile. It let the user select their media sources and media outputs by machine by user. Change 4264577 by Patrick.Boutot Change the type of FMediaFrameworkCaptureCameraViewportCameraOutputInfo.LockedCameraActors to LazyObject to enable cross level reference. #jira UE-62438 Include dependence to settings Change 4265750 by JeanLuc.Corenthin Fix array's size issues with MeshDescription utility functions #jira UEENT-1574 Change 4268181 by Patrick.Boutot Mark LockedCameraActors as deprecated. [CL 4279869 by JeanMichel Dignard in Main branch]
618 lines
34 KiB
C++
618 lines
34 KiB
C++
// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "LocalizationCommandletTasks.h"
|
|
#include "Misc/MessageDialog.h"
|
|
#include "Misc/Paths.h"
|
|
#include "Internationalization/Culture.h"
|
|
#include "UObject/UObjectHash.h"
|
|
#include "Sound/SoundWave.h"
|
|
#include "Sound/DialogueWave.h"
|
|
#include "LocalizationCommandletExecution.h"
|
|
#include "LocalizationConfigurationScript.h"
|
|
#include "LocalizationTargetTypes.h"
|
|
#include "HAL/FileManager.h"
|
|
|
|
#define LOCTEXT_NAMESPACE "LocalizationCommandletTasks"
|
|
|
|
bool LocalizationCommandletTasks::GatherTextForTargets(const TSharedRef<SWindow>& ParentWindow, const TArray<ULocalizationTarget*>& Targets)
|
|
{
|
|
TArray<LocalizationCommandletExecution::FTask> Tasks;
|
|
|
|
for (ULocalizationTarget* Target : Targets)
|
|
{
|
|
const bool ShouldUseProjectFile = !Target->IsMemberOfEngineTargetSet();
|
|
|
|
FFormatNamedArguments Arguments;
|
|
Arguments.Add(TEXT("TargetName"), FText::FromString(Target->Settings.Name));
|
|
|
|
const FText GatherTaskName = FText::Format(LOCTEXT("GatherTaskNameFormat", "Gather Text for {TargetName}"), Arguments);
|
|
const FString GatherScriptPath = LocalizationConfigurationScript::GetGatherTextConfigPath(Target);
|
|
LocalizationConfigurationScript::GenerateGatherTextConfigFile(Target).WriteWithSCC(GatherScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(GatherTaskName, GatherScriptPath, ShouldUseProjectFile));
|
|
}
|
|
|
|
return LocalizationCommandletExecution::Execute(ParentWindow, LOCTEXT("GatherAllTargetsWindowTitle", "Gather Text for All Targets"), Tasks);
|
|
}
|
|
|
|
bool LocalizationCommandletTasks::GatherTextForTarget(const TSharedRef<SWindow>& ParentWindow, ULocalizationTarget* const Target)
|
|
{
|
|
TArray<LocalizationCommandletExecution::FTask> Tasks;
|
|
const bool ShouldUseProjectFile = !Target->IsMemberOfEngineTargetSet();
|
|
|
|
const FString GatherScriptPath = LocalizationConfigurationScript::GetGatherTextConfigPath(Target);
|
|
LocalizationConfigurationScript::GenerateGatherTextConfigFile(Target).WriteWithSCC(GatherScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(LOCTEXT("GatherTaskName", "Gather Text"), GatherScriptPath, ShouldUseProjectFile));
|
|
|
|
FFormatNamedArguments Arguments;
|
|
Arguments.Add(TEXT("TargetName"), FText::FromString(Target->Settings.Name));
|
|
|
|
const FText WindowTitle = FText::Format(LOCTEXT("GatherTargetWindowTitle", "Gather Text for Target {TargetName}"), Arguments);
|
|
return LocalizationCommandletExecution::Execute(ParentWindow, WindowTitle, Tasks);
|
|
}
|
|
|
|
|
|
bool LocalizationCommandletTasks::ImportTextForTargets(const TSharedRef<SWindow>& ParentWindow, const TArray<ULocalizationTarget*>& Targets, const TOptional<FString> DirectoryPath)
|
|
{
|
|
TArray<LocalizationCommandletExecution::FTask> Tasks;
|
|
|
|
for (ULocalizationTarget* Target : Targets)
|
|
{
|
|
const bool ShouldUseProjectFile = !Target->IsMemberOfEngineTargetSet();
|
|
|
|
FFormatNamedArguments Arguments;
|
|
Arguments.Add(TEXT("TargetName"), FText::FromString(Target->Settings.Name));
|
|
|
|
const FText ImportTaskName = FText::Format(LOCTEXT("ImportTaskNameFormat", "Import Translations for {TargetName}"), Arguments);
|
|
const FString ImportScriptPath = LocalizationConfigurationScript::GetImportTextConfigPath(Target, TOptional<FString>());
|
|
const TOptional<FString> DirectoryPathForTarget = DirectoryPath.IsSet() ? DirectoryPath.GetValue() / Target->Settings.Name : TOptional<FString>();
|
|
LocalizationConfigurationScript::GenerateImportTextConfigFile(Target, TOptional<FString>(), DirectoryPathForTarget).WriteWithSCC(ImportScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(ImportTaskName, ImportScriptPath, ShouldUseProjectFile));
|
|
|
|
const FText ReportTaskName = FText::Format(LOCTEXT("ReportTaskNameFormat", "Generate Reports for {TargetName}"), Arguments);
|
|
const FString ReportScriptPath = LocalizationConfigurationScript::GetWordCountReportConfigPath(Target);
|
|
LocalizationConfigurationScript::GenerateWordCountReportConfigFile(Target).WriteWithSCC(ReportScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(ReportTaskName, ReportScriptPath, ShouldUseProjectFile));
|
|
}
|
|
|
|
return LocalizationCommandletExecution::Execute(ParentWindow, LOCTEXT("ImportForAllTargetsWindowTitle", "Import Translations for All Targets"), Tasks);
|
|
}
|
|
|
|
bool LocalizationCommandletTasks::ImportTextForTarget(const TSharedRef<SWindow>& ParentWindow, ULocalizationTarget* const Target, const TOptional<FString> DirectoryPath)
|
|
{
|
|
TArray<LocalizationCommandletExecution::FTask> Tasks;
|
|
const bool ShouldUseProjectFile = !Target->IsMemberOfEngineTargetSet();
|
|
|
|
const FString ImportScriptPath = LocalizationConfigurationScript::GetImportTextConfigPath(Target, TOptional<FString>());
|
|
LocalizationConfigurationScript::GenerateImportTextConfigFile(Target, TOptional<FString>(), DirectoryPath).WriteWithSCC(ImportScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(LOCTEXT("ImportTaskName", "Import Translations"), ImportScriptPath, ShouldUseProjectFile));
|
|
|
|
const FString ReportScriptPath = LocalizationConfigurationScript::GetWordCountReportConfigPath(Target);
|
|
LocalizationConfigurationScript::GenerateWordCountReportConfigFile(Target).WriteWithSCC(ReportScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(LOCTEXT("ReportTaskName", "Generate Reports"), ReportScriptPath, ShouldUseProjectFile));
|
|
|
|
FFormatNamedArguments Arguments;
|
|
Arguments.Add(TEXT("TargetName"), FText::FromString(Target->Settings.Name));
|
|
|
|
const FText WindowTitle = FText::Format(LOCTEXT("ImportForTargetWindowTitle", "Import Translations for Target {TargetName}"), Arguments);
|
|
return LocalizationCommandletExecution::Execute(ParentWindow, WindowTitle, Tasks);
|
|
}
|
|
|
|
bool LocalizationCommandletTasks::ImportTextForCulture(const TSharedRef<SWindow>& ParentWindow, ULocalizationTarget* const Target, const FString& CultureName, const TOptional<FString> FilePath)
|
|
{
|
|
FCulturePtr Culture = FInternationalization::Get().GetCulture(CultureName);
|
|
if (!Culture.IsValid())
|
|
{
|
|
return false;
|
|
}
|
|
|
|
TArray<LocalizationCommandletExecution::FTask> Tasks;
|
|
const bool ShouldUseProjectFile = !Target->IsMemberOfEngineTargetSet();
|
|
|
|
const FString DefaultImportScriptPath = LocalizationConfigurationScript::GetImportTextConfigPath(Target, TOptional<FString>(CultureName));
|
|
const FString ImportScriptPath = FPaths::CreateTempFilename(*FPaths::GetPath(DefaultImportScriptPath), *FPaths::GetBaseFilename(DefaultImportScriptPath), *FPaths::GetExtension(DefaultImportScriptPath, true));
|
|
LocalizationConfigurationScript::GenerateImportTextConfigFile(Target, TOptional<FString>(CultureName), FilePath).Write(ImportScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(LOCTEXT("ImportTaskName", "Import Translations"), ImportScriptPath, ShouldUseProjectFile));
|
|
|
|
const FString ReportScriptPath = LocalizationConfigurationScript::GetWordCountReportConfigPath(Target);
|
|
LocalizationConfigurationScript::GenerateWordCountReportConfigFile(Target).Write(ReportScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(LOCTEXT("ReportTaskName", "Generate Reports"), ReportScriptPath, ShouldUseProjectFile));
|
|
|
|
FFormatNamedArguments Arguments;
|
|
Arguments.Add(TEXT("CultureName"), FText::FromString(Culture->GetDisplayName()));
|
|
Arguments.Add(TEXT("TargetName"), FText::FromString(Target->Settings.Name));
|
|
|
|
const FText WindowTitle = FText::Format(LOCTEXT("ImportCultureForTargetWindowTitle", "Import {CultureName} Translations for Target {TargetName}"), Arguments);
|
|
|
|
bool HasSucceeeded = LocalizationCommandletExecution::Execute(ParentWindow, WindowTitle, Tasks);
|
|
IFileManager::Get().Delete(*ImportScriptPath); // Don't clutter up the loc config directory with scripts for individual cultures.
|
|
return HasSucceeeded;
|
|
}
|
|
|
|
bool LocalizationCommandletTasks::ExportTextForTargets(const TSharedRef<SWindow>& ParentWindow, const TArray<ULocalizationTarget*>& Targets, const TOptional<FString> DirectoryPath)
|
|
{
|
|
TArray<LocalizationCommandletExecution::FTask> Tasks;
|
|
|
|
for (ULocalizationTarget* Target : Targets)
|
|
{
|
|
const bool ShouldUseProjectFile = !Target->IsMemberOfEngineTargetSet();
|
|
|
|
FFormatNamedArguments Arguments;
|
|
Arguments.Add(TEXT("TargetName"), FText::FromString(Target->Settings.Name));
|
|
|
|
const FText ExportTaskName = FText::Format(LOCTEXT("ExportTaskNameFormat", "Export Translations for {TargetName}"), Arguments);
|
|
const FString ExportScriptPath = LocalizationConfigurationScript::GetExportTextConfigPath(Target, TOptional<FString>());
|
|
const TOptional<FString> DirectoryPathForTarget = DirectoryPath.IsSet() ? DirectoryPath.GetValue() / Target->Settings.Name : TOptional<FString>();
|
|
LocalizationConfigurationScript::GenerateExportTextConfigFile(Target, TOptional<FString>(), DirectoryPathForTarget).WriteWithSCC(ExportScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(ExportTaskName, ExportScriptPath, ShouldUseProjectFile));
|
|
}
|
|
|
|
return LocalizationCommandletExecution::Execute(ParentWindow, LOCTEXT("ExportForAllTargetsWindowTitle", "Export Translations for All Targets"), Tasks);
|
|
}
|
|
|
|
bool LocalizationCommandletTasks::ExportTextForTarget(const TSharedRef<SWindow>& ParentWindow, ULocalizationTarget* const Target, const TOptional<FString> DirectoryPath)
|
|
{
|
|
TArray<LocalizationCommandletExecution::FTask> Tasks;
|
|
const bool ShouldUseProjectFile = !Target->IsMemberOfEngineTargetSet();
|
|
|
|
const FString ExportScriptPath = LocalizationConfigurationScript::GetExportTextConfigPath(Target, TOptional<FString>());
|
|
LocalizationConfigurationScript::GenerateExportTextConfigFile(Target, TOptional<FString>(), DirectoryPath).WriteWithSCC(ExportScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(LOCTEXT("ExportTaskName", "Export Translations"), ExportScriptPath, ShouldUseProjectFile));
|
|
|
|
FFormatNamedArguments Arguments;
|
|
Arguments.Add(TEXT("TargetName"), FText::FromString(Target->Settings.Name));
|
|
|
|
const FText WindowTitle = FText::Format(LOCTEXT("ExportForTargetWindowTitle", "Export Translations for Target {TargetName}"), Arguments);
|
|
return LocalizationCommandletExecution::Execute(ParentWindow, WindowTitle, Tasks);
|
|
}
|
|
|
|
bool LocalizationCommandletTasks::ExportTextForCulture(const TSharedRef<SWindow>& ParentWindow, ULocalizationTarget* const Target, const FString& CultureName, const TOptional<FString> FilePath)
|
|
{
|
|
FCulturePtr Culture = FInternationalization::Get().GetCulture(CultureName);
|
|
if (!Culture.IsValid())
|
|
{
|
|
return false;
|
|
}
|
|
|
|
TArray<LocalizationCommandletExecution::FTask> Tasks;
|
|
const bool ShouldUseProjectFile = !Target->IsMemberOfEngineTargetSet();
|
|
|
|
const FString DefaultExportScriptPath = LocalizationConfigurationScript::GetExportTextConfigPath(Target, TOptional<FString>(CultureName));
|
|
const FString ExportScriptPath = FPaths::CreateTempFilename(*FPaths::GetPath(DefaultExportScriptPath), *FPaths::GetBaseFilename(DefaultExportScriptPath), *FPaths::GetExtension(DefaultExportScriptPath, true));
|
|
LocalizationConfigurationScript::GenerateExportTextConfigFile(Target, TOptional<FString>(CultureName), FilePath).Write(ExportScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(LOCTEXT("ExportTaskName", "Export Translations"), ExportScriptPath, ShouldUseProjectFile));
|
|
|
|
FFormatNamedArguments Arguments;
|
|
Arguments.Add(TEXT("CultureName"), FText::FromString(Culture->GetDisplayName()));
|
|
Arguments.Add(TEXT("TargetName"), FText::FromString(Target->Settings.Name));
|
|
|
|
const FText WindowTitle = FText::Format(LOCTEXT("ExportCultureForTargetWindowTitle", "Export {CultureName} Translations for Target {TargetName}"), Arguments);
|
|
|
|
bool HasSucceeeded = LocalizationCommandletExecution::Execute(ParentWindow, WindowTitle, Tasks);
|
|
IFileManager::Get().Delete(*ExportScriptPath); // Don't clutter up the loc config directory with scripts for individual cultures.
|
|
return HasSucceeeded;
|
|
}
|
|
|
|
bool LocalizationCommandletTasks::ImportDialogueScriptForTargets(const TSharedRef<SWindow>& ParentWindow, const TArray<ULocalizationTarget*>& Targets, const TOptional<FString> DirectoryPath)
|
|
{
|
|
TArray<LocalizationCommandletExecution::FTask> Tasks;
|
|
|
|
for (ULocalizationTarget* Target : Targets)
|
|
{
|
|
const bool ShouldUseProjectFile = !Target->IsMemberOfEngineTargetSet();
|
|
|
|
FFormatNamedArguments Arguments;
|
|
Arguments.Add(TEXT("TargetName"), FText::FromString(Target->Settings.Name));
|
|
|
|
const FText ImportTaskName = FText::Format(LOCTEXT("ImportDialogueScriptsTaskNameFormat", "Import Dialogue Scripts for {TargetName}"), Arguments);
|
|
const FString ImportScriptPath = LocalizationConfigurationScript::GetImportDialogueScriptConfigPath(Target, TOptional<FString>());
|
|
const TOptional<FString> DirectoryPathForTarget = DirectoryPath.IsSet() ? DirectoryPath.GetValue() / Target->Settings.Name : TOptional<FString>();
|
|
LocalizationConfigurationScript::GenerateImportDialogueScriptConfigFile(Target, TOptional<FString>(), DirectoryPathForTarget).WriteWithSCC(ImportScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(ImportTaskName, ImportScriptPath, ShouldUseProjectFile));
|
|
|
|
const FText ReportTaskName = FText::Format(LOCTEXT("ReportTaskNameFormat", "Generate Reports for {TargetName}"), Arguments);
|
|
const FString ReportScriptPath = LocalizationConfigurationScript::GetWordCountReportConfigPath(Target);
|
|
LocalizationConfigurationScript::GenerateWordCountReportConfigFile(Target).WriteWithSCC(ReportScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(ReportTaskName, ReportScriptPath, ShouldUseProjectFile));
|
|
}
|
|
|
|
return LocalizationCommandletExecution::Execute(ParentWindow, LOCTEXT("ImportDialogueScriptsForAllTargetsWindowTitle", "Import Dialogue Scripts for All Targets"), Tasks);
|
|
}
|
|
|
|
bool LocalizationCommandletTasks::ImportDialogueScriptForTarget(const TSharedRef<SWindow>& ParentWindow, ULocalizationTarget* const Target, const TOptional<FString> DirectoryPath)
|
|
{
|
|
TArray<LocalizationCommandletExecution::FTask> Tasks;
|
|
const bool ShouldUseProjectFile = !Target->IsMemberOfEngineTargetSet();
|
|
|
|
const FString ImportScriptPath = LocalizationConfigurationScript::GetImportDialogueScriptConfigPath(Target, TOptional<FString>());
|
|
LocalizationConfigurationScript::GenerateImportDialogueScriptConfigFile(Target, TOptional<FString>(), DirectoryPath).WriteWithSCC(ImportScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(LOCTEXT("ImportDialogueScriptsTaskName", "Import Dialogue Scripts"), ImportScriptPath, ShouldUseProjectFile));
|
|
|
|
const FString ReportScriptPath = LocalizationConfigurationScript::GetWordCountReportConfigPath(Target);
|
|
LocalizationConfigurationScript::GenerateWordCountReportConfigFile(Target).WriteWithSCC(ReportScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(LOCTEXT("ReportTaskName", "Generate Reports"), ReportScriptPath, ShouldUseProjectFile));
|
|
|
|
FFormatNamedArguments Arguments;
|
|
Arguments.Add(TEXT("TargetName"), FText::FromString(Target->Settings.Name));
|
|
|
|
const FText WindowTitle = FText::Format(LOCTEXT("ImportDialogueScriptsForTargetWindowTitle", "Import Dialogue Scripts for Target {TargetName}"), Arguments);
|
|
return LocalizationCommandletExecution::Execute(ParentWindow, WindowTitle, Tasks);
|
|
}
|
|
|
|
bool LocalizationCommandletTasks::ImportDialogueScriptForCulture(const TSharedRef<SWindow>& ParentWindow, ULocalizationTarget* const Target, const FString& CultureName, const TOptional<FString> FilePath)
|
|
{
|
|
FCulturePtr Culture = FInternationalization::Get().GetCulture(CultureName);
|
|
if (!Culture.IsValid())
|
|
{
|
|
return false;
|
|
}
|
|
|
|
TArray<LocalizationCommandletExecution::FTask> Tasks;
|
|
const bool ShouldUseProjectFile = !Target->IsMemberOfEngineTargetSet();
|
|
|
|
const FString DefaultImportScriptPath = LocalizationConfigurationScript::GetImportDialogueScriptConfigPath(Target, TOptional<FString>(CultureName));
|
|
const FString ImportScriptPath = FPaths::CreateTempFilename(*FPaths::GetPath(DefaultImportScriptPath), *FPaths::GetBaseFilename(DefaultImportScriptPath), *FPaths::GetExtension(DefaultImportScriptPath, true));
|
|
LocalizationConfigurationScript::GenerateImportDialogueScriptConfigFile(Target, TOptional<FString>(CultureName), FilePath).Write(ImportScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(LOCTEXT("ImportDialogueScriptsTaskName", "Import Dialogue Scripts"), ImportScriptPath, ShouldUseProjectFile));
|
|
|
|
const FString ReportScriptPath = LocalizationConfigurationScript::GetWordCountReportConfigPath(Target);
|
|
LocalizationConfigurationScript::GenerateWordCountReportConfigFile(Target).Write(ReportScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(LOCTEXT("ReportTaskName", "Generate Reports"), ReportScriptPath, ShouldUseProjectFile));
|
|
|
|
FFormatNamedArguments Arguments;
|
|
Arguments.Add(TEXT("CultureName"), FText::FromString(Culture->GetDisplayName()));
|
|
Arguments.Add(TEXT("TargetName"), FText::FromString(Target->Settings.Name));
|
|
|
|
const FText WindowTitle = FText::Format(LOCTEXT("ImportDialogueScriptsForCultureForTargetWindowTitle", "Import {CultureName} Dialogue Scripts for Target {TargetName}"), Arguments);
|
|
|
|
bool HasSucceeeded = LocalizationCommandletExecution::Execute(ParentWindow, WindowTitle, Tasks);
|
|
IFileManager::Get().Delete(*ImportScriptPath); // Don't clutter up the loc config directory with scripts for individual cultures.
|
|
return HasSucceeeded;
|
|
}
|
|
|
|
bool LocalizationCommandletTasks::ExportDialogueScriptForTargets(const TSharedRef<SWindow>& ParentWindow, const TArray<ULocalizationTarget*>& Targets, const TOptional<FString> DirectoryPath)
|
|
{
|
|
TArray<LocalizationCommandletExecution::FTask> Tasks;
|
|
|
|
for (ULocalizationTarget* Target : Targets)
|
|
{
|
|
const bool ShouldUseProjectFile = !Target->IsMemberOfEngineTargetSet();
|
|
|
|
FFormatNamedArguments Arguments;
|
|
Arguments.Add(TEXT("TargetName"), FText::FromString(Target->Settings.Name));
|
|
|
|
const FText ExportTaskName = FText::Format(LOCTEXT("ExportDialogueScriptsTaskNameFormat", "Export Dialogue Scripts for {TargetName}"), Arguments);
|
|
const FString ExportScriptPath = LocalizationConfigurationScript::GetExportDialogueScriptConfigPath(Target, TOptional<FString>());
|
|
const TOptional<FString> DirectoryPathForTarget = DirectoryPath.IsSet() ? DirectoryPath.GetValue() / Target->Settings.Name : TOptional<FString>();
|
|
LocalizationConfigurationScript::GenerateExportDialogueScriptConfigFile(Target, TOptional<FString>(), DirectoryPathForTarget).WriteWithSCC(ExportScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(ExportTaskName, ExportScriptPath, ShouldUseProjectFile));
|
|
}
|
|
|
|
return LocalizationCommandletExecution::Execute(ParentWindow, LOCTEXT("ExportDialogueScriptsForAllTargetsWindowTitle", "Export Dialogue Scripts for All Targets"), Tasks);
|
|
}
|
|
|
|
bool LocalizationCommandletTasks::ExportDialogueScriptForTarget(const TSharedRef<SWindow>& ParentWindow, ULocalizationTarget* const Target, const TOptional<FString> DirectoryPath)
|
|
{
|
|
TArray<LocalizationCommandletExecution::FTask> Tasks;
|
|
const bool ShouldUseProjectFile = !Target->IsMemberOfEngineTargetSet();
|
|
|
|
const FString ExportScriptPath = LocalizationConfigurationScript::GetExportDialogueScriptConfigPath(Target, TOptional<FString>());
|
|
LocalizationConfigurationScript::GenerateExportDialogueScriptConfigFile(Target, TOptional<FString>(), DirectoryPath).WriteWithSCC(ExportScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(LOCTEXT("ExportDialogueScriptsTaskName", "Export Dialogue Scripts"), ExportScriptPath, ShouldUseProjectFile));
|
|
|
|
FFormatNamedArguments Arguments;
|
|
Arguments.Add(TEXT("TargetName"), FText::FromString(Target->Settings.Name));
|
|
|
|
const FText WindowTitle = FText::Format(LOCTEXT("ExportDialogueScriptsForTargetWindowTitle", "Export Dialogue Scripts for Target {TargetName}"), Arguments);
|
|
return LocalizationCommandletExecution::Execute(ParentWindow, WindowTitle, Tasks);
|
|
}
|
|
|
|
bool LocalizationCommandletTasks::ExportDialogueScriptForCulture(const TSharedRef<SWindow>& ParentWindow, ULocalizationTarget* const Target, const FString& CultureName, const TOptional<FString> FilePath)
|
|
{
|
|
FCulturePtr Culture = FInternationalization::Get().GetCulture(CultureName);
|
|
if (!Culture.IsValid())
|
|
{
|
|
return false;
|
|
}
|
|
|
|
TArray<LocalizationCommandletExecution::FTask> Tasks;
|
|
const bool ShouldUseProjectFile = !Target->IsMemberOfEngineTargetSet();
|
|
|
|
const FString DefaultExportScriptPath = LocalizationConfigurationScript::GetExportDialogueScriptConfigPath(Target, TOptional<FString>(CultureName));
|
|
const FString ExportScriptPath = FPaths::CreateTempFilename(*FPaths::GetPath(DefaultExportScriptPath), *FPaths::GetBaseFilename(DefaultExportScriptPath), *FPaths::GetExtension(DefaultExportScriptPath, true));
|
|
LocalizationConfigurationScript::GenerateExportDialogueScriptConfigFile(Target, TOptional<FString>(CultureName), FilePath).Write(ExportScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(LOCTEXT("ExportDialogueScriptsTaskName", "Export Dialogue Scripts"), ExportScriptPath, ShouldUseProjectFile));
|
|
|
|
FFormatNamedArguments Arguments;
|
|
Arguments.Add(TEXT("CultureName"), FText::FromString(Culture->GetDisplayName()));
|
|
Arguments.Add(TEXT("TargetName"), FText::FromString(Target->Settings.Name));
|
|
|
|
const FText WindowTitle = FText::Format(LOCTEXT("ExportDialogueScriptsForCultureForTargetWindowTitle", "Export {CultureName} Dialogue Scripts for Target {TargetName}"), Arguments);
|
|
|
|
bool HasSucceeeded = LocalizationCommandletExecution::Execute(ParentWindow, WindowTitle, Tasks);
|
|
IFileManager::Get().Delete(*ExportScriptPath); // Don't clutter up the loc config directory with scripts for individual cultures.
|
|
return HasSucceeeded;
|
|
}
|
|
|
|
bool LocalizationCommandletTasks::ImportDialogueForTargets(const TSharedRef<SWindow>& ParentWindow, const TArray<ULocalizationTarget*>& Targets)
|
|
{
|
|
TArray<LocalizationCommandletExecution::FTask> Tasks;
|
|
|
|
for (ULocalizationTarget* Target : Targets)
|
|
{
|
|
const bool ShouldUseProjectFile = !Target->IsMemberOfEngineTargetSet();
|
|
|
|
FFormatNamedArguments Arguments;
|
|
Arguments.Add(TEXT("TargetName"), FText::FromString(Target->Settings.Name));
|
|
|
|
const FText ImportDialogueTaskName = FText::Format(LOCTEXT("ImportDialogueTaskNameFormat", "Import Dialogue for {TargetName}"), Arguments);
|
|
const FString ImportDialogueScriptPath = LocalizationConfigurationScript::GetImportDialogueConfigPath(Target);
|
|
LocalizationConfigurationScript::GenerateImportDialogueConfigFile(Target).WriteWithSCC(ImportDialogueScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(ImportDialogueTaskName, ImportDialogueScriptPath, ShouldUseProjectFile));
|
|
}
|
|
|
|
return LocalizationCommandletExecution::Execute(ParentWindow, LOCTEXT("ImportDialogueForAllTargetsWindowTitle", "Import Dialogue for All Targets"), Tasks);
|
|
}
|
|
|
|
bool LocalizationCommandletTasks::ImportDialogueForTarget(const TSharedRef<SWindow>& ParentWindow, ULocalizationTarget* const Target)
|
|
{
|
|
TArray<LocalizationCommandletExecution::FTask> Tasks;
|
|
const bool ShouldUseProjectFile = !Target->IsMemberOfEngineTargetSet();
|
|
|
|
const FString ImportDialogueScriptPath = LocalizationConfigurationScript::GetImportDialogueConfigPath(Target);
|
|
LocalizationConfigurationScript::GenerateImportDialogueConfigFile(Target).WriteWithSCC(ImportDialogueScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(LOCTEXT("ImportDialogueTaskName", "Import Dialogue"), ImportDialogueScriptPath, ShouldUseProjectFile));
|
|
|
|
FFormatNamedArguments Arguments;
|
|
Arguments.Add(TEXT("TargetName"), FText::FromString(Target->Settings.Name));
|
|
|
|
const FText WindowTitle = FText::Format(LOCTEXT("ImportDialogueForTargetWindowTitle", "Import Dialogue for Target {TargetName}"), Arguments);
|
|
return LocalizationCommandletExecution::Execute(ParentWindow, WindowTitle, Tasks);
|
|
}
|
|
|
|
bool LocalizationCommandletTasks::ImportDialogueForCulture(const TSharedRef<SWindow>& ParentWindow, ULocalizationTarget* const Target, const FString& CultureName)
|
|
{
|
|
FCulturePtr Culture = FInternationalization::Get().GetCulture(CultureName);
|
|
if (!Culture.IsValid())
|
|
{
|
|
return false;
|
|
}
|
|
|
|
TArray<LocalizationCommandletExecution::FTask> Tasks;
|
|
const bool ShouldUseProjectFile = !Target->IsMemberOfEngineTargetSet();
|
|
|
|
const FString DefaultImportDialogueScriptPath = LocalizationConfigurationScript::GetImportDialogueConfigPath(Target, TOptional<FString>(CultureName));
|
|
const FString ImportDialogueScriptPath = FPaths::CreateTempFilename(*FPaths::GetPath(DefaultImportDialogueScriptPath), *FPaths::GetBaseFilename(DefaultImportDialogueScriptPath), *FPaths::GetExtension(DefaultImportDialogueScriptPath, true));
|
|
LocalizationConfigurationScript::GenerateImportDialogueConfigFile(Target, TOptional<FString>(CultureName)).Write(ImportDialogueScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(LOCTEXT("ImportDialogueTaskName", "Import Dialogue"), ImportDialogueScriptPath, ShouldUseProjectFile));
|
|
|
|
FFormatNamedArguments Arguments;
|
|
Arguments.Add(TEXT("CultureName"), FText::FromString(Culture->GetDisplayName()));
|
|
Arguments.Add(TEXT("TargetName"), FText::FromString(Target->Settings.Name));
|
|
|
|
const FText WindowTitle = FText::Format(LOCTEXT("ImportCultureDialogueForTargetWindowTitle", "Import {CultureName} Dialogue for Target {TargetName}"), Arguments);
|
|
|
|
bool HasSucceeeded = LocalizationCommandletExecution::Execute(ParentWindow, WindowTitle, Tasks);
|
|
IFileManager::Get().Delete(*ImportDialogueScriptPath); // Don't clutter up the loc config directory with scripts for individual cultures.
|
|
return HasSucceeeded;
|
|
}
|
|
|
|
bool LocalizationCommandletTasks::GenerateWordCountReportsForTargets(const TSharedRef<SWindow>& ParentWindow, const TArray<ULocalizationTarget*>& Targets)
|
|
{
|
|
TArray<LocalizationCommandletExecution::FTask> Tasks;
|
|
|
|
for (ULocalizationTarget* Target : Targets)
|
|
{
|
|
const bool ShouldUseProjectFile = !Target->IsMemberOfEngineTargetSet();
|
|
|
|
FFormatNamedArguments Arguments;
|
|
Arguments.Add(TEXT("TargetName"), FText::FromString(Target->Settings.Name));
|
|
|
|
const FText ReportTaskName = FText::Format(LOCTEXT("WordCountReportTaskNameFormat", "Generate Word Count Report for {TargetName}"), Arguments);
|
|
const FString ReportScriptPath = LocalizationConfigurationScript::GetWordCountReportConfigPath(Target);
|
|
LocalizationConfigurationScript::GenerateWordCountReportConfigFile(Target).WriteWithSCC(ReportScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(ReportTaskName, ReportScriptPath, ShouldUseProjectFile));
|
|
}
|
|
|
|
return LocalizationCommandletExecution::Execute(ParentWindow, LOCTEXT("GenerateReportsForAllTargetsWindowTitle", "Generate Word Count Reports for All Targets"), Tasks);
|
|
}
|
|
|
|
bool LocalizationCommandletTasks::GenerateWordCountReportForTarget(const TSharedRef<SWindow>& ParentWindow, ULocalizationTarget* const Target)
|
|
{
|
|
TArray<LocalizationCommandletExecution::FTask> Tasks;
|
|
const bool ShouldUseProjectFile = !Target->IsMemberOfEngineTargetSet();
|
|
|
|
const FString ReportScriptPath = LocalizationConfigurationScript::GetWordCountReportConfigPath(Target);
|
|
LocalizationConfigurationScript::GenerateWordCountReportConfigFile(Target).WriteWithSCC(ReportScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(LOCTEXT("WordCountReportTaskName_NoTarget", "Generate Word Count Report"), ReportScriptPath, ShouldUseProjectFile));
|
|
|
|
FFormatNamedArguments Arguments;
|
|
Arguments.Add(TEXT("TargetName"), FText::FromString(Target->Settings.Name));
|
|
|
|
const FText WindowTitle = FText::Format(LOCTEXT("GenerateReportForTargetWindowTitle", "Generate Word Count Report for Target {TargetName}"), Arguments);
|
|
return LocalizationCommandletExecution::Execute(ParentWindow, WindowTitle, Tasks);
|
|
}
|
|
|
|
bool LocalizationCommandletTasks::CompileTextForTargets(const TSharedRef<SWindow>& ParentWindow, const TArray<ULocalizationTarget*>& Targets)
|
|
{
|
|
TArray<LocalizationCommandletExecution::FTask> Tasks;
|
|
|
|
for (ULocalizationTarget* Target : Targets)
|
|
{
|
|
const bool ShouldUseProjectFile = !Target->IsMemberOfEngineTargetSet();
|
|
|
|
FFormatNamedArguments Arguments;
|
|
Arguments.Add(TEXT("TargetName"), FText::FromString(Target->Settings.Name));
|
|
|
|
const FText CompileTaskName = FText::Format(LOCTEXT("CompileTaskNameFormat", "Compile Translations for {TargetName}"), Arguments);
|
|
const FString CompileScriptPath = LocalizationConfigurationScript::GetCompileTextConfigPath(Target);
|
|
LocalizationConfigurationScript::GenerateCompileTextConfigFile(Target).WriteWithSCC(CompileScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(CompileTaskName, CompileScriptPath, ShouldUseProjectFile));
|
|
}
|
|
|
|
return LocalizationCommandletExecution::Execute(ParentWindow, LOCTEXT("GenerateLocResForAllTargetsWindowTitle", "Compile Translations for All Targets"), Tasks);
|
|
}
|
|
|
|
bool LocalizationCommandletTasks::CompileTextForTarget(const TSharedRef<SWindow>& ParentWindow, ULocalizationTarget* const Target)
|
|
{
|
|
TArray<LocalizationCommandletExecution::FTask> Tasks;
|
|
const bool ShouldUseProjectFile = !Target->IsMemberOfEngineTargetSet();
|
|
|
|
const FString CompileScriptPath = LocalizationConfigurationScript::GetCompileTextConfigPath(Target);
|
|
LocalizationConfigurationScript::GenerateCompileTextConfigFile(Target).WriteWithSCC(CompileScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(LOCTEXT("CompileTaskName", "Compile Translations"), CompileScriptPath, ShouldUseProjectFile));
|
|
|
|
FFormatNamedArguments Arguments;
|
|
Arguments.Add(TEXT("TargetName"), FText::FromString(Target->Settings.Name));
|
|
|
|
const FText WindowTitle = FText::Format(LOCTEXT("GenerateLocResForTargetWindowTitle", "Compile Translations for Target {TargetName}"), Arguments);
|
|
return LocalizationCommandletExecution::Execute(ParentWindow, WindowTitle, Tasks);
|
|
}
|
|
|
|
bool LocalizationCommandletTasks::CompileTextForCulture(const TSharedRef<SWindow>& ParentWindow, ULocalizationTarget* const Target, const FString& CultureName)
|
|
{
|
|
FCulturePtr Culture = FInternationalization::Get().GetCulture(CultureName);
|
|
if (!Culture.IsValid())
|
|
{
|
|
return false;
|
|
}
|
|
|
|
TArray<LocalizationCommandletExecution::FTask> Tasks;
|
|
const bool ShouldUseProjectFile = !Target->IsMemberOfEngineTargetSet();
|
|
|
|
const FString DefaultCompileScriptPath = LocalizationConfigurationScript::GetCompileTextConfigPath(Target, TOptional<FString>(CultureName));
|
|
const FString CompileScriptPath = FPaths::CreateTempFilename(*FPaths::GetPath(DefaultCompileScriptPath), *FPaths::GetBaseFilename(DefaultCompileScriptPath), *FPaths::GetExtension(DefaultCompileScriptPath, true));
|
|
LocalizationConfigurationScript::GenerateCompileTextConfigFile(Target, TOptional<FString>(CultureName)).Write(CompileScriptPath);
|
|
Tasks.Add(LocalizationCommandletExecution::FTask(LOCTEXT("CompileTaskName", "Compile Translations"), CompileScriptPath, ShouldUseProjectFile));
|
|
|
|
FFormatNamedArguments Arguments;
|
|
Arguments.Add(TEXT("CultureName"), FText::FromString(Culture->GetDisplayName()));
|
|
Arguments.Add(TEXT("TargetName"), FText::FromString(Target->Settings.Name));
|
|
|
|
const FText WindowTitle = FText::Format(LOCTEXT("CompileCultureForTargetWindowTitle", "Compile {CultureName} Translations for Target {TargetName}"), Arguments);
|
|
|
|
bool HasSucceeeded = LocalizationCommandletExecution::Execute(ParentWindow, WindowTitle, Tasks);
|
|
IFileManager::Get().Delete(*CompileScriptPath); // Don't clutter up the loc config directory with scripts for individual cultures.
|
|
return HasSucceeeded;
|
|
}
|
|
|
|
bool LocalizationCommandletTasks::ReportLoadedAudioAssets(const TArray<ULocalizationTarget*>& Targets, const TOptional<FString>& CultureName)
|
|
{
|
|
TSet<FString> LoadedDialogueWaveAssets;
|
|
TSet<FString> LoadedSoundWaveAssets;
|
|
|
|
for (const ULocalizationTarget* Target : Targets)
|
|
{
|
|
const FString RootAssetPath = Target->IsMemberOfEngineTargetSet() ? TEXT("/Engine") : TEXT("/Game");
|
|
|
|
TArray<FString> CulturesToTest;
|
|
{
|
|
if (CultureName.IsSet())
|
|
{
|
|
CulturesToTest.Add(CultureName.GetValue());
|
|
}
|
|
else
|
|
{
|
|
CulturesToTest.Reserve(Target->Settings.SupportedCulturesStatistics.Num());
|
|
for (const FCultureStatistics& CultureData : Target->Settings.SupportedCulturesStatistics)
|
|
{
|
|
CulturesToTest.Add(CultureData.CultureName);
|
|
}
|
|
}
|
|
}
|
|
|
|
TArray<FString> DialogueWavePathsToTest;
|
|
TArray<FString> SoundWavePathsToTest;
|
|
{
|
|
const FString NativeCulture = Target->Settings.SupportedCulturesStatistics.IsValidIndex(Target->Settings.NativeCultureIndex) ? Target->Settings.SupportedCulturesStatistics[Target->Settings.NativeCultureIndex].CultureName : FString();
|
|
const bool bImportNativeAsSource = Target->Settings.ImportDialogueSettings.bImportNativeAsSource && !NativeCulture.IsEmpty();
|
|
if (bImportNativeAsSource)
|
|
{
|
|
DialogueWavePathsToTest.Add(RootAssetPath);
|
|
SoundWavePathsToTest.Add(RootAssetPath / Target->Settings.ImportDialogueSettings.ImportedDialogueFolder);
|
|
}
|
|
|
|
for (const FString& Culture : CulturesToTest)
|
|
{
|
|
if (bImportNativeAsSource && Culture == NativeCulture)
|
|
{
|
|
continue;
|
|
}
|
|
|
|
DialogueWavePathsToTest.Add(RootAssetPath / TEXT("L10N") / Culture);
|
|
SoundWavePathsToTest.Add(RootAssetPath / TEXT("L10N") / Culture / Target->Settings.ImportDialogueSettings.ImportedDialogueFolder);
|
|
}
|
|
}
|
|
|
|
ForEachObjectOfClass(UDialogueWave::StaticClass(), [&](UObject* InObject)
|
|
{
|
|
const FString ObjectPath = InObject->GetPathName();
|
|
|
|
auto FindAssetPathPredicate = [&](const FString& InAssetPath) -> bool
|
|
{
|
|
return ObjectPath.StartsWith(InAssetPath, ESearchCase::IgnoreCase);
|
|
};
|
|
|
|
if (DialogueWavePathsToTest.ContainsByPredicate(FindAssetPathPredicate))
|
|
{
|
|
LoadedDialogueWaveAssets.Add(ObjectPath);
|
|
}
|
|
});
|
|
|
|
ForEachObjectOfClass(USoundWave::StaticClass(), [&](UObject* InObject)
|
|
{
|
|
const FString ObjectPath = InObject->GetPathName();
|
|
|
|
auto FindAssetPathPredicate = [&](const FString& InAssetPath) -> bool
|
|
{
|
|
return ObjectPath.StartsWith(InAssetPath, ESearchCase::IgnoreCase);
|
|
};
|
|
|
|
if (SoundWavePathsToTest.ContainsByPredicate(FindAssetPathPredicate))
|
|
{
|
|
LoadedSoundWaveAssets.Add(ObjectPath);
|
|
}
|
|
});
|
|
}
|
|
|
|
if (LoadedDialogueWaveAssets.Num() > 0 || LoadedSoundWaveAssets.Num() > 0)
|
|
{
|
|
FTextBuilder MsgBuilder;
|
|
MsgBuilder.AppendLine(LOCTEXT("Warning_LoadedAudioAssetsMsg", "The following audio assets have been loaded by the editor and may cause the dialogue import to fail as their files will be read-only."));
|
|
MsgBuilder.AppendLine(FText::GetEmpty());
|
|
MsgBuilder.AppendLine(LOCTEXT("Warning_LoadedAudioAssetsMsg_Continue", "Do you want to continue?"));
|
|
|
|
if (LoadedDialogueWaveAssets.Num() > 0)
|
|
{
|
|
MsgBuilder.AppendLine(FText::GetEmpty());
|
|
MsgBuilder.AppendLine(LOCTEXT("Warning_LoadedAudioAssetsMsg_DialogueWaves", "Dialogue Waves:"));
|
|
|
|
MsgBuilder.Indent();
|
|
for (const FString& LoadedDialogueWaveAsset : LoadedDialogueWaveAssets)
|
|
{
|
|
MsgBuilder.AppendLine(LoadedDialogueWaveAsset);
|
|
}
|
|
MsgBuilder.Unindent();
|
|
}
|
|
|
|
if (LoadedSoundWaveAssets.Num() > 0)
|
|
{
|
|
MsgBuilder.AppendLine(FText::GetEmpty());
|
|
MsgBuilder.AppendLine(LOCTEXT("Warning_LoadedAudioAssetsMsg_SoundWaves", "Sound Waves:"));
|
|
|
|
MsgBuilder.Indent();
|
|
for (const FString& LoadedSoundWaveAsset : LoadedSoundWaveAssets)
|
|
{
|
|
MsgBuilder.AppendLine(LoadedSoundWaveAsset);
|
|
}
|
|
MsgBuilder.Unindent();
|
|
}
|
|
|
|
const FText MsgTitle = LOCTEXT("Warning_LoadedAudioAssetsTitle", "Warning - Loaded Audio Assets");
|
|
return FMessageDialog::Open(EAppMsgType::YesNo, MsgBuilder.ToText(), &MsgTitle) == EAppReturnType::Yes;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
#undef LOCTEXT_NAMESPACE
|