Files
UnrealEngineUWP/Engine/Source/Editor/StaticMeshEditor/Private/StaticMeshEditor.cpp
Ori Cohen 368bd22e6b Copying //UE4/Dev-Framework to //UE4/Dev-Main (Source: //UE4/Dev-Framework @ 3153514)
#lockdown Nick.Penwarden
#rb none

==========================
MAJOR FEATURES + CHANGES
==========================

Change 3050254 on 2016/07/14 by Marc.Audy

	Merging //UE4/Dev-Main to Dev-Framework (//UE4/Dev-Framework) @ 3049614

Change 3136629 on 2016/09/22 by Marc.Audy

	bye bye auto

Change 3136631 on 2016/09/22 by Marc.Audy

	Allow objects to be marked as duplicate transient or non PIE duplicate transient
	ChildActors are not marked consistent with the property that references them as text export transient and non PIE duplicate transient
	#jira UE-35680

Change 3136636 on 2016/09/22 by Marc.Audy

	ParticleSystem and Audio Components now  route Activate/Deactivate events to blueprints
	Component Activate/Deactivate events now provide component as a property
	#jira UE-35191

Change 3136640 on 2016/09/22 by Marc.Audy

	Expose bReplicates to blueprint component properties
	#jira UE-34433

Change 3136709 on 2016/09/22 by Ori.Cohen

	Fix GetBodyInstance returning incorrect bodies when welded kinematics are attached.

	#JIRA UE-36234

Change 3136710 on 2016/09/22 by Ori.Cohen

	Fix defer actors not working when the physics scene is simulating. We now flush when the scene is not simulating, as well as a lazy flush that goes through the slow path when needed. This allows us to batch multiple components together.

	#JIRA UE-35899

Change 3136770 on 2016/09/22 by Marc.Audy

	Fix compile error

Change 3136854 on 2016/09/22 by Marc.Audy

	Sprite components need to be text export transient
	#jira UE-36064

Change 3136926 on 2016/09/22 by Ori.Cohen

	Fix ensure when skeletal mesh bodies have no collision.

Change 3137054 on 2016/09/22 by Aaron.McLeran

	PR #2628: Fix UAudioComponent SubtitlePriority not being initialised (Contributed by alanedwardes)

Change 3137058 on 2016/09/22 by Aaron.McLeran

	PR #2562: ReadCompressedInfo calculates duration for ADPCM audio (Contributed by derekvanvliet)

Change 3137060 on 2016/09/22 by Aaron.McLeran

	UE-36336 Fixing A3D for mono/2D sounds

	- Making it so if A3D is being loaded but not enabled, we can not have reverb on 2D sounds
	- Fixing A3D mono sources from failing after a time

Change 3137066 on 2016/09/22 by Aaron.McLeran

	Checking in Ngs2.Build.cs with A3D and USING_A3D set to 0

Change 3137098 on 2016/09/22 by dan.reynolds

	AEOverview Update: EQ Map, Reverb Map plus improvements on Main array cleanup process.

Change 3137132 on 2016/09/22 by Aaron.McLeran

	PR #2789: Fixed signature of FActiveSound::GetIntParameter (Contributed by Laurie-Hedge)

Change 3137175 on 2016/09/22 by Aaron.McLeran

	Fixing compile error with PhysXCollision.cpp from CL 3136710

Change 3137540 on 2016/09/23 by Thomas.Sarkanen

	Fixed crash when generating LODs automatically for skeletal meshes

	Quadric error reduction does not support skeletal meshes, so fails. Client code assumes that it cannot fail so crashed. This guards against immediatly assuming that LODs are valid after simplification.

	#jira UE-36253 - Crash applying LOD changes in Persona

Change 3137720 on 2016/09/23 by Thomas.Sarkanen

	Changed asset shortcut bar to display asset names & reworked padding

	#jira UE-36347 - Anim asset shortcut bar has difficult to read/cut-off text

Change 3137761 on 2016/09/23 by Martin.Wilson

	Fix typo in root motion from everything accumulation code

Change 3137877 on 2016/09/23 by Thomas.Sarkanen

	Fixed undo/redo forcing skeletal meshes into t-pose

	Re-populated AnimationData in InitAnim for UDebugSkelMeshComponent.

	#jira UE-35579 - If you undo an animation change to any animation asset (for single preview), the playback controls will no longer function

Change 3137885 on 2016/09/23 by Benn.Gallagher

	Fixed APEX clothing disappearing when time dilation results in a dt of 0. After simulating an actor with 0 APEX will fill positions and normals with NaNs, causing the disappearance. The fix in this case is to not schedule the evaluation task if we're not wanting to do any work. The simulation then freezes as we would expect.
	#jira UE-35151

Change 3137888 on 2016/09/23 by Benn.Gallagher

	Fixed transition nodes being able to be pasted or duplicated without 2 valid pin links
	#jira UE-24860

Change 3137889 on 2016/09/23 by Benn.Gallagher

	Fixed transform and widget inconsistencies in IK edit mode
	#jira UE-20628

Change 3137890 on 2016/09/23 by Jurre.deBaare

	Alembic Cached Geometry Does Not Display in Stand Alone Game
	#fix required to force load the GeometryCache module during runtime
	#jira UE-36187

Change 3137892 on 2016/09/23 by Jurre.deBaare

	Geometry cache playback should work in sequencer
	#fix add Interp UProperty tag to specific properties used for playing back the cache, future fix is having same approach as skeletal mesh animation for sequencer (depends on needs, -> skeletal mesh import has better compression anyway)
	#jira UE-35447

Change 3137893 on 2016/09/23 by Jurre.deBaare

	Alembic Cache Importer option for Hard Edge Angle Threshold does not work for objects with no normals
	#fix adhere to the assumed 'standard' no normals in ABC file means completely smooth normals throughout the sequence
	#jira UE-35091

Change 3137894 on 2016/09/23 by Jurre.deBaare

	Importing an Alembic File While mesh Distance Fields are Enabled Crashes Editor
	#fix Needed to save the raw mesh before building the mesh to ensure a LOD resource was created
	#misc added a new check + message in case this occurs again
	#jira UE-36059

Change 3137938 on 2016/09/23 by Jurre.deBaare

	Alembic Importing with Incorrect UV's
	#fix adding option for flipping UVs on import
	#jira UE-36190

	Alembic import axis not aligned correctly
	#fix also added option to specify scale and rotation to be applied during import (with preset for Maya and Max)
	#jira UE-35510

Change 3137949 on 2016/09/23 by Jurre.deBaare

	Frame range importing causes confusion during Alembic importing
	#fix this required storing information per Alembic object at which frame index it actual has stored frames, using this data we can determine which frames are empty, and at which frame there is data. This allows us to skip empty frames if we want to import data-only frames, or to import all frames in the sequence including empty (pre-roll) frames.
	#misc changed settings UI listview layout (extra columns and resized old ones)
	#jira UE-35498

Change 3137994 on 2016/09/23 by Martin.Wilson

	Fix for creating an empty state when dragging a montage into a state machine graph

	#jira UE-33371

Change 3138103 on 2016/09/23 by Aaron.McLeran

	UE-36312 Fixing sound node distance cross fade for case of looping sounds

Change 3138104 on 2016/09/23 by Aaron.McLeran

	UE-35392 Copy pasting local node into separate project crashes the engine

Change 3138224 on 2016/09/23 by Aaron.McLeran

	UE-36312 Fixing sound node distance cross fade for case of looping sounds

	- Adding a check for wave instance count to account for virtualized sounds (one-shots)

Change 3138666 on 2016/09/23 by Ben.Zeigler

	#UEFW-204 Add more comprehensive gameplay tag tests
	Fix issue with HasTag(Tag, IncludeParent, IncludeParent) revealed by tests, this was not returning true correctly in some cases. This use case is weird and will be deprecated soon

Change 3138779 on 2016/09/23 by Marc.Audy

	Get rid of pointless casts

Change 3138782 on 2016/09/23 by Marc.Audy

	remove some GWorlds

Change 3139701 on 2016/09/26 by Jurre.deBaare

	Assert failed on GemetryCache for PS4 package
	#fix add GeometryCache reference in engine build.cs and fix the serialization of geometry cache files
	#jira UE-36392

Change 3139704 on 2016/09/26 by Jurre.deBaare

	Fix for -1 begin frame
	#fix do the max as an signed int, to make sure we don't wrap around

Change 3139748 on 2016/09/26 by Benn.Gallagher

	PR #2784: Make sure that SceneScratchBufferSize is a multiple of 16K as requested by PhysX (Contributed by DenizPiri)

	Moved the definition of the boundary to a FPhysScene class static
	Changed comments on original user settings property to communicate the fact that the value is now rounded to the next 16K boundary

	#jira UE-35736

Change 3139903 on 2016/09/26 by Benn.Gallagher

	Fixed exposing subinstance pins stomping over class defaults and setting to uninitialized values
	#jira UE-34366

Change 3140409 on 2016/09/26 by Lukasz.Furman

	fixed uninitialized configs of gameplay debugger
	copy of CL# 3140399

Change 3140516 on 2016/09/26 by dan.reynolds

	AEOverview Map Update - Ambient Zone + Focus Test

Change 3140526 on 2016/09/26 by Jon.Nabozny

	#rn Fixed CanJump inconsistencies with previous versions.

	Deferred JumpCurrentCount increment until after jump, made bWasJumping a member variable, and updated how
	jump count and hold time were compared in CanJump.

	#jira UE-35524, UE-35582

Change 3140745 on 2016/09/26 by dan.reynolds

	AEOverview Test Map Update + Occlusion Test

Change 3140839 on 2016/09/26 by dan.reynolds

	AEOverview - minor updates

Change 3141101 on 2016/09/27 by Thomas.Sarkanen

	Preview scene worlds now render correctly

	Split "Preview" type into "EditorPreview" (the default) and "GamePreview". Deprecated the old "Preview" world type (but kept its index).
	In-game hidden flags now apply to GamePreview, but not EditorPreview worlds.
	Deprecated old bHack_Force_UsesGameHiddenFlags_True boolean. GamePReview now serves this purpose.
	Fixed up UT cases where this was being used.
	FPreviewScenes now use the editor mode by default, but can be set to non-editor if needed (as is the case with the still-experimental UViewport).
	Custom depth pass is not enabled for EditorPreview (as before) but is for GamePreview.
	Fixed erroneous use of TEnumAsByte for non-uproperty WorldType.

	#jira UE-22883 - Using FPreviewScenes in-game for scene captures

Change 3141106 on 2016/09/27 by Thomas.Sarkanen

	Column toggling improvements

	Column toggle menu now does not close when items are selected.
	This requries some Slate changes to how submenus are built to allow for sumbenus to specify whether they close after selection.
	Also allowed columns to be hidden by default for specific use cases (like the sequence browser).

	#jira UE-35818 - Anim asset browser column picker should stay up

Change 3141131 on 2016/09/27 by Thomas.Sarkanen

	Fix CIS warnings

	Fallout from preview world changes

Change 3141143 on 2016/09/27 by Jurre.deBaare

	Fix for CIS errors

Change 3141235 on 2016/09/27 by Thomas.Sarkanen

	Fix offset of Persona floor mesh when auto-alignment is enabled

	When auto alignment was disabled, the offset wasnt getting taken into account.

	#jira UE-35544 - In Persona, Floor Height Offset does nothing with Auto Align Floor to Mesh disabled

Change 3141327 on 2016/09/27 by Marc.Audy

	Ensure that the client side AttachChildren array remains accurate
	#jira UE-26025

Change 3141474 on 2016/09/27 by mason.seay

	Updating test map name and moving PlayerStart

Change 3141501 on 2016/09/27 by Benn.Gallagher

	Loading time improvements for destructibles from Nvidia
	Updated to use new framework custom version instead of global object version
	Fixed usage of TArray to enable correct loading and saving of the cached data.
	#jira UE-29680

Change 3141889 on 2016/09/27 by Marc.Audy

	Fix DestructibleMesh when WITH_APEX is 0
	#jira UE-36484

Change 3142034 on 2016/09/27 by Marc.Audy

	Merging //UE4/Dev-Main to Dev-Framework (//UE4/Dev-Framework) @ 3141971

Change 3142131 on 2016/09/27 by Ori.Cohen

	Make sure we return eTouch to physx during an overlap query. Fixes bad behavior when multiple objects blocked in an overlap query.

	#JIRA UE-36381

Change 3142154 on 2016/09/27 by Ori.Cohen

	Fix build, ModuleCachedData instead of NxApexModuleCachedData

Change 3142159 on 2016/09/27 by mason.seay

	Blueprint for testing Child Actor Templates

Change 3142255 on 2016/09/27 by Jon.Nabozny

	Fix crashes in QAMeshMerge component by making it a UObject, exposing it's method statically, and taking QASkeletalMeshMergeParams as an argument.

	#jira UE-35199, UE-35197, UE-35201

Change 3142717 on 2016/09/27 by dan.reynolds

	AEOverview Update + Sound Class Test

Change 3142764 on 2016/09/27 by Marc.Audy

	Fix Ocean deprecation warnings

Change 3142962 on 2016/09/28 by Thomas.Sarkanen

	Fixed bounds calculations for local camera animations

	Correctly calculated bounds as local to the initial transform in the track.
	Implemented suggested fixes from UDN user chhaddon (The Coalition).

	#jira UE-29594 - CameraAnim bounds are incorrect when bRelativeToInitialTransform == true

Change 3143007 on 2016/09/28 by Martin.Wilson

	Added virtual bones to USkeleton

	API Breaking change:
	-Added USkeleton pointer to RemoveBonesByName
	-FReferenceSkeleton::UpdateRefPoseTransform & FReferenceSkeleton::Add made private. Must use FReferenceSkeletonModifier instead

	#jira UEFW-81

Change 3143040 on 2016/09/28 by James.Golding

	Strip DrawDebug.. functions from Shipping and Test builds, controlled by new define ENABLE_DRAW_DEBUG
	Fix up game projects to compile in Shipping/Test after this change

	PR #2757: (Contributed by projectgheist)
	#jira UE-35488

Change 3143046 on 2016/09/28 by James.Golding

	Fix OrionEnvironmentPerfTest.cpp compiling in Shipping (optimizations were not being re-enabled at end of file)

Change 3143047 on 2016/09/28 by James.Golding

	PR #2731: Capsule primitive drawing fix (Contributed by kamrann)
	#jira UE-35142

Change 3143050 on 2016/09/28 by Martin.Wilson

	Update DDC key as some animation have stale data

Change 3143088 on 2016/09/28 by Martin.Wilson

	CIS Fixes for Ocean after FReferenceSkeleton changes

Change 3143090 on 2016/09/28 by Benn.Gallagher

	Fixed split pins in animation blueprints losing their pin links on editor restart. The anim nodes had opted out of the Super version of reconstruct, but that's where split pin restoration was added so we were skipping it.
	#jira UE-36482

Change 3143091 on 2016/09/28 by Thomas.Sarkanen

	Fix play/pause keyboard shortcut toggle in Persona based editors

	Correctly handled widget mode switching in the skeleton selection edit mode (previously it was manually handling this rather than hooking into the correct level viewport callbacks).
	Added the ability for FEdModes to specify whether they can use a widget mode.
	Added a common set of commands that all Persona-based editors can opt into (only contains TogglePlay for now).

	#jira UE-35163 - Cannot use Play/Pause shortcut in Persona if viewport is focused

Change 3143100 on 2016/09/28 by James.Golding

	UE-32275  Fix Anim Curve entries losing Auto state when hidden/reshown

Change 3143107 on 2016/09/28 by Martin.Wilson

	Add check to IsRunningParallelEvaluation to verify that the skeletal mesh component in question still references us

	#jira UE-34431

Change 3143125 on 2016/09/28 by Jurre.deBaare

	PR #2749: Fix blend space triangulation (Contributed by tmiv)

