Commit Graph

26 Commits

Author SHA1 Message Date
Richard TalbotWatkin
f9a4757e27 Fix clang build error.
[CL 2524134 by Richard TalbotWatkin in Main branch]
2015-04-24 07:20:48 -04:00
Richard TalbotWatkin
a3cfc2f2bb Big revamp to SplineComponent (continuing work-in-progress).
#jira UE-11822 - Add up vector, roll and scale properties to USplineComponent which can be used when calculating rotations/transforms at a point on the spline
#jira UE-13333 - BP spline components do not update when setting points
#jira UE-3637 - SplineComponent: Add a get transform at distance accessor

Summary of changes:
- FInterpCurve now natively understands looping. A input key can be set, at which point the spline will loop back to its start point.  Adjusted FInterpCurve methods to take looped curves into account.
- Fixed bugs in FInterpCurve regarding returning default values (T(ForceInit) instead of T() otherwise FVectors and FQuats are not initialized correctly).
- SplineComponent now holds three separate splines (location, rotation and scale).
- The SplineReparamTable is no longer transient, but is built and saved as part of the asset.
- Changed the SplineComponent API. All methods now take a ESplineCoordinateSpace value which specifies whether the values are intended for use in local or world space. The old methods have been deprecated but not removed (for now).
- bAllowSplineEditingPerInstance is deprecated. A new member (bSplineHasBeenEdited) has superseded it, and is set automatically when editing the spline with the visualizer. Added "Reset to Default" option in the visualizer, which restores the archetype defaults.
- SplineComponentVisualizer determines if spline points have been initialized by the user construction script, and, if so, will disallow editing. This is to conform with the general idea that the UCS always overrides property values.
- Fixed a number of bugs in the visualizer, and added new facilities to allow the scale and rotation to be edited (still work-in-progress).

[CL 2524087 by Richard TalbotWatkin in Main branch]
2015-04-24 06:25:50 -04:00
Marc Audy
a425eba9ed Unify Slate's FInputGesture and Engine's FInputChord as FInputChord defined in Slate
[CL 2481648 by Marc Audy in Main branch]
2015-03-17 11:36:28 -04:00
Richard TalbotWatkin
85412a495b Added facility to select multiple spline component keys.
#jira UE-6165 - Ability to multi-select spline component keys

[CL 2388280 by Richard TalbotWatkin in Main branch]
2014-12-15 03:05:31 -05:00
Ben Marsh
149375b14b Update copyright notices to 2015.
[CL 2379638 by Ben Marsh in Main branch]
2014-12-07 19:09:38 -05:00
Matthew Griffin
f1c4513760 Renaming FVector ClampSize and SafeNormal functions for clarity
Used DEPRECATED Macro to keep old names around in case I've missed anything

[CL 2370785 by Matthew Griffin in Main branch]
2014-11-26 10:01:12 -05:00
Richard TalbotWatkin
8adc094be5 Added tangent handles to spline visualization.
#jira UE-2726 - No tangent handle when editing

[CL 2364934 by Richard TalbotWatkin in Main branch]
2014-11-19 10:29:43 -05:00
Richard TalbotWatkin
4a236558c9 Added to SplineComponent: get/set spline point type; set editor colors for selected/unselected spline segments.
#jira UE-5024 - Implement user-definable colors for spline component visualizations

[CL 2354667 by Richard TalbotWatkin in Main branch]
2014-11-10 11:49:45 -05:00
Richard TalbotWatkin
c4eab00971 Added spline component Modify() calls in the various transactions, so that native components are undoable.
#jira UE-3418 - EDITOR: SPRITES: Cannot undo the duplicating of a 2D terrain spline point

[CL 2351387 by Richard TalbotWatkin in Main branch]
2014-11-06 15:09:39 -05:00
Richard TalbotWatkin
4257b9ad67 Added a closed loop property to SplineComponent. Also fixed small rendering bug (local space widget) in SplineComponent visualizer.
#ttp 338259 - SplineComponent: Add an option flag to close the spline
#branch UE4
#proj Editor.ComponentVisualizers, Runtime.Engine