Change 3143225 on 2016/09/28 by Jurre.deBaare

	Mesh/material merging basic test files

Change 3143235 on 2016/09/28 by Martin.Wilson

	Fix issue where montage wrong section was updated with changes from details panel when clicking on a new section

	#jira UE-35929

Change 3143312 on 2016/09/28 by Marc.Audy

	Don't globally reregister components, globally recreate render state instead when force deleting assets
	Fixes crash force deleting a blueprint with a child actor component in it from the content browser

Change 3143340 on 2016/09/28 by Mieszko.Zielinski

	Improved consistency of loudness usage in AISense_Hearing #UE4

Change 3143359 on 2016/09/28 by Marc.Audy

	Fix spelling error in comment

Change 3143372 on 2016/09/28 by Jurre.deBaare

	HLOD meshes are causing degenerate triangles
	#fix Setting flag to ignore degenerate triangles when building the meshes vertex/index buffers
	#jira UE-34336

Change 3143420 on 2016/09/28 by Mieszko.Zielinski

	Fix to BlackboardData initialization's dependency on parent asset's initialization #UE4

Change 3143421 on 2016/09/28 by Martin.Wilson

	Allow reading on animation sequence length in blueprints

	#jira UE-34168

Change 3143455 on 2016/09/28 by James.Golding

	Add 'noop' versions of DrawDebug function, so you will not get compile errors by default for calling them in Shipping/Test builds.
	Added optional SHIPPING_DRAW_DEBUG_ERROR define, which will give compile errors in Shipping/Test if still calling DrawDebug functions

Change 3143518 on 2016/09/28 by Jurre.deBaare

	Meshes with no UV Coordinates will break the UVs of other meshes contained in the same HLOD if they share a material
	#fix calculate UV bounds and check whether they occupy any space (if not do not use them for baking out the material)
	#misc set texture sampling for HLOD proxy base material to clamp
	#jira UE-35221

Change 3143542 on 2016/09/28 by James.Golding

	Change SHIPPING_DRAW_DEBUG_ERROR define from ifdef to if
	Fix comment
	Enable by default for FN

Change 3143543 on 2016/09/28 by Benn.Gallagher

	Changed branch + early return into an ensure during FPxQueryFilterCallback::preFilter. We were checking for invalid shapes in preFilter but that shouldn't happen. More likely to get some information as an ensure instead of earlying out on the funciton.

Change 3143556 on 2016/09/28 by Aaron.McLeran

	UE-36540 Editor Preferences 'Enable Sound' option causes Real Time Audio to Stop Working after PIE

Change 3143566 on 2016/09/28 by Benn.Gallagher

	Readded early out alongside new ensure for catching bad preFilter shapes

Change 3143568 on 2016/09/28 by Marc.Audy

	Fix deprecation warnings in UT

Change 3143572 on 2016/09/28 by Jurre.deBaare

	More test content for mesh/material merging

Change 3143581 on 2016/09/28 by Jurre.deBaare

	More content :D

Change 3143585 on 2016/09/28 by Jurre.deBaare

	Geometry cache cleaning
	#misc fix for missing materials, not serialized (facepalm) as they were added later on (required custom version bump)
	#misc cleaning out unecessary code

Change 3143594 on 2016/09/28 by Marc.Audy

	Creating a child actor component by dragging an actor blueprint in to another blueprint now properly creates the template
	#jira UE-36511

Change 3143658 on 2016/09/28 by Marc.Audy

	RootComponent can be null by the time we hit PostUnregisterAllComponents so need to protect against the dereference
	#jira UE-36553

Change 3143776 on 2016/09/28 by Marc.Audy

	Properly reinstance child actor templates when using the fast reinstancing path
	#jira UE-36516

Change 3143896 on 2016/09/28 by Ori.Cohen

	Remove UPROPERTY on aggregate threshold which is always read from the physics settings.

Change 3144022 on 2016/09/28 by Ben.Zeigler

	Move AIMoveTo node from BlueprintGraph to AIGraph and remove BlueprintGraph->AIModule dependency in build system

Change 3144252 on 2016/09/28 by mason.seay

	More blueprints for child actor template testing

Change 3144262 on 2016/09/28 by Mason.Seay

	Deleting assets

Change 3144283 on 2016/09/28 by dan.reynolds

	AEOverview update + Sound Priority Test

Change 3144411 on 2016/09/28 by dan.reynolds

	AEOverview end of day update and tweaks

Change 3144679 on 2016/09/29 by Benn.Gallagher

	Changed skeletal bounds calculation to not consider clothing assets that aren't simulating in the current LOD. In this case we're not rendering the clothing, we're only rendering the skeletal geometry for that section in that LOD which isn't bound to cloth.

Change 3144856 on 2016/09/29 by Jurre.deBaare

	HLOD Outliner scrolls back to the top when generating proxy meshes
	#fix OnLevelActorsAdded was getting called for actors in the thumbnail worlds, which forced a refresh on the listview
	#jira UE-30384

Change 3144864 on 2016/09/29 by Thomas.Sarkanen

	Preview mesh fixes

	Animation preview meshes are now respected (and saved). Mesh is displayed as empty if none is set (but a default is chosen).
	Skeleton preview meshes are now shown as empty if none is set (but a default is chosen).

	#jira UE-36582 - Cannot set preview mesh per-animation

Change 3144865 on 2016/09/29 by Jurre.deBaare

	More test content

Change 3144885 on 2016/09/29 by James.Golding

	UE-35307  Move 'invalid scale' warning to Message Log to be more visible in editor
	Change scale clamping in UpdateBodyScale to catch cases like (1,0,1)

Change 3144903 on 2016/09/29 by Thomas.Sarkanen

	Deprecating StaticMesh in UStaticMeshComponent

	Added GetStaticMesh to access the value as read-only.
	SetStaticMesh is now called in all locations that used to call "StaticMesh =".
	Lots of fixups.

	#jira UE-24859 - Deprecate public access to StaticMesh property in UStaticMeshComponent

Change 3145020 on 2016/09/29 by Thomas.Sarkanen

	Fix bounds calculations that include bones to respect LOD (and other requried bones)

	Sometimes bones would not be updated if we LOD switched, extending the bounds.

	#jira UE-36525 - UDebugSkelMeshComponent::CalcBounds should filter by LOD

Change 3145041 on 2016/09/29 by Jurre.deBaare

	Setting the Target Lightmap UV Channel to an incorrect value leads to inconsistent results
	#fix removed target light map channel, we now determine according to the UV channels which are unused in the final mesh
	#misc ignore the source lightmap uv channels to reduce data
	#jira UE-36595

Change 3145219 on 2016/09/29 by Benn.Gallagher

	Fixed clothing actors not casting shadows in editor, after the material editing change the copy of the shadow flag was missed from the clothing association code, which runs on again on older clothing assets to use the new render data skinning. Also added some fix up for assets that have be saved in the mean time.
	#jira UE-36552

Change 3145222 on 2016/09/29 by Jurre.deBaare

	Exporting Alembic Skeletal mesh from UE4 to FBX causes a crash
	#fix on import set _all_ bone influence to 0
	#jira UE-36602

Change 3145267 on 2016/09/29 by Ori.Cohen

	Move OnConstraintBreak delegate so that it fires outside of fetchResults. Fixes crash from user doing unsafe things during fetchResults.

	#JIRA UE-36483

Change 3145306 on 2016/09/29 by Jon.Nabozny

	Fixed PhAT so multiple constraints can be selected and edited properly at the same time.

	#JIRA: UE-31493

Change 3145342 on 2016/09/29 by Marc.Audy

	Do not update cull distance volumes whenever any property changes
	* Any movement or property change of a cull distance volume still does a global update
	* Any movement of a component belong to any other Actor updates only the components of that Actor
	* Any property change of a primitive component only updates that component
	#jira UE-36399

Change 3145958 on 2016/09/29 by Marc.Audy

	In game worlds don't auto activate components until the actor is ready to process them
	#jira UE-35189

Change 3146110 on 2016/09/29 by dan.reynolds

	AEOverview update + Soundwave Procedural Test Map

Change 3146375 on 2016/09/30 by Benn.Gallagher

	Fixed crash saving newly created destructible mesh after material refactor.
	#jira UE-36619

Change 3146378 on 2016/09/30 by James.Golding

	UE-35908 Line trace against a BodyInstance now returns closest hit for trimesh (was any hit before)
	Also add stat for FBodyInstance::LineTrace

Change 3146379 on 2016/09/30 by James.Golding

	Add test assets for creating procmesh collision in non-editor builds

Change 3146386 on 2016/09/30 by Thomas.Sarkanen

	Fixed ensures (and functionality) of 'show uncompressed animation' option in Persona viewports

	Made sure that PreEvaluateAnimation is called for th einstance in use, rather than only the preview instance.
	This unearthed another issuye where each of the calls to GenSpaceBAses was causing the animation to run faster. Fixed this by resetting the update flag in the update context after it is used.

	#jira UE-36251 - Ensures showing uncompressed animations in anim blueprints

Change 3146464 on 2016/09/30 by Thomas.Sarkanen

	Fix layered blend per bone odd/even connection counts alternately working/not working

	Older hacky fix for multi-property to array copies flip-flipped between using fast path and not, when it really should have disabled fast path after the first array pin. Now it disables fast path based on whether this is a new handler or not, rather than looking at the SimpleCopyPropertyName.

	#jira UE-35648 - Layered Blend Per Bone doesn't work correctly with 3+ inputs

Change 3146652 on 2016/09/30 by Benn.Gallagher

	Fixed subinstance properties appearing in the caller's details panel as oddly named properties.
	#jira UE-34141

Change 3146673 on 2016/09/30 by Martin.Wilson

	Make RawAnimationData (and associated anim sequence data) private

	#jira ue-25869

Change 3146680 on 2016/09/30 by Benn.Gallagher

	Fixed errant asterisks in tooltips for source and target bone on rotation multiplier controller node
	#jira UE-29847

Change 3146681 on 2016/09/30 by Benn.Gallagher

	Fixed incorrect tooltip on left hand IK bone in hand ik retargetting node
	#jira UE-30885

Change 3146711 on 2016/09/30 by Jon.Nabozny

	Fix PhAT SnapConstraintToBone.

	#jira UE-31491

Change 3146717 on 2016/09/30 by Danny.Bouimad

	Adding Jurres really useful merge actor test assets to somewhere QA can get em.

Change 3146738 on 2016/09/30 by Martin.Wilson

	Fix pose blending for on non-additive pose blending + remove normalising of weights for weights less than 1

	#tests Editor tests with mambo pose asset
	#jira UE-36189

Change 3146750 on 2016/09/30 by Jurre.deBaare

	Material baking issue
	#misc Removed the renderer initialization which causes issue the first time you would render out a material (gradient from top left to bottom right over the texture)
	#misc Replaced incorrect masks with _way_  better approach thanks to Martin

Change 3146755 on 2016/09/30 by Jurre.deBaare

	Need better progress bar for HLOD
	#fix replaced the progress updates with new more 'correct' ones according to the actual workload and fixed up the Simplygon progress callback
	#jira UE-34334

Change 3147085 on 2016/09/30 by Marc.Audy

	PR #2815: GetNextViewablePlayer now checking and returning correct PlayerState. (Contributed by joshkay)
	#jira UE-36632

Change 3147224 on 2016/09/30 by Martin.Wilson

	CIS Fix

Change 3147280 on 2016/09/30 by Marc.Audy

	Mouse smoothing should use application frame rate, not the dilated game frame rate
	#jira UE-31040

Change 3147446 on 2016/09/30 by Aaron.McLeran

	UE-36682 SoundCue Delay Not Consuming Input StartTime Correctly

Change 3147693 on 2016/09/30 by Ben.Zeigler

	#jira UE-36657
	If a player has an existing Pawn during RestartPlayer, use that pawn's rotation instead of the start spot, because we were already keeping the pawn's location

Change 3147697 on 2016/09/30 by Jon.Nabozny

	Add rotation parameter to FBodyInstance::Sweep and FBodyInstance::InternalSweepPhysX

	#jira UE-30486

Change 3147761 on 2016/09/30 by Jon.Nabozny

	Fix AUTRepulsorBubble UPrimitiveComponent::SweepComponent usage.

Change 3148533 on 2016/10/03 by Thomas.Sarkanen

	Fix new deprecation warnings introduced by the pull from main

Change 3148567 on 2016/10/03 by Marc.Audy

	Fix crash when exiting PIE while a panoramic screenshot is being taken
	Make stereo panorama tick with the world it is operating on
	#jira UE-36492

Change 3148571 on 2016/10/03 by Marc.Audy

	Allow modification of components that are EditAnywhere but don't exist in the CDO
	#jira UE-36694

Change 3148607 on 2016/10/03 by Martin.Wilson

	Properly end notify states when we clear the anim instance on a skeletal mesh.

	#jira UE-32488

Change 3148711 on 2016/10/03 by Martin.Wilson

	Fix type in virtual bone tooltip

	#jira UE-36703

Change 3148746 on 2016/10/03 by Benn.Gallagher

	Fixed a few cases where post process and sub instance anim calls weren't being made correctly.
	#jira UE-36529

Change 3148807 on 2016/10/03 by Martin.Wilson

	Fix mismatch skeleton error when undoing virtual bone changes

	#jira UE-36705

Change 3148812 on 2016/10/03 by Martin.Wilson

	Add undo support to removing virtual bones

	#jira UE-36706

Change 3148975 on 2016/10/03 by Jurre.deBaare

	Issue with combining meshes both with/without normal maps
	#fix make sure we always output atleast the default normal value when baking out materials, this to ensure we output non-black values for meshes without normal maps (this would cause the normal to be incorrect)
	#misc fixed issue in function to set texture rectangle to a single colour
	#misc spotted comparison error

Change 3148976 on 2016/10/03 by Ori.Cohen

	Make sure that shape queries that we pass into physx are never size 0. Fixes some NaNs

	#JIRA UE-36639

Change 3148991 on 2016/10/03 by Jurre.deBaare

	Changing LOD materials on Merged Actors Crashes Editor
	#fix take into account LOD that is using the material when remapping (removing duplicate) materials
	#jira UE-35883

Change 3148997 on 2016/10/03 by Jurre.deBaare

	Make sure we remove matrix samples that fall outside of the import range and remap those that are in range

Change 3149002 on 2016/10/03 by Jurre.deBaare

	Issues with importing Alembic caches using  matrix transformations
	#fix Apply conversion matrix to imported matrix samples to make them match the DCC package they were exported from

Change 3149030 on 2016/10/03 by Martin.Wilson

	Dont show save warning on animations when we have curve data

	#jira UE-34145

Change 3149115 on 2016/10/03 by Mieszko.Zielinski

	Made PathfollowingComponent distinct between patrial and full paths in terms of acceptance radius used, when trying to determin if pathing agent is at goal location #UE4

	#jira UE-35153

Change 3149186 on 2016/10/03 by Ben.Zeigler

	#UE-36722 Fix failure to spawn when trying to spawn 4 capsules in the exact same location
	There's no "Correct" direction to move out of a penetrating capsule, but old PhysX appeared to be consistent. New PhysX is not, so now we save and restore the adjustment instead of letting previous iterations modify it.
	This code is weird but this solution is better than the old version and handles inconsistent results

Change 3149235 on 2016/10/03 by Martin.Wilson

	Change inline curve name editing to only change the name of that specific curve, instead of renaming the smart name itself.

	#jira UE-20005

Change 3149245 on 2016/10/03 by Marc.Audy

	Remove duplicate entries from AttachChildren caused by lack of atomic cross-object updates.

Change 3149397 on 2016/10/03 by Ori.Cohen

	Fix collision profile writing out response values to channels that don't exist.

	#JIRA UE-36359

Change 3149679 on 2016/10/03 by Zak.Middleton

	#ue4 -  Don't mark CharacterMovementComponent::bUseControllerDesiredRotation as an advanced property. Consolidate rotation settings (RotationRate, bUseControllerDesiredRotation, bOrientRotationToMovement) in a new "Rotation Settings" category.

Change 3149929 on 2016/10/04 by Jurre.deBaare

	Fix for CIS errors
	#fix Mac didn't like undefined struct

Change 3149977 on 2016/10/04 by danny.bouimad

	Massive update to Merge Actor test files

Change 3150014 on 2016/10/04 by James.Golding

	UE-36686 Fix crash when slicing and not creating other section

Change 3150016 on 2016/10/04 by James.Golding

	UE-35335 MergeActors now converts box collision to convex, so collision scales correctly after merging

Change 3150019 on 2016/10/04 by James.Golding

	UE-36737 Fix LineTraceComponent not returning face index

Change 3150020 on 2016/10/04 by James.Golding

	UE-36672 Export PhysicsContstraintComponent class so it can be subclassed outside Engine module

Change 3150027 on 2016/10/04 by Ben.Marsh

	Add PhysX build option into Dev-Framework.

Change 3150042 on 2016/10/04 by Benn.Gallagher

	Fixed clothing example 1.3 collision glitches

Change 3150172 on 2016/10/04 by Benn.Gallagher

	Made Skeletal Mesh LOD reimports clear any existing simplification flag so we don't show "generated" next to LOD entries for them.
	#jira UE-36589

Change 3150319 on 2016/10/04 by Ori.Cohen

	Go back to only deferring body creation per component. This can now use the slow path when needed. Can't support deferring of multiple components without changing locking API so we'll do that in the future.

	#JIRA UE-36535, UE-36504

Change 3150355 on 2016/10/04 by Zak.Middleton

	#ue4 - Change checkSlow() to check() in GetDefaultObject<> because this is potentially an unsafe static cast.

Change 3150370 on 2016/10/04 by Ori.Cohen

	Fix deferred actors not getting flushed.

Change 3150386 on 2016/10/04 by Martin.Wilson

	Fix additive animation check failing in cooked builds when using virtual bones

	#jira UE-36743

Change 3150424 on 2016/10/04 by Ori.Cohen

	Exclude kinematic actors from active transforms generation.

Change 3150613 on 2016/10/04 by Zak.Middleton

	#ue4 - Fix bad GetDefaultObject<> in AbilitySystemGlobals. Turned up since changing checkSlow() to check() in GetDefaultObject.

	(Mirror CL 3138304  in Orion-DevGeneral)

	#jira UE-36810
	#tests compiled

Change 3150679 on 2016/10/04 by Ben.Zeigler

	Crash fix with no async scene

Change 3150765 on 2016/10/04 by Ben.Zeigler

	Deprecate UStructProperty::ExportTextItem_Static and ImportItem_Static, and add ExportText and ImportText directly to UScriptStruct
	Add bAllowNativeOverride to specify rather to call the native override. For unclear reasons the static export skipped the native override while the static import included it
	This allows calling the generic ImportText from inside a native ImportTextItem and then doing some post processing

Change 3150796 on 2016/10/04 by Marc.Audy

	Fix LOCTEXT warnings related to blueprint class menu options

Change 3150806 on 2016/10/04 by Ben.Zeigler

	Fix bad text format in import error message, lead to double error

Change 3150891 on 2016/10/04 by Ben.Zeigler

	#jira UE-36170 Fix duplicate GUID spam when async loading levels during PIE by checking the package flag instead of the runtime global

Change 3150914 on 2016/10/04 by Marc.Audy

	Don't try to recreate render state if it has already been recreated while the recreate context was active
	#jira UE-36590

Change 3151195 on 2016/10/04 by Dan.Reynolds

	Updates to QASoundWaveProcedural

	QASoundWaveProcedural edited to be a GameplayStatic which spawns an Audio Component Handler as well as a Procedural Sound Wave.  Support for envelope shaping (Attack, Sustain, Release) as well as multiple waveforms (Sine, Triangle, Sawtooth, Square).  Blueprint API expanded to include separate functions for setting QASoundWaveProcedural settings and Playing.

Change 3151233 on 2016/10/04 by Ben.Zeigler

	#jira UE-36836 Fix variable shadowing warnings

Change 3151328 on 2016/10/04 by dan.reynolds

	AEOverview Update - Added Sound Wave Procedural test map and added support for mobile (tested on Android) menu selection - Still a WIP

Change 3151461 on 2016/10/05 by Thomas.Sarkanen

	Fix localization warnings

	#jira UE-36720 - //UE4/Main: Step 'Build Engine Localization' - 2 Warnings

Change 3151546 on 2016/10/05 by Martin.Wilson

	Fix pose watch regression due to persona refactor changes.

	#jira UE-36851

Change 3151587 on 2016/10/05 by Jurre.deBaare

	Updating Simplygon to SDK version 8.0
	#misc removed redundant files
	#misc fixed landscape culling in merge actor path
	#misc added support for volume culling using simplygon
	#misc fixed when or not to use mesh data for material baking

	#notes
	Change: 3137650
	Date: 23/09/2016 07:57
	Client: Mustafa.Tungekar_Dev-Partner-Simplygon
	User: Mustafa.Tungekar
	Status: submitted
	Type: restricted
	ImportedBy:
	Identity:
	Description:
	-Renamed commandline variables for ZipUtils AutomationScript
	-Implemented Execute instead of ExecuteBuild
	-Updated commandline arguments in SimplygonSwarm
	JobStatus:
	Jobs:
	Files:
	//UE4/Dev-Partner-Simplygon/Engine/Source/Developer/SimplygonSwarm/Private/SimplygonSwarm.cpp#4
	//UE4/Dev-Partner-Simplygon/Engine/Source/Programs/AutomationTool/Scripts/ZipUtils.Automation.cs#2
	Change: 3137649
	Date: 23/09/2016 07:56
	Client: Mustafa.Tungekar_Dev-Partner-Simplygon
	User: Mustafa.Tungekar
	Status: submitted
	Type: restricted
	ImportedBy:
	Identity:
	Description:
	Moved file hash computation to ImportObject
	JobStatus:
	Jobs:
	Files:
	//UE4/Dev-Partner-Simplygon/Engine/Source/Editor/UnrealEd/Classes/Factories/Factory.h#4
	//UE4/Dev-Partner-Simplygon/Engine/Source/Editor/UnrealEd/Private/Factories/Factory.cpp#4
	Change: 3137646
	Date: 23/09/2016 07:55
	Client: Mustafa.Tungekar_Dev-Partner-Simplygon
	User: Mustafa.Tungekar
	Status: submitted
	Type: restricted
	ImportedBy:
	Identity:
	Description:
	Fixes CL3099204
	EditorPerProjectUserSetting
	Removed ConfigRestartRequired attribute from properties where it was not required
	MeshUtilities
	-Added FProxyFailedDelegate
	-Extended IMeshMerging to include FProxyFailed delegate
	-Added ProxyGenerationFailed method to FProxyGenerationProcessor class
	-Setup FailedDelegate for both MeshMerging and DistributedMeshMerging
	SimplygonMeshReduction
	-Added check for invalid texture id
	-Updated notes and removed commented code that is not required.
	-Setup failed delegate
	-Fixed issue where image data was never hooked into the texture.
	-Fixed issue where texture table was never passed into casters
	SimplygonSwarm
	-Setup failed delegate
	-Fixed RawMesh pointer usage.
	-Move helper method into SimplygonSwarmHelpers.h.
	-Added SimplygonSwarmHelpers
	-Removed redundant constant path to 7-zip
	-Removed GetSimplygonDirectory instead using inplace.
	-Removed commented code that is currently not required.
	-Fixed Typos
	JobStatus:
	Jobs:
	Files:
	//UE4/Dev-Partner-Simplygon/Engine/Source/Developer/MeshUtilities/Private/MeshUtilities.cpp#3
	//UE4/Dev-Partner-Simplygon/Engine/Source/Developer/MeshUtilities/Public/MeshUtilities.h#3
	//UE4/Dev-Partner-Simplygon/Engine/Source/Developer/SimplygonMeshReduction/Private/SimplygonMeshReduction.cpp#4
	//UE4/Dev-Partner-Simplygon/Engine/Source/Developer/SimplygonSwarm/Private/SimplygonSwarm.cpp#3
	//UE4/Dev-Partner-Simplygon/Engine/Source/Developer/SimplygonSwarm/Public/SimplygonSwarmHelpers.h#1
	//UE4/Dev-Partner-Simplygon/Engine/Source/Editor/UnrealEd/Classes/Editor/EditorPerProjectUserSettings.h#3
	Change: 3099204
	Date: 24/08/2016 07:56
	Client: Mustafa.Tungekar_Dev-Partner-Simplygon
	User: Mustafa.Tungekar
	Status: submitted
	Type: restricted
	ImportedBy:
	Identity:
	Description:
	Simplygon 8.0 Updates
	Deprecated support for 7.0 and updated SimplygonSwarm and SimplygonMeshReduction to use 8.0
	EditorPerProjectSettings
	*SwarmMaxUploadChunkSizeInMB for limiting the max upload size for swarm. Note the Simplygon Grid has a limitation of 2GB
	*SwarmNumOfConcurrentJobs for executing number of concurrent jobs
	*Fixed issue where SG_MATERIAL_CHANNEL_METALLIC to SG_MATERIAL_CHANNEL_METALNESS (Chage in 8.0 SDK)
	SPL, SimplygonSwarm, RESTClient
	*Bumped up SPL Version to 8
	*Fixed code paths to use ZipUtils UAT script for zipping and unzipping CL3094374
	*Removed SPL Templates for version 7.0
	*Added conditional logging to REST methods
	*Added multi part upload. The RESTClient automatically decided if large files need to be split up before uploading to simplygon grid.
	*Updated method to take in texturepath
	SimplygonMeshReduction
	*Removed minimum version requirement.
	*Bumped up minimum version
	*Chagned license file name to refelect 8.0 changes
	*MaterialBaking related method now take in TextureTable as an extra parameter. This is due to 8.0 move away from old way of setting up materials and using SimplygonShadingNetowrk based appraoch.
	JobStatus:
	Jobs:
	Files:
	//UE4/Dev-Partner-Simplygon/Engine/Source/Developer/SimplygonMeshReduction/Private/SimplygonMeshReduction.cpp#3
	//UE4/Dev-Partner-Simplygon/Engine/Source/Developer/SimplygonMeshReduction/Public/SimplygonTypes.h#2
	//UE4/Dev-Partner-Simplygon/Engine/Source/Developer/SimplygonSwarm/Private/SimplygonRESTClient.cpp#3
	//UE4/Dev-Partner-Simplygon/Engine/Source/Developer/SimplygonSwarm/Private/SimplygonSwarm.cpp#2
	//UE4/Dev-Partner-Simplygon/Engine/Source/Developer/SimplygonSwarm/Public/SimplygonRESTClient.h#2
	//UE4/Dev-Partner-Simplygon/Engine/Source/Developer/SimplygonSwarm/Public/SimplygonSwarmPrivatePCH.h#2
	//UE4/Dev-Partner-Simplygon/Engine/Source/Editor/UnrealEd/Classes/Editor/EditorPerProjectUserSettings.h#2
	//UE4/Dev-Partner-Simplygon/Engine/Source/Editor/UnrealEd/Private/Settings/EditorPerProjectUserSettings.cpp#2
	Change: 3099200
	Date: 24/08/2016 07:48
	Client: Mustafa.Tungekar_Dev-Partner-Simplygon
	User: Mustafa.Tungekar
	Status: submitted
	Type: restricted
	ImportedBy:
	Identity:
	Description:
	#fix Copy constructor for FMeshReduciton mapped ShadingImportance to SilhouetteImportance
	JobStatus:
	Jobs:
	Files:
	//UE4/Dev-Partner-Simplygon/Engine/Source/Runtime/Engine/Classes/Engine/MeshMerging.h#2
	Change: 3099199
	Date: 24/08/2016 07:47
	Client: Mustafa.Tungekar_Dev-Partner-Simplygon
	User: Mustafa.Tungekar
	Status: submitted
	Type: restricted
	ImportedBy:
	Identity:
	Description:
	Added Automation Script ZipUtils to zip file and unzip files from SimplygonSwarm.
	This will remove any dependency on external zip program and should work across platforms
	JobStatus:
	Jobs:
	Files:
	//UE4/Dev-Partner-Simplygon/Engine/Source/Programs/AutomationTool/Scripts/AutomationScripts.Automation.csproj#2
	//UE4/Dev-Partner-Simplygon/Engine/Source/Programs/AutomationTool/Scripts/ZipUtils.Automation.cs#1
	Change: 3099197
	Date: 24/08/2016 07:40
	Client: Mustafa.Tungekar_Dev-Partner-Simplygon
	User: Mustafa.Tungekar
	Status: submitted
	Type: restricted
	ImportedBy:
	Identity:
	Description:
	*Speed improvements for FBX Scene Importer
	*Added a static method to compute Hash.
	JobStatus:
	Jobs:
	Files:
	//UE4/Dev-Partner-Simplygon/Engine/Source/Editor/UnrealEd/Classes/Factories/Factory.h#3
	//UE4/Dev-Partner-Simplygon/Engine/Source/Editor/UnrealEd/Private/Factories/Factory.cpp#3
	//UE4/Dev-Partner-Simplygon/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxStaticMeshImport.cpp#2
	//UE4/Dev-Partner-Simplygon/Engine/Source/Runtime/Engine/Classes/EditorFramework/AssetImportData.h#2
	//UE4/Dev-Partner-Simplygon/Engine/Source/Runtime/Engine/Private/EditorFramework/AssetImportData.cpp#2

Change 3151664 on 2016/10/05 by Richard.Hinckley

	Fixing ACharacter template for "New C++ Class" feature. Avoiding naming a function parameter the same as an existing class member.

Change 3151729 on 2016/10/05 by Thomas.Sarkanen

	Audit of remaining NaN checks

	Some checks remain on in shipping (generally those called from blueprint):

	- AActor::TeleportTo
	- AActor::SetActorRelativeScale3D

	#jira UE-30999 - Optimize ⌠ContainsNaN÷ and ⌠ContainsNaNOrInfinite÷, audit those still in shipping/test

Change 3151742 on 2016/10/05 by Ori.Cohen

	Make sure that if physical animation component doesn't find a body and bone it doesn't crash.

	#JIRA UE-36839

Change 3151756 on 2016/10/05 by Jurre.deBaare

	Fixing d3dcompiler_47.dll missing issue
	#fix added runtime dependency and dll name to build.cs file
	#fix now load the d3dcompiler_47.dll from the Binaries/ThirdParty/Windows folder before loading the simplygon DLL

Change 3151761 on 2016/10/05 by Thomas.Sarkanen

	Fix deprecation warning from last integration

	Moved Preview to EditorPreview in FEditorWorldManager::OnWorldContextAdd.

	#jira UE-36858 - Compile UE4Editor* completed with 1 warning

Change 3151782 on 2016/10/05 by Jurre.deBaare

	Simplygon patch up
	#misc linker errors popping up from JSONCPP
	#misc incorporated emissive material property fix from other shelve
	#misc static analysis fix

Change 3151804 on 2016/10/05 by Marc.Audy

	Clear need end of frame update when unregistering a component

Change 3151928 on 2016/10/05 by Ori.Cohen

	Fix runtime DLLs not including all delay loaded physx dll files.

	#JIRA UE-36816

Change 3151977 on 2016/10/05 by Martin.Wilson

	Notifies can no longer occupy the same time on the same track.

	#jira UE-30658

Change 3151989 on 2016/10/05 by Jon.Nabozny

	Fix ArchVis character rotation pitch when looking up/down.

	#jira UE-35706

Change 3152083 on 2016/10/05 by Marc.Audy

	Ensure that pending kill components get their marked for end of frame state cleared.