[CL 2315996 by Richard TalbotWatkin in Main branch]
2014-10-01 11:14:01 -04:00
Richard TalbotWatkin
21f4bd5f3f Miscellaneous improvements to SplineComponentVisualizer.
#ttp 341724 - FEATURE REQUEST: PAPER2D: Add or insert a key into a terrain spline
#ttp 341720 - FEATURE REQUEST: PAPER2D: Rename Key on terrain splines
#ttp 341378 - Spline Component/Meshs: Controls points only editable in worldspace. no localpace transformation
#reviewedby James.Golding

[CL 2228433 by Richard TalbotWatkin in Main branch]
2014-07-23 09:40:19 -04:00
Richard TalbotWatkin
8515ee0486 Further SplineComponent improvements:
- Changed USplineComponent::SplineReparamTable to a transient member and force rebuild each time in PostLoad() / PostDuplicate().
- Initialize the SplineReparamTable size at the start to save needless reallocations (as its size is known from the beginning).
- Added menu options to set spline key types (curve, linear, constant)
- Added Reset to Automatic Tangent to allow resetting to either a clamped or an unclamped tangent.
#branch UE4
#proj Runtime.Engine, Editor.ComponentVisualizers
#reviewedby James.Golding, Michael.Noland

[CL 2119717 by Richard TalbotWatkin in Main branch]
2014-06-27 14:18:10 -04:00
Richard TalbotWatkin
24345aa70c Improvements to SplineComponent, and added a new way of handling UI Command Lists.
#add Added a new FUICommandList::ProcessCommandBindings overload, which can be called from a Viewport Client's InputKey() method (in the absence of an FKeyboardEvent object).
#add Fixed key binding handling in SplineComponentVisualizer so that it works through the FUICommandList, instead of being hardcoded.
#change USplineComponent - changed method by which spline reparam table is created (now uses the old method of splitting each segment into a fixed number of steps, instead of using fixed arc length reparameterization, which doesn't lead to such good results where the distance between control points varies largely throughout the spline).  The ReparamStepsPerSegment parameter remains, although I'd like to remove it when I can hit upon a better way to adaptively step through the spline.  Merged UpdateSplineReparamTable and AutoSetTangents into a single UpdateSpline method.
#add Added a parameter to FInterpCurve::AutoSetTangents - bStationaryEndpoints - which determines whether the endpoints should be assigned zero tangents, or whether the tangents should be set in order to extrapolate the curve beyond the endpoints, essentially providing a constant velocity at the start/end.
#add Added bStationaryEndpoints as an editable parameter to USplineComponent.  Use this if you only wish to traverse the spline at constant velocity, as it will lead to more accurate results.
#codereview James.Golding, Michael.Noland

[CL 2112073 by Richard TalbotWatkin in Main branch]
2014-06-20 14:38:07 -04:00
Andrew Rodham
ba3528c9d4 Made it possible for asset editors to maintain their own FEditorModeTools lists
Breaking changes include:
    * Rename of GEditorModeTools -> GLevelEditorModeTools to signify that it applies only to the level editor modes
    * Addition of FEditorModeRegistry, responsible for managing and creating new editor modes. Modes are no longer registered with an instance of the mode, instead with a mode factory that is able to create a new mode of that type.
    * Editor modes now operate on FEditorViewportClients rather than FLevelEditorViewportClients
    * Added ability to specify an FEditorModeTools when creating an FEditorViewport

Moved component vizualiser manager handling outside of individual editor modes, and into FLevelEditorViewportClient. This should make it easier to transplant in future.

This work addresses TTP#334640 - EDITOR: Investigate making editor modes a per-'editor' concept

Reviewed by Michael Noland, Matt Kuhlenschmidt

[CL 2109245 by Andrew Rodham in Main branch]
2014-06-18 10:16:16 -04:00
Jaroslaw Palczynski
ebce413232 UE4 Refactoring. Changed OVERRIDE and FINAL macros to keywords override and final.
[CL 2104397 by Jaroslaw Palczynski in Main branch]
2014-06-13 06:14:46 -04:00
Michael Noland
d165a31e16 Editor: Make spline editing widgets draw in foreground mode
#codereview james.golding