Change 3152086 on 2016/10/05 by Ben.Zeigler

	#jira UE-36169 Fix it so missing linker errors that point to Blueprint CDOs are skipped, the same way it skips linker errors going to the actual class. Fixes a lot of spurious warnings from deleting components from blueprints or native classes
	Clean up the VerifyImport error handling so it also displays in -game and cook, and fix the missing class warning to work properly, previously it would happen 0% in development 100% in debug even if the class was valid

Change 3152093 on 2016/10/05 by Marc.Audy

	Change logic for when location cannot be changed for a static component to be independent of has begun play and have to do with whether construction script is running or the level is in the process of loading (mostly for backwards compatibility adjustments in post load).
	#jira UE-36146
	#jira UE-24647

Change 3152100 on 2016/10/05 by Ben.Zeigler

	Remove pragma optmize

Change 3152112 on 2016/10/05 by Marc.Audy

	Merging //UE4/Dev-Main to Dev-Framework (//UE4/Dev-Framework) @ 3152072

Change 3152134 on 2016/10/05 by Jurre.deBaare

	Simplygon/Merge actor issues
	#fix for emissive output on meshes that do not have emissive properties
	#fix for texture binning, not removing invalid split area causing overlapped textures

Change 3152136 on 2016/10/05 by James.Golding

	UE-36859 Fix tooltip saying you can click to stop recording

Change 3152169 on 2016/10/05 by James.Golding

	UE-31209 UE-30935 : Expose bDeformableMesh and bFastCook options in FTriMeshCollisionData
	ProceduralMeshComponent will now cook using 'fast' and 'deformable' options, so updating collision on sections should work correctly
	Change ERuntimePhysxCookOptimizationFlags to EPhysXMeshCookFlags and use that to pass options to CookConvex and CookTriMesh

Change 3152202 on 2016/10/05 by Jurre.deBaare

	Mac/Linux fix

Change 3152303 on 2016/10/05 by Marc.Audy

	Fix deprecation warning post merge from main

Change 3152320 on 2016/10/05 by Martin.Wilson

	Fix root motion from everything calculating incorrect root motion when animations haven't been ticking

	#jira UE-35364

Change 3152354 on 2016/10/05 by James.Golding

	PoseDriver should pass through if no poses activated

Change 3152357 on 2016/10/05 by James.Golding

	UE-36844 Remove unused OnAssetModifiedNotifier delegate from PoseAsset, ensure OnPoseListChanged is called when updating PoseAsset from anim.

Change 3152556 on 2016/10/05 by Marc.Audy

	Remove autos

Change 3152560 on 2016/10/05 by Marc.Audy

	Don't allow child actor references to be dragged from the outliner to a level script
	#jira UE-16700

Change 3152568 on 2016/10/05 by Marc.Audy

	Don't allow non-networking code to set bRemoteOwned in the actor spawn parameters
	Remove deprecated bNoCollisionFail
	#jira UE-35928

Change 3152575 on 2016/10/05 by Marc.Audy

	Allow construction script to run post move for native classes. Actor can determine whether it should only occur on finish or every call to post edit move

Change 3153101 on 2016/10/06 by Thomas.Sarkanen

	Fix crash re-opening the viewport in Persona-based editors

	#jira UE-36775 - Editor crashes when re-opening viewport in Persona

Change 3153139 on 2016/10/06 by James.Golding

	UE-36908 Remove GetRuntimeOnlyCookOptimizationFlags if cooking is not supported

Change 3153160 on 2016/10/06 by Thomas.Sarkanen

	Fix for crash when deleting additive layer track

	Code had not been updated to use the new delgate system (was still using reciprocal FPersona ptr).

	#jira UE-36740 - Crash when removing or disabling an additive layer track in Persona

Change 3153175 on 2016/10/06 by Benn.Gallagher

	Fixed crashes when using subinstances in non-default states. we previously initialized the anim instances in the node initialize, but in states that haven't been hit by an initialize this will happen off the game thread which is not allowed.
	#jira UE-36900

Change 3153223 on 2016/10/06 by Thomas.Sarkanen

	Fixed crash when opening an asset from the blend space editor

	Code was still trying to open 'old' Persona when it was disabled.
	Also fix other call sites where this was being done outside of asset type actions.

	#jira UE-36766 - Crash attempting to open an asset from Aim Offset graph in Persona

Change 3153324 on 2016/10/06 by Thomas.Sarkanen

	Prevented invalid GUIDs from being saved into smart name containers

	AddOrFindName now checks to see if existing GUIDs are valid before using them.
	AddName now requires a valid GUID to be passed in.
	Also added Modify() call to the skeleton when FindOrAddSmartName is called from VerifySmartNameInternal, as without  this the skeleton might not get saved.
	Also add Laurent's fix for fixing up already-saved invalid GUIDs (CL 3138068).

	#jira UE-36367 - It is possible for curves with an invalid GUID to be saved into the USkeleton asset

Change 3153348 on 2016/10/06 by Martin.Wilson

	Re add ticking code so all Persona editors viewports tick during drag events (went missing in Persona refactor)

	#jira UE-36751

Change 3153426 on 2016/10/06 by Mieszko.Zielinski

	Added missing elements of block comments support in BT editor #UE4

Change 3153454 on 2016/10/06 by Benn.Gallagher

	Fixed crash using anim debug with subinstances that are preceded by branching nodes.
	#jira UE-36935

[CL 3153517 by Ori Cohen in Main branch]
2016-10-06 12:11:11 -04:00

2006 lines
59 KiB
C++

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
#include "StaticMeshEditorModule.h"
#include "AssetRegistryModule.h"
#include "StaticMeshEditor.h"
#include "SStaticMeshEditorViewport.h"
#include "StaticMeshEditorViewportClient.h"
#include "StaticMeshEditorTools.h"
#include "StaticMeshEditorActions.h"
#include "UnrealEd.h"
#include "StaticMeshResources.h"
#include "ISocketManager.h"
#include "PreviewScene.h"
#include "ScopedTransaction.h"
#include "BusyCursor.h"
#include "FbxMeshUtils.h"
#include "../Private/GeomFitUtils.h"
#include "EditorViewportCommands.h"
#include "Editor/UnrealEd/Private/ConvexDecompTool.h"
#include "Editor/ContentBrowser/Public/ContentBrowserModule.h"
#include "Editor/WorkspaceMenuStructure/Public/WorkspaceMenuStructureModule.h"
#include "Runtime/Analytics/Analytics/Public/Interfaces/IAnalyticsProvider.h"
#include "EngineAnalytics.h"
#include "SDockTab.h"
#include "GenericCommands.h"
#include "STextComboBox.h"
#include "SNotificationList.h"
#include "NotificationManager.h"
#include "Engine/Selection.h"
#include "PhysicsEngine/BodySetup.h"
#include "SAdvancedPreviewDetailsTab.h"
#define LOCTEXT_NAMESPACE "StaticMeshEditor"
DEFINE_LOG_CATEGORY_STATIC(LogStaticMeshEditor, Log, All);
class FStaticMeshStatusMessageContext : public FScopedSlowTask
{
public:
explicit FStaticMeshStatusMessageContext(const FText& InMessage)
: FScopedSlowTask(0, InMessage)
{
UE_LOG(LogStaticMesh, Log, TEXT("%s"), *InMessage.ToString());
MakeDialog();
}
};
const FName FStaticMeshEditor::ViewportTabId( TEXT( "StaticMeshEditor_Viewport" ) );
const FName FStaticMeshEditor::PropertiesTabId( TEXT( "StaticMeshEditor_Properties" ) );
const FName FStaticMeshEditor::SocketManagerTabId( TEXT( "StaticMeshEditor_SocketManager" ) );
const FName FStaticMeshEditor::CollisionTabId( TEXT( "StaticMeshEditor_Collision" ) );
const FName FStaticMeshEditor::PreviewSceneSettingsTabId(TEXT("StaticMeshEditor_PreviewScene"));
void FStaticMeshEditor::RegisterTabSpawners(const TSharedRef<class FTabManager>& InTabManager)
{
WorkspaceMenuCategory = InTabManager->AddLocalWorkspaceMenuCategory(LOCTEXT("WorkspaceMenu_StaticMeshEditor", "Static Mesh Editor"));
auto WorkspaceMenuCategoryRef = WorkspaceMenuCategory.ToSharedRef();
FAssetEditorToolkit::RegisterTabSpawners(InTabManager);
InTabManager->RegisterTabSpawner( ViewportTabId, FOnSpawnTab::CreateSP(this, &FStaticMeshEditor::SpawnTab_Viewport) )
.SetDisplayName( LOCTEXT("ViewportTab", "Viewport") )
.SetGroup(WorkspaceMenuCategoryRef)
.SetIcon(FSlateIcon(FEditorStyle::GetStyleSetName(), "LevelEditor.Tabs.Viewports"));
InTabManager->RegisterTabSpawner( PropertiesTabId, FOnSpawnTab::CreateSP(this, &FStaticMeshEditor::SpawnTab_Properties) )
.SetDisplayName( LOCTEXT("PropertiesTab", "Details") )
.SetGroup(WorkspaceMenuCategoryRef)
.SetIcon(FSlateIcon(FEditorStyle::GetStyleSetName(), "LevelEditor.Tabs.Details"));
InTabManager->RegisterTabSpawner( SocketManagerTabId, FOnSpawnTab::CreateSP(this, &FStaticMeshEditor::SpawnTab_SocketManager) )
.SetDisplayName( LOCTEXT("SocketManagerTab", "Socket Manager") )
.SetGroup(WorkspaceMenuCategoryRef)
.SetIcon(FSlateIcon(FEditorStyle::GetStyleSetName(), "StaticMeshEditor.Tabs.SocketManager"));
InTabManager->RegisterTabSpawner( CollisionTabId, FOnSpawnTab::CreateSP(this, &FStaticMeshEditor::SpawnTab_Collision) )
.SetDisplayName( LOCTEXT("CollisionTab", "Convex Decomposition") )
.SetGroup(WorkspaceMenuCategoryRef)
.SetIcon(FSlateIcon(FEditorStyle::GetStyleSetName(), "StaticMeshEditor.Tabs.ConvexDecomposition"));
InTabManager->RegisterTabSpawner(PreviewSceneSettingsTabId, FOnSpawnTab::CreateSP(this, &FStaticMeshEditor::SpawnTab_PreviewSceneSettings))
.SetDisplayName(LOCTEXT("PreviewSceneTab", "Preview Scene Settings"))
.SetGroup(WorkspaceMenuCategoryRef)
.SetIcon(FSlateIcon(FEditorStyle::GetStyleSetName(), "LevelEditor.Tabs.Details"));
}
void FStaticMeshEditor::UnregisterTabSpawners(const TSharedRef<class FTabManager>& InTabManager)
{
FAssetEditorToolkit::UnregisterTabSpawners(InTabManager);
InTabManager->UnregisterTabSpawner( ViewportTabId );
InTabManager->UnregisterTabSpawner( PropertiesTabId );
InTabManager->UnregisterTabSpawner( SocketManagerTabId );
InTabManager->UnregisterTabSpawner( CollisionTabId );
InTabManager->UnregisterTabSpawner( PreviewSceneSettingsTabId );
}
FStaticMeshEditor::~FStaticMeshEditor()
{
FReimportManager::Instance()->OnPostReimport().RemoveAll(this);
GEditor->UnregisterForUndo( this );
GEditor->OnObjectReimported().RemoveAll(this);
}
void FStaticMeshEditor::InitStaticMeshEditor( const EToolkitMode::Type Mode, const TSharedPtr< class IToolkitHost >& InitToolkitHost, UStaticMesh* ObjectToEdit )
{
FReimportManager::Instance()->OnPostReimport().AddRaw(this, &FStaticMeshEditor::OnPostReimport);
// Support undo/redo
ObjectToEdit->SetFlags( RF_Transactional );
GEditor->RegisterForUndo( this );
// Register our commands. This will only register them if not previously registered
FStaticMeshEditorCommands::Register();
// Register to be notified when an object is reimported.
GEditor->OnObjectReimported().AddSP(this, &FStaticMeshEditor::OnObjectReimported);
BindCommands();
Viewport = SNew(SStaticMeshEditorViewport)
.StaticMeshEditor(SharedThis(this))
.ObjectToEdit(ObjectToEdit);
FPropertyEditorModule& PropertyEditorModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>(TEXT("PropertyEditor"));
FDetailsViewArgs DetailsViewArgs;
DetailsViewArgs.bAllowSearch = true;
DetailsViewArgs.bLockable = false;
DetailsViewArgs.bUpdatesFromSelection = false;
DetailsViewArgs.NameAreaSettings = FDetailsViewArgs::HideNameArea;
DetailsViewArgs.NotifyHook = this;
StaticMeshDetailsView = PropertyEditorModule.CreateDetailView( DetailsViewArgs );
FOnGetDetailCustomizationInstance LayoutCustomStaticMeshProperties = FOnGetDetailCustomizationInstance::CreateSP( this, &FStaticMeshEditor::MakeStaticMeshDetails );
StaticMeshDetailsView->RegisterInstancedCustomPropertyLayout( UStaticMesh::StaticClass(), LayoutCustomStaticMeshProperties );
SetEditorMesh(ObjectToEdit);
BuildSubTools();
const TSharedRef<FTabManager::FLayout> StandaloneDefaultLayout = FTabManager::NewLayout( "Standalone_StaticMeshEditor_Layout_v4" )
->AddArea
(
FTabManager::NewPrimaryArea() ->SetOrientation(Orient_Vertical)
->Split
(
FTabManager::NewStack()
->SetSizeCoefficient(0.1f)
->SetHideTabWell( true )
->AddTab(GetToolbarTabId(), ETabState::OpenedTab)
)
->Split
(
FTabManager::NewSplitter() ->SetOrientation(Orient_Horizontal)
->SetSizeCoefficient(0.9f)
->Split
(
FTabManager::NewStack()
->SetSizeCoefficient(0.6f)
->AddTab(ViewportTabId, ETabState::OpenedTab)
->SetHideTabWell( true )
)
->Split
(
FTabManager::NewSplitter() ->SetOrientation(Orient_Vertical)
->SetSizeCoefficient(0.2f)
->Split
(
FTabManager::NewStack()
->SetSizeCoefficient(0.7f)
->AddTab(PreviewSceneSettingsTabId, ETabState::OpenedTab)
->AddTab(PropertiesTabId, ETabState::OpenedTab)
)
->Split
(
FTabManager::NewStack()
->SetSizeCoefficient(0.3f)
->AddTab(SocketManagerTabId, ETabState::OpenedTab)
->AddTab(CollisionTabId, ETabState::ClosedTab)
)
)
)
);
const bool bCreateDefaultStandaloneMenu = true;
const bool bCreateDefaultToolbar = true;
FAssetEditorToolkit::InitAssetEditor( Mode, InitToolkitHost, StaticMeshEditorAppIdentifier, StandaloneDefaultLayout, bCreateDefaultToolbar, bCreateDefaultStandaloneMenu, ObjectToEdit );
ExtendMenu();
ExtendToolBar();
RegenerateMenusAndToolbars();
}
TSharedRef<IDetailCustomization> FStaticMeshEditor::MakeStaticMeshDetails()
{
TSharedRef<FStaticMeshDetails> NewDetails = MakeShareable( new FStaticMeshDetails( *this ) );
StaticMeshDetails = NewDetails;
return NewDetails;
}
void FStaticMeshEditor::ExtendMenu()
{
struct Local
{
static void FillEditMenu( FMenuBuilder& InMenuBuilder )
{
InMenuBuilder.BeginSection("Sockets", LOCTEXT("EditStaticMeshSockets", "Sockets"));
{
InMenuBuilder.AddMenuEntry( FGenericCommands::Get().Delete, "DeleteSocket", LOCTEXT("DeleteSocket", "Delete Socket"), LOCTEXT("DeleteSocketToolTip", "Deletes the selected socket from the mesh.") );
InMenuBuilder.AddMenuEntry( FGenericCommands::Get().Duplicate, "DuplicateSocket", LOCTEXT("DuplicateSocket", "Duplicate Socket"), LOCTEXT("DuplicateSocketToolTip", "Duplicates the selected socket.") );
}
InMenuBuilder.EndSection();
}
static void FillMeshMenu( FMenuBuilder& InMenuBuilder )
{
// @todo mainframe: These menus, and indeed all menus like them, should be updated with extension points, plus expose public module
// access to extending the menus. They may also need to extend the command list, or be able to PUSH a command list of their own.
// If we decide to only allow PUSHING, then nothing else should be needed (happens by extender automatically). But if we want to
// augment the asset editor's existing command list, then we need to think about how to expose support for that.
InMenuBuilder.BeginSection("MeshFindSource");
{
InMenuBuilder.AddMenuEntry(FStaticMeshEditorCommands::Get().FindSource);
}
InMenuBuilder.EndSection();
InMenuBuilder.BeginSection("MeshChange");
{
InMenuBuilder.AddMenuEntry(FStaticMeshEditorCommands::Get().ChangeMesh);
static auto* CVar = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.StaticMesh.EnableSaveGeneratedLODsInPackage"));
if (CVar && CVar->GetValueOnGameThread() != 0)
{
InMenuBuilder.AddMenuEntry(FStaticMeshEditorCommands::Get().SaveGeneratedLODs);
}
}
InMenuBuilder.EndSection();
}
static void FillCollisionMenu( FMenuBuilder& InMenuBuilder )
{
InMenuBuilder.BeginSection("CollisionEditCollision");
{
InMenuBuilder.AddMenuEntry(FStaticMeshEditorCommands::Get().CreateSphereCollision);
InMenuBuilder.AddMenuEntry(FStaticMeshEditorCommands::Get().CreateSphylCollision);
InMenuBuilder.AddMenuEntry(FStaticMeshEditorCommands::Get().CreateBoxCollision);
InMenuBuilder.AddMenuEntry(FStaticMeshEditorCommands::Get().CreateDOP10X);
InMenuBuilder.AddMenuEntry(FStaticMeshEditorCommands::Get().CreateDOP10Y);
InMenuBuilder.AddMenuEntry(FStaticMeshEditorCommands::Get().CreateDOP10Z);
InMenuBuilder.AddMenuEntry(FStaticMeshEditorCommands::Get().CreateDOP18);
InMenuBuilder.AddMenuEntry(FStaticMeshEditorCommands::Get().CreateDOP26);
InMenuBuilder.AddMenuEntry(FStaticMeshEditorCommands::Get().ConvertBoxesToConvex);
InMenuBuilder.AddMenuEntry(FStaticMeshEditorCommands::Get().RemoveCollision);
InMenuBuilder.AddMenuEntry(FGenericCommands::Get().Delete, "DeleteCollision", LOCTEXT("DeleteCollision", "Delete Selected Collision"), LOCTEXT("DeleteCollisionToolTip", "Deletes the selected Collision from the mesh."));
InMenuBuilder.AddMenuEntry(FGenericCommands::Get().Duplicate, "DuplicateCollision", LOCTEXT("DuplicateCollision", "Duplicate Selected Collision"), LOCTEXT("DuplicateCollisionToolTip", "Duplicates the selected Collision."));
}
InMenuBuilder.EndSection();
InMenuBuilder.BeginSection("CollisionAutoConvexCollision");
{
InMenuBuilder.AddMenuEntry(FStaticMeshEditorCommands::Get().CreateAutoConvexCollision);
}
InMenuBuilder.EndSection();
InMenuBuilder.BeginSection("CollisionCopy");
{
InMenuBuilder.AddMenuEntry(FStaticMeshEditorCommands::Get().CopyCollisionFromSelectedMesh);
}
InMenuBuilder.EndSection();
}
static void GenerateMeshAndCollisionMenuBars( FMenuBarBuilder& InMenuBarBuilder)
{
InMenuBarBuilder.AddPullDownMenu(
LOCTEXT("StaticMeshEditorMeshMenu", "Mesh"),
LOCTEXT("StaticMeshEditorMeshMenu_ToolTip", "Opens a menu with commands for altering this mesh"),
FNewMenuDelegate::CreateStatic(&Local::FillMeshMenu),
"Mesh");
InMenuBarBuilder.AddPullDownMenu(
LOCTEXT("StaticMeshEditorCollisionMenu", "Collision"),
LOCTEXT("StaticMeshEditorCollisionMenu_ToolTip", "Opens a menu with commands for editing this mesh's collision"),
FNewMenuDelegate::CreateStatic(&Local::FillCollisionMenu),
"Collision");
}
};
TSharedPtr<FExtender> MenuExtender = MakeShareable(new FExtender);
MenuExtender->AddMenuExtension(
"EditHistory",
EExtensionHook::After,
GetToolkitCommands(),
FMenuExtensionDelegate::CreateStatic( &Local::FillEditMenu ) );
MenuExtender->AddMenuBarExtension(
"Asset",
EExtensionHook::After,
GetToolkitCommands(),
FMenuBarExtensionDelegate::CreateStatic( &Local::GenerateMeshAndCollisionMenuBars )
);
AddMenuExtender(MenuExtender);
IStaticMeshEditorModule* StaticMeshEditorModule = &FModuleManager::LoadModuleChecked<IStaticMeshEditorModule>( "StaticMeshEditor" );
AddMenuExtender(StaticMeshEditorModule->GetMenuExtensibilityManager()->GetAllExtenders(GetToolkitCommands(), GetEditingObjects()));
}
void FStaticMeshEditor::AddReferencedObjects( FReferenceCollector& Collector )
{
Collector.AddReferencedObject( StaticMesh );
}
TSharedRef<SDockTab> FStaticMeshEditor::SpawnTab_Viewport( const FSpawnTabArgs& Args )
{
check( Args.GetTabId() == ViewportTabId );
TSharedRef<SDockTab> SpawnedTab =
SNew(SDockTab)
.Label( LOCTEXT("StaticMeshViewport_TabTitle", "Viewport") )
[
Viewport.ToSharedRef()
];
Viewport->SetParentTab( SpawnedTab );
return SpawnedTab;
}
TSharedRef<SDockTab> FStaticMeshEditor::SpawnTab_Properties( const FSpawnTabArgs& Args )
{
check( Args.GetTabId() == PropertiesTabId );
return SNew(SDockTab)
.Icon( FEditorStyle::GetBrush("StaticMeshEditor.Tabs.Properties") )
.Label( LOCTEXT("StaticMeshProperties_TabTitle", "Details") )
[
StaticMeshDetailsView.ToSharedRef()
];
}
TSharedRef<SDockTab> FStaticMeshEditor::SpawnTab_SocketManager( const FSpawnTabArgs& Args )
{
check( Args.GetTabId() == SocketManagerTabId );
return SNew(SDockTab)
.Label( LOCTEXT("StaticMeshSocketManager_TabTitle", "Socket Manager") )
[
SocketManager.ToSharedRef()
];
}
TSharedRef<SDockTab> FStaticMeshEditor::SpawnTab_Collision( const FSpawnTabArgs& Args )
{
check( Args.GetTabId() == CollisionTabId );
return SNew(SDockTab)
.Label( LOCTEXT("StaticMeshConvexDecomp_TabTitle", "Convex Decomposition") )
[
ConvexDecomposition.ToSharedRef()
];
}
TSharedRef<SDockTab> FStaticMeshEditor::SpawnTab_PreviewSceneSettings(const FSpawnTabArgs& Args)
{
check(Args.GetTabId() == PreviewSceneSettingsTabId);
return SNew(SDockTab)
.Label(LOCTEXT("StaticMeshPreviewScene_TabTitle", "Preview Scene Settings"))
[
AdvancedPreviewSettingsWidget.ToSharedRef()
];
}
void FStaticMeshEditor::BindCommands()
{
const FStaticMeshEditorCommands& Commands = FStaticMeshEditorCommands::Get();
const TSharedRef<FUICommandList>& UICommandList = GetToolkitCommands();
UICommandList->MapAction( FGenericCommands::Get().Delete,
FExecuteAction::CreateSP( this, &FStaticMeshEditor::DeleteSelected ),
FCanExecuteAction::CreateSP(this, &FStaticMeshEditor::CanDeleteSelected));
UICommandList->MapAction( FGenericCommands::Get().Undo,
FExecuteAction::CreateSP( this, &FStaticMeshEditor::UndoAction ) );
UICommandList->MapAction( FGenericCommands::Get().Redo,
FExecuteAction::CreateSP( this, &FStaticMeshEditor::RedoAction ) );
UICommandList->MapAction(
FGenericCommands::Get().Duplicate,
FExecuteAction::CreateSP(this, &FStaticMeshEditor::DuplicateSelected),
FCanExecuteAction::CreateSP(this, &FStaticMeshEditor::CanDuplicateSelected));
UICommandList->MapAction(
FGenericCommands::Get().Rename,
FExecuteAction::CreateSP(this, &FStaticMeshEditor::RequestRenameSelectedSocket),
FCanExecuteAction::CreateSP(this, &FStaticMeshEditor::CanRenameSelected));
UICommandList->MapAction(
Commands.CreateDOP10X,
FExecuteAction::CreateSP(this, &FStaticMeshEditor::GenerateKDop, KDopDir10X, (uint32)10));
UICommandList->MapAction(
Commands.CreateDOP10Y,
FExecuteAction::CreateSP(this, &FStaticMeshEditor::GenerateKDop, KDopDir10Y, (uint32)10));
UICommandList->MapAction(
Commands.CreateDOP10Z,
FExecuteAction::CreateSP(this, &FStaticMeshEditor::GenerateKDop, KDopDir10Z, (uint32)10));
UICommandList->MapAction(
Commands.CreateDOP18,
FExecuteAction::CreateSP(this, &FStaticMeshEditor::GenerateKDop, KDopDir18, (uint32)18));
UICommandList->MapAction(
Commands.CreateDOP26,
FExecuteAction::CreateSP(this, &FStaticMeshEditor::GenerateKDop, KDopDir26, (uint32)26));
UICommandList->MapAction(
Commands.CreateBoxCollision,
FExecuteAction::CreateSP(this, &FStaticMeshEditor::OnCollisionBox));
UICommandList->MapAction(
Commands.CreateSphereCollision,
FExecuteAction::CreateSP(this, &FStaticMeshEditor::OnCollisionSphere));
UICommandList->MapAction(
Commands.CreateSphylCollision,
FExecuteAction::CreateSP(this, &FStaticMeshEditor::OnCollisionSphyl));
UICommandList->MapAction(
Commands.RemoveCollision,
FExecuteAction::CreateSP(this, &FStaticMeshEditor::OnRemoveCollision),
FCanExecuteAction::CreateSP(this, &FStaticMeshEditor::CanRemoveCollision));
UICommandList->MapAction(
Commands.ConvertBoxesToConvex,
FExecuteAction::CreateSP(this, &FStaticMeshEditor::OnConvertBoxToConvexCollision));
UICommandList->MapAction(
Commands.CopyCollisionFromSelectedMesh,
FExecuteAction::CreateSP(this, &FStaticMeshEditor::OnCopyCollisionFromSelectedStaticMesh),
FCanExecuteAction::CreateSP(this, &FStaticMeshEditor::CanCopyCollisionFromSelectedStaticMesh));
// Mesh menu
UICommandList->MapAction(
Commands.FindSource,
FExecuteAction::CreateSP(this, &FStaticMeshEditor::ExecuteFindInExplorer),
FCanExecuteAction::CreateSP(this, &FStaticMeshEditor::CanExecuteSourceCommands));
UICommandList->MapAction(
Commands.ChangeMesh,
FExecuteAction::CreateSP(this, &FStaticMeshEditor::OnChangeMesh),
FCanExecuteAction::CreateSP(this, &FStaticMeshEditor::CanChangeMesh));
UICommandList->MapAction(
Commands.SaveGeneratedLODs,
FExecuteAction::CreateSP(this, &FStaticMeshEditor::OnSaveGeneratedLODs));
// Collision Menu
UICommandList->MapAction(
Commands.CreateAutoConvexCollision,
FExecuteAction::CreateSP(this, &FStaticMeshEditor::OnConvexDecomposition));
}
void FStaticMeshEditor::ExtendToolBar()
{
struct Local
{
static void FillToolbar(FToolBarBuilder& ToolbarBuilder, TSharedPtr< class STextComboBox > UVChannelCombo, TSharedPtr< class STextComboBox > LODLevelCombo)
{
ToolbarBuilder.BeginSection("Realtime");
{
ToolbarBuilder.AddToolBarButton(FEditorViewportCommands::Get().ToggleRealTime);
}
ToolbarBuilder.EndSection();
ToolbarBuilder.BeginSection("Command");
{
ToolbarBuilder.AddToolBarButton(FStaticMeshEditorCommands::Get().SetShowSockets);
ToolbarBuilder.AddToolBarButton(FStaticMeshEditorCommands::Get().SetShowWireframe);
ToolbarBuilder.AddToolBarButton(FStaticMeshEditorCommands::Get().SetShowVertexColor);
ToolbarBuilder.AddToolBarButton(FStaticMeshEditorCommands::Get().SetShowGrid);
ToolbarBuilder.AddToolBarButton(FStaticMeshEditorCommands::Get().SetShowBounds);
ToolbarBuilder.AddToolBarButton(FStaticMeshEditorCommands::Get().SetShowCollision);
ToolbarBuilder.AddToolBarButton(FStaticMeshEditorCommands::Get().SetShowPivot);
ToolbarBuilder.AddToolBarButton(FStaticMeshEditorCommands::Get().SetShowNormals);
ToolbarBuilder.AddToolBarButton(FStaticMeshEditorCommands::Get().SetShowTangents);
ToolbarBuilder.AddToolBarButton(FStaticMeshEditorCommands::Get().SetShowBinormals);
ToolbarBuilder.AddToolBarButton(FStaticMeshEditorCommands::Get().SetShowVertices);
ToolbarBuilder.AddToolBarButton(FStaticMeshEditorCommands::Get().SetDrawUVs);
ToolbarBuilder.AddToolBarButton(FStaticMeshEditorCommands::Get().SetDrawAdditionalData);
}
ToolbarBuilder.EndSection();
ToolbarBuilder.BeginSection("UV");
{
ToolbarBuilder.AddWidget(UVChannelCombo.ToSharedRef());
}
ToolbarBuilder.EndSection();
ToolbarBuilder.BeginSection("Camera");
{
ToolbarBuilder.AddToolBarButton(FStaticMeshEditorCommands::Get().ResetCamera);
}
ToolbarBuilder.EndSection();
ToolbarBuilder.BeginSection("LOD");
{
ToolbarBuilder.AddWidget(LODLevelCombo.ToSharedRef());
}
ToolbarBuilder.EndSection();
}
};
TSharedPtr<FExtender> ToolbarExtender = MakeShareable(new FExtender);
ToolbarExtender->AddToolBarExtension(
"Asset",
EExtensionHook::After,
Viewport->GetCommandList(),
FToolBarExtensionDelegate::CreateStatic( &Local::FillToolbar, UVChannelCombo, LODLevelCombo )
);
AddToolbarExtender(ToolbarExtender);
IStaticMeshEditorModule* StaticMeshEditorModule = &FModuleManager::LoadModuleChecked<IStaticMeshEditorModule>( "StaticMeshEditor" );
AddToolbarExtender(StaticMeshEditorModule->GetToolBarExtensibilityManager()->GetAllExtenders(GetToolkitCommands(), GetEditingObjects()));
}
void FStaticMeshEditor::BuildSubTools()
{
FSimpleDelegate OnSocketSelectionChanged = FSimpleDelegate::CreateSP( SharedThis(this), &FStaticMeshEditor::OnSocketSelectionChanged );
SocketManager = ISocketManager::CreateSocketManager( SharedThis(this) , OnSocketSelectionChanged );
SAssignNew( ConvexDecomposition, SConvexDecomposition )
.StaticMeshEditorPtr(SharedThis(this));
// Build toolbar widgets
UVChannelCombo = SNew(STextComboBox)
.OptionsSource(&UVChannels)
.OnSelectionChanged(this, &FStaticMeshEditor::ComboBoxSelectionChanged)
.IsEnabled( FSlateApplication::Get().GetNormalExecutionAttribute() );
if(UVChannels.IsValidIndex(0))
{
UVChannelCombo->SetSelectedItem(UVChannels[0]);
}
LODLevelCombo = SNew(STextComboBox)
.OptionsSource(&LODLevels)
.OnSelectionChanged(this, &FStaticMeshEditor::LODLevelsSelectionChanged)
.IsEnabled( FSlateApplication::Get().GetNormalExecutionAttribute() );
if(LODLevels.IsValidIndex(0))
{
LODLevelCombo->SetSelectedItem(LODLevels[0]);
}
AdvancedPreviewSettingsWidget = SNew(SAdvancedPreviewDetailsTab, Viewport->GetPreviewScene());
}
FName FStaticMeshEditor::GetToolkitFName() const
{
return FName("StaticMeshEditor");
}
FText FStaticMeshEditor::GetBaseToolkitName() const
{
return LOCTEXT("AppLabel", "StaticMesh Editor");
}
FString FStaticMeshEditor::GetWorldCentricTabPrefix() const
{
return LOCTEXT("WorldCentricTabPrefix", "StaticMesh ").ToString();
}
FLinearColor FStaticMeshEditor::GetWorldCentricTabColorScale() const
{
return FLinearColor( 0.3f, 0.2f, 0.5f, 0.5f );
}
UStaticMeshComponent* FStaticMeshEditor::GetStaticMeshComponent() const
{
return Viewport->GetStaticMeshComponent();
}
void FStaticMeshEditor::SetSelectedSocket(UStaticMeshSocket* InSelectedSocket)
{
SocketManager->SetSelectedSocket(InSelectedSocket);
}
UStaticMeshSocket* FStaticMeshEditor::GetSelectedSocket() const
{
check(SocketManager.IsValid());
return SocketManager->GetSelectedSocket();
}
void FStaticMeshEditor::DuplicateSelectedSocket()
{
SocketManager->DuplicateSelectedSocket();
}
void FStaticMeshEditor::RequestRenameSelectedSocket()
{
SocketManager->RequestRenameSelectedSocket();
}
bool FStaticMeshEditor::IsPrimValid(const FPrimData& InPrimData) const
{
if (StaticMesh->BodySetup)
{
const FKAggregateGeom* AggGeom = &StaticMesh->BodySetup->AggGeom;
switch (InPrimData.PrimType)
{
case KPT_Sphere:
return AggGeom->SphereElems.IsValidIndex(InPrimData.PrimIndex);
case KPT_Box:
return AggGeom->BoxElems.IsValidIndex(InPrimData.PrimIndex);
case KPT_Sphyl:
return AggGeom->SphylElems.IsValidIndex(InPrimData.PrimIndex);
case KPT_Convex:
return AggGeom->ConvexElems.IsValidIndex(InPrimData.PrimIndex);
}
}
return false;
}
bool FStaticMeshEditor::HasSelectedPrims() const
{
return (SelectedPrims.Num() > 0 ? true : false);
}
void FStaticMeshEditor::AddSelectedPrim(const FPrimData& InPrimData, bool bClearSelection)
{
check(IsPrimValid(InPrimData));
// Enable collision, if not already
if( !Viewport->GetViewportClient().IsSetShowWireframeCollisionChecked() )
{
Viewport->GetViewportClient().SetShowWireframeCollision();
}
if( bClearSelection )
{
ClearSelectedPrims();
}
SelectedPrims.Add(InPrimData);
}
void FStaticMeshEditor::RemoveSelectedPrim(const FPrimData& InPrimData)
{
SelectedPrims.Remove(InPrimData);
}
void FStaticMeshEditor::RemoveInvalidPrims()
{
for (int32 PrimIdx = SelectedPrims.Num() - 1; PrimIdx >= 0; PrimIdx--)
{
FPrimData& PrimData = SelectedPrims[PrimIdx];
if (!IsPrimValid(PrimData))
{
SelectedPrims.RemoveAt(PrimIdx);
}
}
}
bool FStaticMeshEditor::IsSelectedPrim(const FPrimData& InPrimData) const
{
return SelectedPrims.Contains(InPrimData);
}
void FStaticMeshEditor::ClearSelectedPrims()
{
SelectedPrims.Empty();
}
void FStaticMeshEditor::DuplicateSelectedPrims(const FVector* InOffset)
{
if (SelectedPrims.Num() > 0)
{
check(StaticMesh->BodySetup);
FKAggregateGeom* AggGeom = &StaticMesh->BodySetup->AggGeom;
GEditor->BeginTransaction(LOCTEXT("FStaticMeshEditor_DuplicateSelectedPrims", "Duplicate Collision"));
StaticMesh->BodySetup->Modify();
//Clear the cache (PIE may have created some data), create new GUID
StaticMesh->BodySetup->InvalidatePhysicsData();
for (int32 PrimIdx = 0; PrimIdx < SelectedPrims.Num(); PrimIdx++)
{
FPrimData& PrimData = SelectedPrims[PrimIdx];
check(IsPrimValid(PrimData));
switch (PrimData.PrimType)
{
case KPT_Sphere:
{
const FKSphereElem SphereElem = AggGeom->SphereElems[PrimData.PrimIndex];
PrimData.PrimIndex = AggGeom->SphereElems.Add(SphereElem);
}
break;
case KPT_Box:
{
const FKBoxElem BoxElem = AggGeom->BoxElems[PrimData.PrimIndex];
PrimData.PrimIndex = AggGeom->BoxElems.Add(BoxElem);
}
break;
case KPT_Sphyl:
{
const FKSphylElem SphylElem = AggGeom->SphylElems[PrimData.PrimIndex];
PrimData.PrimIndex = AggGeom->SphylElems.Add(SphylElem);
}
break;
case KPT_Convex:
{
const FKConvexElem ConvexElem = AggGeom->ConvexElems[PrimData.PrimIndex];
PrimData.PrimIndex = AggGeom->ConvexElems.Add(ConvexElem);
}
break;
}
// If specified, offset the duplicate by a specific amount
if (InOffset)
{
FTransform PrimTransform = GetPrimTransform(PrimData);
FVector PrimLocation = PrimTransform.GetLocation();
PrimLocation += *InOffset;
PrimTransform.SetLocation(PrimLocation);
SetPrimTransform(PrimData, PrimTransform);
}
}
// refresh collision change back to staticmesh components
RefreshCollisionChange(StaticMesh);
GEditor->EndTransaction();
// Mark staticmesh as dirty, to help make sure it gets saved.
StaticMesh->MarkPackageDirty();
// Update views/property windows
Viewport->RefreshViewport();
StaticMesh->bCustomizedCollision = true; //mark the static mesh for collision customization
}
}
void FStaticMeshEditor::TranslateSelectedPrims(const FVector& InDrag)
{
check(StaticMesh->BodySetup);
StaticMesh->BodySetup->InvalidatePhysicsData();
for (int32 PrimIdx = 0; PrimIdx < SelectedPrims.Num(); PrimIdx++)
{
const FPrimData& PrimData = SelectedPrims[PrimIdx];
FTransform PrimTransform = GetPrimTransform(PrimData);
FVector PrimLocation = PrimTransform.GetLocation();
PrimLocation += InDrag;
PrimTransform.SetLocation(PrimLocation);
SetPrimTransform(PrimData, PrimTransform);
}
// refresh collision change back to staticmesh components
RefreshCollisionChange(StaticMesh);
}
void FStaticMeshEditor::RotateSelectedPrims(const FRotator& InRot)
{
check(StaticMesh->BodySetup);
StaticMesh->BodySetup->InvalidatePhysicsData();
const FQuat DeltaQ = InRot.Quaternion();
for (int32 PrimIdx = 0; PrimIdx < SelectedPrims.Num(); PrimIdx++)
{
const FPrimData& PrimData = SelectedPrims[PrimIdx];
FTransform PrimTransform = GetPrimTransform(PrimData);
FRotator ActorRotWind, ActorRotRem;
PrimTransform.Rotator().GetWindingAndRemainder(ActorRotWind, ActorRotRem);
const FQuat ActorQ = ActorRotRem.Quaternion();
FRotator NewActorRotRem = FRotator(DeltaQ * ActorQ);
NewActorRotRem.Normalize();
PrimTransform.SetRotation(NewActorRotRem.Quaternion());
SetPrimTransform(PrimData, PrimTransform);
}
// refresh collision change back to staticmesh components
RefreshCollisionChange(StaticMesh);
}
void FStaticMeshEditor::ScaleSelectedPrims(const FVector& InScale)
{
check(StaticMesh->BodySetup);
StaticMesh->BodySetup->InvalidatePhysicsData();
FKAggregateGeom* AggGeom = &StaticMesh->BodySetup->AggGeom;
FVector ModifiedScale = InScale;
if (GEditor->UsePercentageBasedScaling())
{
ModifiedScale = InScale * ((GEditor->GetScaleGridSize() / 100.0f) / GEditor->GetGridSize());
}
//Multiply in estimated size of the mesh so scaling of sphere, box and sphyl is similar speed to other scaling
float SimplePrimitiveScaleSpeedFactor = StaticMesh->GetBounds().SphereRadius;
for (int32 PrimIdx = 0; PrimIdx < SelectedPrims.Num(); PrimIdx++)
{
const FPrimData& PrimData = SelectedPrims[PrimIdx];
check(IsPrimValid(PrimData));
switch (PrimData.PrimType)
{
case KPT_Sphere:
AggGeom->SphereElems[PrimData.PrimIndex].ScaleElem(SimplePrimitiveScaleSpeedFactor * ModifiedScale, MinPrimSize);
break;
case KPT_Box:
AggGeom->BoxElems[PrimData.PrimIndex].ScaleElem(SimplePrimitiveScaleSpeedFactor * ModifiedScale, MinPrimSize);
break;
case KPT_Sphyl:
AggGeom->SphylElems[PrimData.PrimIndex].ScaleElem(SimplePrimitiveScaleSpeedFactor * ModifiedScale, MinPrimSize);
break;
case KPT_Convex:
AggGeom->ConvexElems[PrimData.PrimIndex].ScaleElem(ModifiedScale, MinPrimSize);
break;
}
StaticMesh->bCustomizedCollision = true; //mark the static mesh for collision customization
}
// refresh collision change back to staticmesh components
RefreshCollisionChange(StaticMesh);
}
bool FStaticMeshEditor::CalcSelectedPrimsAABB(FBox &OutBox) const
{
check(StaticMesh->BodySetup);
FKAggregateGeom* AggGeom = &StaticMesh->BodySetup->AggGeom;
for (int32 PrimIdx = 0; PrimIdx < SelectedPrims.Num(); PrimIdx++)
{
const FPrimData& PrimData = SelectedPrims[PrimIdx];
check(IsPrimValid(PrimData));
switch (PrimData.PrimType)
{
case KPT_Sphere:
OutBox += AggGeom->SphereElems[PrimData.PrimIndex].CalcAABB(FTransform::Identity, 1.f);
break;
case KPT_Box:
OutBox += AggGeom->BoxElems[PrimData.PrimIndex].CalcAABB(FTransform::Identity, 1.f);
break;
case KPT_Sphyl:
OutBox += AggGeom->SphylElems[PrimData.PrimIndex].CalcAABB(FTransform::Identity, 1.f);
break;
case KPT_Convex:
OutBox += AggGeom->ConvexElems[PrimData.PrimIndex].CalcAABB(FTransform::Identity, FVector(1.f));
break;
}
}
return HasSelectedPrims();
}
bool FStaticMeshEditor::GetLastSelectedPrimTransform(FTransform& OutTransform) const
{
if (SelectedPrims.Num() > 0)
{
check(StaticMesh->BodySetup);
const FKAggregateGeom* AggGeom = &StaticMesh->BodySetup->AggGeom;
const FPrimData& PrimData = SelectedPrims.Last();
check(IsPrimValid(PrimData));
switch (PrimData.PrimType)
{
case KPT_Sphere:
OutTransform = AggGeom->SphereElems[PrimData.PrimIndex].GetTransform();
break;
case KPT_Box:
OutTransform = AggGeom->BoxElems[PrimData.PrimIndex].GetTransform();
break;
case KPT_Sphyl:
OutTransform = AggGeom->SphylElems[PrimData.PrimIndex].GetTransform();
break;
case KPT_Convex:
OutTransform = AggGeom->ConvexElems[PrimData.PrimIndex].GetTransform();
break;
}
}
return HasSelectedPrims();
}
FTransform FStaticMeshEditor::GetPrimTransform(const FPrimData& InPrimData) const
{
check(StaticMesh->BodySetup);
const FKAggregateGeom* AggGeom = &StaticMesh->BodySetup->AggGeom;
check(IsPrimValid(InPrimData));
switch (InPrimData.PrimType)
{
case KPT_Sphere:
return AggGeom->SphereElems[InPrimData.PrimIndex].GetTransform();
case KPT_Box:
return AggGeom->BoxElems[InPrimData.PrimIndex].GetTransform();
case KPT_Sphyl:
return AggGeom->SphylElems[InPrimData.PrimIndex].GetTransform();
case KPT_Convex:
return AggGeom->ConvexElems[InPrimData.PrimIndex].GetTransform();
}
return FTransform::Identity;
}
void FStaticMeshEditor::SetPrimTransform(const FPrimData& InPrimData, const FTransform& InPrimTransform) const
{
check(StaticMesh->BodySetup);
FKAggregateGeom* AggGeom = &StaticMesh->BodySetup->AggGeom;
check(IsPrimValid(InPrimData));
switch (InPrimData.PrimType)
{
case KPT_Sphere:
AggGeom->SphereElems[InPrimData.PrimIndex].SetTransform(InPrimTransform);
break;
case KPT_Box:
AggGeom->BoxElems[InPrimData.PrimIndex].SetTransform(InPrimTransform);
break;
case KPT_Sphyl:
AggGeom->SphylElems[InPrimData.PrimIndex].SetTransform(InPrimTransform);
break;
case KPT_Convex:
AggGeom->ConvexElems[InPrimData.PrimIndex].SetTransform(InPrimTransform);
break;
}
StaticMesh->bCustomizedCollision = true; //mark the static mesh for collision customization
}
bool FStaticMeshEditor::OverlapsExistingPrim(const FPrimData& InPrimData) const
{
check(StaticMesh->BodySetup);
const FKAggregateGeom* AggGeom = &StaticMesh->BodySetup->AggGeom;
// Assume that if the transform of the prim is the same, then it overlaps (FKConvexElem doesn't have an operator==, and no shape takes tolerances into account)
check(IsPrimValid(InPrimData));
switch (InPrimData.PrimType)
{
case KPT_Sphere:
{
const FKSphereElem InSphereElem = AggGeom->SphereElems[InPrimData.PrimIndex];
const FTransform InElemTM = InSphereElem.GetTransform();
for (int32 i = 0; i < AggGeom->SphereElems.Num(); ++i)
{
if( i == InPrimData.PrimIndex )
{
continue;
}
const FKSphereElem& SphereElem = AggGeom->SphereElems[i];
const FTransform ElemTM = SphereElem.GetTransform();
if( InElemTM.Equals(ElemTM) )
{
return true;
}
}
}
break;
case KPT_Box:
{
const FKBoxElem InBoxElem = AggGeom->BoxElems[InPrimData.PrimIndex];
const FTransform InElemTM = InBoxElem.GetTransform();
for (int32 i = 0; i < AggGeom->BoxElems.Num(); ++i)
{
if( i == InPrimData.PrimIndex )
{
continue;
}
const FKBoxElem& BoxElem = AggGeom->BoxElems[i];
const FTransform ElemTM = BoxElem.GetTransform();
if( InElemTM.Equals(ElemTM) )
{
return true;
}
}
}
break;
case KPT_Sphyl:
{
const FKSphylElem InSphylElem = AggGeom->SphylElems[InPrimData.PrimIndex];
const FTransform InElemTM = InSphylElem.GetTransform();
for (int32 i = 0; i < AggGeom->SphylElems.Num(); ++i)
{
if( i == InPrimData.PrimIndex )
{
continue;
}
const FKSphylElem& SphylElem = AggGeom->SphylElems[i];
const FTransform ElemTM = SphylElem.GetTransform();
if( InElemTM.Equals(ElemTM) )
{
return true;
}
}
}
break;
case KPT_Convex:
{
const FKConvexElem InConvexElem = AggGeom->ConvexElems[InPrimData.PrimIndex];
const FTransform InElemTM = InConvexElem.GetTransform();
for (int32 i = 0; i < AggGeom->ConvexElems.Num(); ++i)
{
if( i == InPrimData.PrimIndex )
{
continue;
}
const FKConvexElem& ConvexElem = AggGeom->ConvexElems[i];
const FTransform ElemTM = ConvexElem.GetTransform();
if( InElemTM.Equals(ElemTM) )
{
return true;
}
}
}
break;
}
return false;
}
void FStaticMeshEditor::RefreshTool()
{
int32 NumLODs = StaticMesh->GetNumLODs();
for (int32 LODIndex = 0; LODIndex < NumLODs; ++LODIndex)
{
UpdateLODStats(LODIndex);
}
bool bForceRefresh = true;
StaticMeshDetailsView->SetObject( StaticMesh, bForceRefresh );
RegenerateLODComboList();
RegenerateUVChannelComboList();
RefreshViewport();
}
void FStaticMeshEditor::RefreshViewport()
{
Viewport->RefreshViewport();
}
void FStaticMeshEditor::RegenerateLODComboList()
{
if( StaticMesh->RenderData )
{
int32 OldLOD = GetCurrentLODLevel();
NumLODLevels = StaticMesh->RenderData->LODResources.Num();
// Fill out the LOD level combo.
LODLevels.Empty();
LODLevels.Add( MakeShareable( new FString( LOCTEXT("AutoLOD", "Auto LOD").ToString() ) ) );
LODLevels.Add( MakeShareable( new FString( LOCTEXT("BaseLOD", "Base LOD").ToString() ) ) );
for(int32 LODLevelID = 1; LODLevelID < NumLODLevels; ++LODLevelID)
{
LODLevels.Add( MakeShareable( new FString( FString::Printf(*LOCTEXT("LODLevel_ID", "LOD Level %d").ToString(), LODLevelID ) ) ) );
}
if( LODLevelCombo.IsValid() )
{
LODLevelCombo->RefreshOptions();
if( OldLOD < LODLevels.Num() )
{
LODLevelCombo->SetSelectedItem(LODLevels[OldLOD]);
}
else
{
LODLevelCombo->SetSelectedItem(LODLevels[0]);
}
}
}
else
{
NumLODLevels = 0;
LODLevels.Empty();
LODLevels.Add( MakeShareable( new FString( LOCTEXT("AutoLOD", "Auto LOD").ToString() ) ) );
}
}
void FStaticMeshEditor::RegenerateUVChannelComboList()
{
int32 OldUVChannel = GetCurrentUVChannel();
// Fill out the UV channels combo.
UVChannels.Empty();
int32 MaxUVChannels = FMath::Max<int32>(GetNumUVChannels(),1);
for(int32 UVChannelID = 0; UVChannelID < MaxUVChannels; ++UVChannelID)
{
UVChannels.Add( MakeShareable( new FString( FText::Format( LOCTEXT("UVChannel_ID", "UV Channel {0}"), FText::AsNumber( UVChannelID ) ).ToString() ) ) );
}
if(UVChannelCombo.IsValid())
{
UVChannelCombo->RefreshOptions();
if( OldUVChannel >= 0 && OldUVChannel < GetNumUVChannels() )
{
UVChannelCombo->SetSelectedItem(UVChannels[OldUVChannel]);
}
else
{
UVChannelCombo->SetSelectedItem(UVChannels[0]);
}
}
}
void FStaticMeshEditor::UpdateLODStats(int32 CurrentLOD)
{
NumTriangles[CurrentLOD] = 0;
NumVertices[CurrentLOD] = 0;
NumUVChannels[CurrentLOD] = 0;
NumLODLevels = 0;
if( StaticMesh->RenderData )
{
NumLODLevels = StaticMesh->RenderData->LODResources.Num();
if (CurrentLOD >= 0 && CurrentLOD < NumLODLevels)
{
FStaticMeshLODResources& LODModel = StaticMesh->RenderData->LODResources[CurrentLOD];
NumTriangles[CurrentLOD] = LODModel.GetNumTriangles();
NumVertices[CurrentLOD] = LODModel.GetNumVertices();
NumUVChannels[CurrentLOD] = LODModel.VertexBuffer.GetNumTexCoords();
}
}
}
void FStaticMeshEditor::ComboBoxSelectionChanged( TSharedPtr<FString> NewSelection, ESelectInfo::Type /*SelectInfo*/ )
{
Viewport->RefreshViewport();
}
void FStaticMeshEditor::LODLevelsSelectionChanged( TSharedPtr<FString> NewSelection, ESelectInfo::Type /*SelectInfo*/ )
{
int32 CurrentLOD = GetCurrentLODLevel();
UpdateLODStats( CurrentLOD > 0? CurrentLOD - 1 : 0 );
Viewport->ForceLODLevel(CurrentLOD);
}
int32 FStaticMeshEditor::GetCurrentUVChannel()
{
int32 Index = 0;
UVChannels.Find(UVChannelCombo->GetSelectedItem(), Index);
return Index;
}
int32 FStaticMeshEditor::GetCurrentLODLevel()
{
int32 Index = 0;
LODLevels.Find(LODLevelCombo->GetSelectedItem(), Index);
return Index;
}
int32 FStaticMeshEditor::GetCurrentLODIndex()
{
int32 Index = LODLevels.Find(LODLevelCombo->GetSelectedItem());
return Index == 0? 0 : Index - 1;
}
void FStaticMeshEditor::GenerateKDop(const FVector* Directions, uint32 NumDirections)
{
TArray<FVector> DirArray;
for(uint32 DirectionIndex = 0;DirectionIndex < NumDirections;DirectionIndex++)
{
DirArray.Add(Directions[DirectionIndex]);
}
GEditor->BeginTransaction(LOCTEXT("FStaticMeshEditor_GenerateKDop", "Create Convex Collision"));
const int32 PrimIndex = GenerateKDopAsSimpleCollision(StaticMesh, DirArray);
GEditor->EndTransaction();
if (PrimIndex != INDEX_NONE)
{
if (FEngineAnalytics::IsAvailable())
{
FEngineAnalytics::GetProvider().RecordEvent(TEXT("Editor.Usage.StaticMesh.Collision"), TEXT("Type"), TEXT("KDop Collision"));
}
const FPrimData PrimData = FPrimData(KPT_Convex, PrimIndex);
ClearSelectedPrims();
AddSelectedPrim(PrimData, true);
// Don't 'nudge' KDop prims, as they are fitted specifically around the geometry
}
Viewport->RefreshViewport();
}
void FStaticMeshEditor::OnCollisionBox()
{
GEditor->BeginTransaction(LOCTEXT("FStaticMeshEditor_OnCollisionBox", "Create Box Collision"));
const int32 PrimIndex = GenerateBoxAsSimpleCollision(StaticMesh);
GEditor->EndTransaction();
if (PrimIndex != INDEX_NONE)
{
if (FEngineAnalytics::IsAvailable())
{
FEngineAnalytics::GetProvider().RecordEvent(TEXT("Editor.Usage.StaticMesh.Collision"), TEXT("Type"), TEXT("Box Collision"));
}
const FPrimData PrimData = FPrimData(KPT_Box, PrimIndex);
ClearSelectedPrims();
AddSelectedPrim(PrimData, true);
while( OverlapsExistingPrim(PrimData) )
{
TranslateSelectedPrims(OverlapNudge);
}
}
Viewport->RefreshViewport();
}
void FStaticMeshEditor::OnCollisionSphere()
{
GEditor->BeginTransaction(LOCTEXT("FStaticMeshEditor_OnCollisionSphere", "Create Sphere Collision"));
const int32 PrimIndex = GenerateSphereAsSimpleCollision(StaticMesh);
GEditor->EndTransaction();
if (PrimIndex != INDEX_NONE)
{
if (FEngineAnalytics::IsAvailable())
{
FEngineAnalytics::GetProvider().RecordEvent(TEXT("Editor.Usage.StaticMesh.Collision"), TEXT("Type"), TEXT("Sphere Collision"));
}
const FPrimData PrimData = FPrimData(KPT_Sphere, PrimIndex);
ClearSelectedPrims();
AddSelectedPrim(PrimData, true);
while( OverlapsExistingPrim(PrimData) )
{
TranslateSelectedPrims(OverlapNudge);
}
}
Viewport->RefreshViewport();
}
void FStaticMeshEditor::OnCollisionSphyl()
{
GEditor->BeginTransaction(LOCTEXT("FStaticMeshEditor_OnCollisionSphyl", "Create Capsule Collision"));
const int32 PrimIndex = GenerateSphylAsSimpleCollision(StaticMesh);
GEditor->EndTransaction();
if (PrimIndex != INDEX_NONE)
{
if (FEngineAnalytics::IsAvailable())
{
FEngineAnalytics::GetProvider().RecordEvent(TEXT("Editor.Usage.StaticMesh.Collision"), TEXT("Type"), TEXT("Capsule Collision"));
}
const FPrimData PrimData = FPrimData(KPT_Sphyl, PrimIndex);
ClearSelectedPrims();
AddSelectedPrim(PrimData, true);
while( OverlapsExistingPrim(PrimData) )
{
TranslateSelectedPrims(OverlapNudge);
}
}
Viewport->RefreshViewport();
}
void FStaticMeshEditor::OnRemoveCollision(void)
{
UBodySetup* BS = StaticMesh->BodySetup;
check(BS != NULL && BS->AggGeom.GetElementCount() > 0);
ClearSelectedPrims();
// Make sure rendering is done - so we are not changing data being used by collision drawing.
FlushRenderingCommands();
GEditor->BeginTransaction(LOCTEXT("FStaticMeshEditor_RemoveCollision", "Remove Collision"));
StaticMesh->BodySetup->Modify();
StaticMesh->BodySetup->RemoveSimpleCollision();
GEditor->EndTransaction();
// refresh collision change back to staticmesh components
RefreshCollisionChange(StaticMesh);
// Mark staticmesh as dirty, to help make sure it gets saved.
StaticMesh->MarkPackageDirty();
// Update views/property windows
Viewport->RefreshViewport();
StaticMesh->bCustomizedCollision = true; //mark the static mesh for collision customization
}
bool FStaticMeshEditor::CanRemoveCollision()
{
UBodySetup* BS = StaticMesh->BodySetup;
return (BS != NULL && BS->AggGeom.GetElementCount() > 0);
}
/** Util for adding vertex to an array if it is not already present. */
static void AddVertexIfNotPresent(TArray<FVector>& Vertices, const FVector& NewVertex)
{
bool bIsPresent = false;
for(int32 i=0; i<Vertices.Num(); i++)
{
float diffSqr = (NewVertex - Vertices[i]).SizeSquared();
if(diffSqr < 0.01f * 0.01f)
{
bIsPresent = 1;
break;
}
}
if(!bIsPresent)
{
Vertices.Add(NewVertex);
}
}
void FStaticMeshEditor::OnConvertBoxToConvexCollision()
{
// If we have a collision model for this staticmesh, ask if we want to replace it.
if (StaticMesh->BodySetup != NULL)
{
int32 ShouldReplace = FMessageDialog::Open( EAppMsgType::YesNo, LOCTEXT("ConvertBoxCollisionPrompt", "Are you sure you want to convert all box collision?") );
if (ShouldReplace == EAppReturnType::Yes)
{
UBodySetup* BodySetup = StaticMesh->BodySetup;
int32 NumBoxElems = BodySetup->AggGeom.BoxElems.Num();
if (NumBoxElems > 0)
{
ClearSelectedPrims();
// Make sure rendering is done - so we are not changing data being used by collision drawing.
FlushRenderingCommands();
FKConvexElem* NewConvexColl = NULL;
//For each box elem, calculate the new convex collision representation
//Stored in a temp array so we can undo on failure.
TArray<FKConvexElem> TempArray;
for (int32 i=0; i<NumBoxElems; i++)
{
const FKBoxElem& BoxColl = BodySetup->AggGeom.BoxElems[i];
//Create a new convex collision element
NewConvexColl = new(TempArray) FKConvexElem();
NewConvexColl->ConvexFromBoxElem(BoxColl);
}
//Clear the cache (PIE may have created some data), create new GUID
BodySetup->InvalidatePhysicsData();
//Copy the new data into the static mesh
BodySetup->AggGeom.ConvexElems.Append(TempArray);
//Clear out what we just replaced
BodySetup->AggGeom.BoxElems.Empty();
BodySetup->CreatePhysicsMeshes();
// Select the new prims
FKAggregateGeom* AggGeom = &StaticMesh->BodySetup->AggGeom;
for (int32 i = 0; i < NumBoxElems; ++i)
{
AddSelectedPrim(FPrimData(KPT_Convex, (AggGeom->ConvexElems.Num() - (i+1))), false);
}
RefreshCollisionChange(StaticMesh);
// Mark static mesh as dirty, to help make sure it gets saved.
StaticMesh->MarkPackageDirty();
// Update views/property windows
Viewport->RefreshViewport();
StaticMesh->bCustomizedCollision = true; //mark the static mesh for collision customization
}
}
}
}
void FStaticMeshEditor::OnCopyCollisionFromSelectedStaticMesh()
{
UStaticMesh* SelectedMesh = GetFirstSelectedStaticMeshInContentBrowser();
check(SelectedMesh && SelectedMesh != StaticMesh && SelectedMesh->BodySetup != NULL);
UBodySetup* BodySetup = StaticMesh->BodySetup;
ClearSelectedPrims();
// Make sure rendering is done - so we are not changing data being used by collision drawing.
FlushRenderingCommands();
GEditor->BeginTransaction(LOCTEXT("FStaticMeshEditor_CopyCollisionFromSelectedStaticMesh", "Copy Collision from Selected Static Mesh"));
BodySetup->Modify();
// Copy body properties from
BodySetup->CopyBodyPropertiesFrom(SelectedMesh->BodySetup);
// Enable collision, if not already
if( !Viewport->GetViewportClient().IsSetShowWireframeCollisionChecked() )
{
Viewport->GetViewportClient().SetShowWireframeCollision();
}
// Invalidate physics data and create new meshes
BodySetup->InvalidatePhysicsData();
BodySetup->CreatePhysicsMeshes();
GEditor->EndTransaction();
RefreshCollisionChange(StaticMesh);
// Mark static mesh as dirty, to help make sure it gets saved.
StaticMesh->MarkPackageDirty();
// Redraw level editor viewports, in case the asset's collision is visible in a viewport and the viewport isn't set to realtime.
// Note: This could be more intelligent and only trigger a redraw if the asset is referenced in the world.
GUnrealEd->RedrawLevelEditingViewports();
// Update views/property windows
Viewport->RefreshViewport();
StaticMesh->bCustomizedCollision = true; //mark the static mesh for collision customization
}
bool FStaticMeshEditor::CanCopyCollisionFromSelectedStaticMesh() const
{
bool CanCopy = false;
TArray<FAssetData> SelectedAssets;
GEditor->GetContentBrowserSelections(SelectedAssets);
if(SelectedAssets.Num() == 1)
{
FAssetData& Asset = SelectedAssets[0];
if(Asset.GetClass() == UStaticMesh::StaticClass())
{
UStaticMesh* SelectedMesh = Cast<UStaticMesh>(Asset.GetAsset());
if(SelectedMesh && SelectedMesh != StaticMesh && SelectedMesh->BodySetup != NULL)
{
CanCopy = true;
}
}
}
return CanCopy;
}
UStaticMesh* FStaticMeshEditor::GetFirstSelectedStaticMeshInContentBrowser() const
{
TArray<FAssetData> SelectedAssets;
GEditor->GetContentBrowserSelections(SelectedAssets);
for(auto& Asset : SelectedAssets)
{
UStaticMesh* SelectedMesh = Cast<UStaticMesh>(Asset.GetAsset());
if(SelectedMesh)
{
return SelectedMesh;
}
}
return NULL;
}
void FStaticMeshEditor::SetEditorMesh(UStaticMesh* InStaticMesh)
{
ClearSelectedPrims();
StaticMesh = InStaticMesh;
//Init stat arrays.
const int32 ArraySize = MAX_STATIC_MESH_LODS;
NumVertices.Empty(ArraySize);
NumVertices.AddZeroed(ArraySize);
NumTriangles.Empty(ArraySize);
NumTriangles.AddZeroed(ArraySize);
NumUVChannels.Empty(ArraySize);
NumUVChannels.AddZeroed(ArraySize);
// Always default the LOD to 0 when setting the mesh.
UpdateLODStats(0);
// Fill out the LOD level combo.
LODLevels.Empty();
LODLevels.Add( MakeShareable( new FString( LOCTEXT("AutoLOD", "Auto LOD").ToString() ) ) );
LODLevels.Add( MakeShareable( new FString( LOCTEXT("BaseLOD", "Base LOD").ToString() ) ) );
for(int32 LODLevelID = 1; LODLevelID < NumLODLevels; ++LODLevelID)
{
LODLevels.Add( MakeShareable( new FString( FString::Printf(*LOCTEXT("LODLevel_ID", "LOD Level %d").ToString(), LODLevelID ) ) ) );
//Update LOD stats for each level
UpdateLODStats(LODLevelID);
}
// Fill out the UV channels combo.
UVChannels.Empty();
for(int32 UVChannelID = 0; UVChannelID < GetNumUVChannels(0); ++UVChannelID)
{
UVChannels.Add( MakeShareable( new FString( FText::Format( LOCTEXT("UVChannel_ID", "UV Channel {0}"), FText::AsNumber( UVChannelID ) ).ToString() ) ) );
}
if( UVChannelCombo.IsValid() )
{
UVChannelCombo->RefreshOptions();
if(UVChannels.Num())
{
UVChannelCombo->SetSelectedItem(UVChannels[0]);
}
}
if( LODLevelCombo.IsValid() )
{
LODLevelCombo->RefreshOptions();
if(LODLevels.Num())
{
LODLevelCombo->SetSelectedItem(LODLevels[0]);
}
}
// Set the details view.
StaticMeshDetailsView->SetObject(StaticMesh);
Viewport->UpdatePreviewMesh(StaticMesh);
Viewport->RefreshViewport();
}
void FStaticMeshEditor::OnChangeMesh()
{
UStaticMesh* SelectedMesh = GetFirstSelectedStaticMeshInContentBrowser();
check(SelectedMesh != NULL && SelectedMesh != StaticMesh);
RemoveEditingObject(StaticMesh);
AddEditingObject(SelectedMesh);
SetEditorMesh(SelectedMesh);
// Clear selections made on previous mesh
ClearSelectedPrims();
GetSelectedEdges().Empty();
if(SocketManager.IsValid())
{
SocketManager->UpdateStaticMesh();
}
}
bool FStaticMeshEditor::CanChangeMesh() const
{
bool CanChange = false;
TArray<FAssetData> SelectedAssets;
GEditor->GetContentBrowserSelections(SelectedAssets);
if(SelectedAssets.Num() == 1)
{
FAssetData& Asset = SelectedAssets[0];
if(Asset.GetClass() == UStaticMesh::StaticClass())
{
UStaticMesh* SelectedMesh = Cast<UStaticMesh>(Asset.GetAsset());
if(SelectedMesh && SelectedMesh != StaticMesh)
{
CanChange = true;
}
}
}
return CanChange;
}
void FStaticMeshEditor::OnSaveGeneratedLODs()
{
if (StaticMesh)
{
StaticMesh->GenerateLodsInPackage();
// Update editor UI as we modified LOD groups
auto Selected = StaticMeshDetailsView->GetSelectedObjects();
StaticMeshDetailsView->SetObjects(Selected, true);
// Update screen
Viewport->RefreshViewport();
}
}
void FStaticMeshEditor::DoDecomp(float InAccuracy, int32 InMaxHullVerts)
{
// Check we have a selected StaticMesh
if(StaticMesh && StaticMesh->RenderData)
{
FStaticMeshLODResources& LODModel = StaticMesh->RenderData->LODResources[0];
// Start a busy cursor so the user has feedback while waiting
const FScopedBusyCursor BusyCursor;
// Make vertex buffer
int32 NumVerts = LODModel.VertexBuffer.GetNumVertices();
TArray<FVector> Verts;
for(int32 i=0; i<NumVerts; i++)
{
FVector Vert = LODModel.PositionVertexBuffer.VertexPosition(i);
Verts.Add(Vert);
}
// Grab all indices
TArray<uint32> AllIndices;
LODModel.IndexBuffer.GetCopy(AllIndices);
// Only copy indices that have collision enabled
TArray<uint32> CollidingIndices;
for(const FStaticMeshSection& Section : LODModel.Sections)
{
if(Section.bEnableCollision)
{
for (uint32 IndexIdx = Section.FirstIndex; IndexIdx < Section.FirstIndex + (Section.NumTriangles * 3); IndexIdx++)
{
CollidingIndices.Add(AllIndices[IndexIdx]);
}
}
}
ClearSelectedPrims();
// Make sure rendering is done - so we are not changing data being used by collision drawing.
FlushRenderingCommands();
// Get the BodySetup we are going to put the collision into
UBodySetup* bs = StaticMesh->BodySetup;
if(bs)
{
bs->RemoveSimpleCollision();
}
else
{
// Otherwise, create one here.
StaticMesh->CreateBodySetup();
bs = StaticMesh->BodySetup;
}
// Run actual util to do the work (if we have some valid input)
if(Verts.Num() >= 3 && CollidingIndices.Num() >= 3)
{
DecomposeMeshToHulls(bs, Verts, CollidingIndices, InAccuracy, InMaxHullVerts);
}
// Enable collision, if not already
if( !Viewport->GetViewportClient().IsSetShowWireframeCollisionChecked() )
{
Viewport->GetViewportClient().SetShowWireframeCollision();
}
// refresh collision change back to staticmesh components
RefreshCollisionChange(StaticMesh);
// Mark mesh as dirty
StaticMesh->MarkPackageDirty();
// Update screen.
Viewport->RefreshViewport();
StaticMesh->bCustomizedCollision = true; //mark the static mesh for collision customization
}
}
TSet< int32 >& FStaticMeshEditor::GetSelectedEdges()
{
return Viewport->GetSelectedEdges();
}
int32 FStaticMeshEditor::GetNumTriangles( int32 LODLevel ) const
{
return NumTriangles.IsValidIndex(LODLevel) ? NumTriangles[LODLevel] : 0;
}
int32 FStaticMeshEditor::GetNumVertices( int32 LODLevel ) const
{
return NumVertices.IsValidIndex(LODLevel) ? NumVertices[LODLevel] : 0;
}
int32 FStaticMeshEditor::GetNumUVChannels( int32 LODLevel ) const
{
return NumUVChannels.IsValidIndex(LODLevel) ? NumUVChannels[LODLevel] : 0;
}
void FStaticMeshEditor::DeleteSelected()
{
if (GetSelectedSocket())
{
DeleteSelectedSockets();
}
if (HasSelectedPrims())
{
DeleteSelectedPrims();
}
}
bool FStaticMeshEditor::CanDeleteSelected() const
{
return (GetSelectedSocket() != NULL || HasSelectedPrims());
}
void FStaticMeshEditor::DeleteSelectedSockets()
{
check(SocketManager.IsValid());
SocketManager->DeleteSelectedSocket();
}
void FStaticMeshEditor::DeleteSelectedPrims()
{
if (SelectedPrims.Num() > 0)
{
// Sort the selected prims by PrimIndex so when we're deleting them we don't mess up other prims indicies
struct FCompareFPrimDataPrimIndex
{
FORCEINLINE bool operator()(const FPrimData& A, const FPrimData& B) const
{
return A.PrimIndex < B.PrimIndex;
}
};
SelectedPrims.Sort(FCompareFPrimDataPrimIndex());
check(StaticMesh->BodySetup);
FKAggregateGeom* AggGeom = &StaticMesh->BodySetup->AggGeom;
GEditor->BeginTransaction(LOCTEXT("FStaticMeshEditor_DeleteSelectedPrims", "Delete Collision"));
StaticMesh->BodySetup->Modify();
for (int32 PrimIdx = SelectedPrims.Num() - 1; PrimIdx >= 0; PrimIdx--)
{
const FPrimData& PrimData = SelectedPrims[PrimIdx];
check(IsPrimValid(PrimData));
switch (PrimData.PrimType)
{
case KPT_Sphere:
AggGeom->SphereElems.RemoveAt(PrimData.PrimIndex);
break;
case KPT_Box:
AggGeom->BoxElems.RemoveAt(PrimData.PrimIndex);
break;
case KPT_Sphyl:
AggGeom->SphylElems.RemoveAt(PrimData.PrimIndex);
break;
case KPT_Convex:
AggGeom->ConvexElems.RemoveAt(PrimData.PrimIndex);
break;
}
}
GEditor->EndTransaction();
ClearSelectedPrims();
// Make sure rendering is done - so we are not changing data being used by collision drawing.
FlushRenderingCommands();
// Make sure to invalidate cooked data
StaticMesh->BodySetup->InvalidatePhysicsData();
// refresh collision change back to staticmesh components
RefreshCollisionChange(StaticMesh);
// Mark staticmesh as dirty, to help make sure it gets saved.
StaticMesh->MarkPackageDirty();
// Update views/property windows
Viewport->RefreshViewport();
StaticMesh->bCustomizedCollision = true; //mark the static mesh for collision customization
}
}
void FStaticMeshEditor::DuplicateSelected()
{
DuplicateSelectedSocket();
const FVector InitialOffset(20.f);
DuplicateSelectedPrims(&InitialOffset);
}
bool FStaticMeshEditor::CanDuplicateSelected() const
{
return (GetSelectedSocket() != NULL || HasSelectedPrims());
}
bool FStaticMeshEditor::CanRenameSelected() const
{
return (GetSelectedSocket() != NULL);
}
void FStaticMeshEditor::ExecuteFindInExplorer()
{
if ( ensure(StaticMesh->AssetImportData) )
{
const FString SourceFilePath = StaticMesh->AssetImportData->GetFirstFilename();
if ( SourceFilePath.Len() && IFileManager::Get().FileSize( *SourceFilePath ) != INDEX_NONE )
{
FPlatformProcess::ExploreFolder( *FPaths::GetPath(SourceFilePath) );
}
}
}
bool FStaticMeshEditor::CanExecuteSourceCommands() const
{
if ( !StaticMesh->AssetImportData )
{
return false;
}
const FString& SourceFilePath = StaticMesh->AssetImportData->GetFirstFilename();
return SourceFilePath.Len() && IFileManager::Get().FileSize(*SourceFilePath) != INDEX_NONE;
}
void FStaticMeshEditor::OnObjectReimported(UObject* InObject)
{
// Make sure we are using the object that is being reimported, otherwise a lot of needless work could occur.
if(StaticMesh == InObject)
{
SetEditorMesh(Cast<UStaticMesh>(InObject));
}
}
void FStaticMeshEditor::SaveAsset_Execute()
{
//Clean the unused Material entry before saving
if (StaticMesh)
{
for (int32 MaterialIndex = 0; MaterialIndex < StaticMesh->StaticMaterials.Num(); ++MaterialIndex)
{
bool MaterialIsUsed = false;
for (int32 LODIndex = 0; LODIndex < StaticMesh->GetNumLODs(); ++LODIndex)
{
for (int32 SectionIndex = 0; SectionIndex < StaticMesh->GetNumSections(LODIndex); ++SectionIndex)
{
FMeshSectionInfo Info = StaticMesh->SectionInfoMap.Get(LODIndex, SectionIndex);
if (Info.MaterialIndex == MaterialIndex)
{
MaterialIsUsed = true;
break;
}
}
}
if (!MaterialIsUsed)
{
StaticMesh->StaticMaterials[MaterialIndex].MaterialInterface = nullptr;
StaticMesh->Modify();
StaticMesh->PostEditChange();
if (StaticMesh->BodySetup)
{
StaticMesh->BodySetup->CreatePhysicsMeshes();
}
}
}
}
FAssetEditorToolkit::SaveAsset_Execute();
}
void FStaticMeshEditor::OnConvexDecomposition()
{
TabManager->InvokeTab(CollisionTabId);
}
bool FStaticMeshEditor::OnRequestClose()
{
bool bAllowClose = true;
if (StaticMeshDetails.IsValid() && StaticMeshDetails.Pin()->IsApplyNeeded())
{
// find out the user wants to do with this dirty material
EAppReturnType::Type YesNoCancelReply = FMessageDialog::Open(
EAppMsgType::YesNoCancel,
FText::Format( LOCTEXT("ShouldApplyLODChanges", "Would you like to apply level of detail changes to {0}?\n\n(No will lose all changes!)"), FText::FromString( StaticMesh->GetName() ) )
);
switch (YesNoCancelReply)
{
case EAppReturnType::Yes:
StaticMeshDetails.Pin()->ApplyChanges();
bAllowClose = true;
break;
case EAppReturnType::No:
// Do nothing, changes will be abandoned.
bAllowClose = true;
break;
case EAppReturnType::Cancel:
// Don't exit.
bAllowClose = false;
break;
}
}
return bAllowClose;
}
void FStaticMeshEditor::RegisterOnPostUndo( const FOnPostUndo& Delegate )
{
OnPostUndo.Add( Delegate );
}
void FStaticMeshEditor::UnregisterOnPostUndo( SWidget* Widget )
{
OnPostUndo.RemoveAll( Widget );
}
void FStaticMeshEditor::NotifyPostChange( const FPropertyChangedEvent& PropertyChangedEvent, UProperty* PropertyThatChanged )
{
if(StaticMesh && StaticMesh->BodySetup)
{
StaticMesh->BodySetup->CreatePhysicsMeshes();
}
}
void FStaticMeshEditor::UndoAction()
{
GEditor->UndoTransaction();
}
void FStaticMeshEditor::RedoAction()
{
GEditor->RedoTransaction();
}
void FStaticMeshEditor::PostUndo( bool bSuccess )
{
RemoveInvalidPrims();
OnPostUndo.Broadcast();
}
void FStaticMeshEditor::PostRedo( bool bSuccess )
{
RemoveInvalidPrims();
OnPostUndo.Broadcast();
}
void FStaticMeshEditor::OnSocketSelectionChanged()
{
UStaticMeshSocket* SelectedSocket = GetSelectedSocket();
if (SelectedSocket)
{
ClearSelectedPrims();
}
Viewport->GetViewportClient().OnSocketSelectionChanged( SelectedSocket );
}
void FStaticMeshEditor::OnPostReimport(UObject* InObject, bool bSuccess)
{
// Ignore if this is regarding a different object
if ( InObject != StaticMesh )
{
return;
}
if (bSuccess)
{
RefreshTool();
}
}
#undef LOCTEXT_NAMESPACE