[CL 2102708 by Michael Noland in Main branch]
2014-06-12 00:41:53 -04:00
Michael Noland
4e77d916bf Editor: Splines now trigger a PostEditChangeProperty on the component when modified via the component visualizer
#codereview james.golding

[CL 2101367 by Michael Noland in Main branch]
2014-06-11 00:20:55 -04:00
Richard TalbotWatkin
2647b4ead2 Improvements to SplineComponent and its visualization.
#branch UE4
#proj Editor.ComponentVisualizers, Editor.UnrealEd, Runtime.Core, Runtime.Engine
#change FInterpCurve now uses a binary search to obtain the correct key. Removed the optional out-parameter on Eval, EvalDerivative, etc. Removed  FORCEINLINEs on large methods.
#change USplineComponent now builds the remap table with points spaced at equal distances, which leads to better results.  Added internal methods to obtain the segment length, and the interpolation parameter along the segment at a given distance.
#add Added Duration to USplineComponent.
#add Added a number of different methods for obtaining position, tangent and rotation at a specified distance, or a specified time (optionally at constant velocity).
#add Added methods for building the spline procedurally.
#add Supports right-click context menu on ComponentVisualizers in the standard interface.
#add Key tangents can be manually edited.
#change FLevelEditorViewportClient::ProcessClick now handles right clicks to the Unreal gizmo in the same manner as left clicks, i.e. the method recurses using a version of the hit proxy with the gizmo removed, so we can look at what's underneath.  This allows for "genuine" context menus, i.e. depending on what was clicked, instead of using a single default provided by the current level editor.
#reviewedby James.Golding

[CL 2089561 by Richard TalbotWatkin in Main branch]
2014-05-30 07:58:16 -04:00
James Golding
8429c9502c Improve spline remap table resolution
Notify actor of changes as we modify spline

[CL 2077748 by James Golding in Main branch]
2014-05-19 11:37:55 -04:00
James Golding
3833381459 Pass FComponentInstanceDataCache into OnConstruction, allowing us to apply data before running UCS
Remove ComponentInstanceDataCache.h from ActorComponent.h
Remove SplineComponent.h from Engine.h
Change splinecomp funcs to get get location/direction at point on spline to be world space (and normalized direction vector)
Update reparam table when editing spline
#codereview marc.audy

[CL 2077607 by James Golding in Main branch]
2014-05-19 09:42:46 -04:00
James Golding
869a79a418 Default to spline with auto tangents
Remove minor ticks
Misc fixes
Expose basic BP API

[CL 2075888 by James Golding in Main branch]
2014-05-16 15:43:46 -04:00
James Golding
85206f3f5b Initial checkin for editor functionality in ComponentVisualizers
Simplified SplineComponent, now a SceneComponent not a PrimitiveComponent
Added support for persisting SplineComp state across CS re-run
SplineComponentVisualizer editing started

[CL 2075479 by James Golding in Main branch]
2014-05-16 09:37:22 -04:00
Mikolaj Sieluzycki
bbcea54981 #ttp 303393 UObject improvement: Remove header groups
#proj core
#branch UE4
#summary Removed header groups, removed some redundant includes and replaced with forward declarations. Fixed compilation errors.

[CL 2055361 by Mikolaj Sieluzycki in Main branch]
2014-04-24 08:49:31 -04:00
Robert Manuszewski
86174fbbdf Back out changelist 2054304
[CL 2054447 by Robert Manuszewski in Main branch]
2014-04-23 20:18:11 -04:00
Mikolaj Sieluzycki
e9351fe5de #ttp 303393 UObject improvement: Remove header groups
#proj core
#branch UE4
#summary Removed header groups, removed some redundant includes and replaced with forward declarations. Fixed compilation errors.

[CL 2054304 by Mikolaj Sieluzycki in Main branch]
2014-04-23 20:15:15 -04:00