Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

Engine.SkeletalMeshComponent


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651
00652
00653
00654
00655
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674
00675
00676
00677
00678
00679
00680
00681
00682
00683
00684
00685
00686
00687
00688
00689
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707
00708
00709
00710
00711
00712
00713
00714
00715
00716
00717
00718
00719
00720
00721
00722
00723
00724
00725
00726
00727
00728
00729
00730
00731
00732
00733
00734
00735
00736
00737
00738
00739
00740
00741
00742
00743
00744
00745
00746
00747
00748
00749
00750
00751
00752
00753
00754
00755
00756
00757
00758
00759
00760
00761
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771
00772
00773
00774
00775
00776
00777
00778
00779
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806
00807
00808
00809
00810
00811
00812
00813
00814
00815
00816
00817
00818
00819
00820
00821
00822
00823
00824
00825
00826
00827
00828
00829
00830
00831
00832
/**
 * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved.
 */
class SkeletalMeshComponent extends MeshComponent
	native
	noexport
	dependson(AnimNode)
	hidecategories(Object)
	editinlinenew;

/** The skeletal mesh used by this component. */
var()	SkeletalMesh			SkeletalMesh;

/** The SkeletalMeshComponent that this one is possibly attached to. */
var		SkeletalMeshComponent	AttachedToSkelComponent;

/**
 *	This should point to the AnimTree in a content package.
 *	BeginPlay on this SkeletalMeshComponent will instance (copy) the tree and assign the instance to the Animations pointer.
 */
var()   const					AnimTree	AnimTreeTemplate;

/**
 *	This is the unique instance of the AnimTree used by this SkeletalMeshComponent.
 *	THIS SHOULD NEVER POINT TO AN ANIMTREE IN A CONTENT PACKAGE.
 */
var()	const editinline export	AnimNode	Animations;

/** Array of all AnimNodes in entire tree, in the order they should be ticked - that is, all parents appear before a child. */
var		const transient array<AnimNode>		AnimTickArray;

/**
 *	Physics and collision information used for this SkeletalMesh, set up in PhAT.
 *	This is used for per-bone hit detection, accurate bounding box calculation and ragdoll physics for example.
 */
var()	const PhysicsAsset										PhysicsAsset;

/**
 *	Any instanced physics engine information for this SkeletalMeshComponent.
 *	This is only required when you want to run physics or you want physical interaction with this skeletal mesh.
 */
var		const transient editinline export PhysicsAssetInstance	PhysicsAssetInstance;

/**
 *	Influence of rigid body physics on the mesh's pose (0.0 == use only animation, 1.0 == use only physics)
 */
var()	float					PhysicsWeight;

/** Used to scale speed of all animations on this skeletal mesh. */
var()	float					GlobalAnimRateScale;

var native transient const pointer MeshObject;
var() Color						WireframeColor;

/** Temporary array of of component-space bone matrices, update each frame and used for rendering the mesh. */
var native transient const array<matrix>				SpaceBases;

/** Temporary array of local-space (ie relative to parent bone) rotation/translation for each bone. */
var native transient const array<AnimNode.BoneAtom>		LocalAtoms;

/** Temporary array of bone indices required this frame. Filled in by UpdateSkelPose. */
var native transient const array<byte>					RequiredBones;

/**
 *	If set, this SkeletalMeshComponent will not use its Animations pointer to do its own animation blending, but will
 *	use the SpaceBases array in the ParentAnimComponent. This is used when constructing a character using multiple skeletal meshes sharing the same
 *	skeleton within the same Actor.
 */
var()	const SkeletalMeshComponent	ParentAnimComponent;

/**
 *	Mapping between bone indices in this component and the parent one. Each element is the index of the bone in the ParentAnimComponent.
 *	Size should be the same as SkeletalMesh.RefSkeleton size (ie number of bones in this skeleton).
 */
var native transient const array<int> ParentBoneMap;

/**
 *	The set of AnimSets that will be looked in to find a particular sequence, specified by name in an AnimNodeSequence.
 *	Array is search from last to first element, so you can replace a particular sequence but putting a set containing the new version later in the array.
 *	You will need to call SetAnim again on nodes that may be affected by any changes you make to this array.
 */
var()	array<AnimSet>			AnimSets;

/**
 *  Temporary array of AnimSets that are used as a backup target when the engine needs to temporarily modify the
 *	actor's animation set list. (e.g. Matinee playback)
 */
var native transient const array<AnimSet> TemporarySavedAnimSets;


// Morph targets

/**
 *	Array of MorphTargetSets that will be looked in to find a particular MorphTarget, specified by name.
 *	It is searched in the same way as the AnimSets array above.
 */
var()	array<MorphTargetSet>	MorphSets;

/** Struct used to indicate one active morph target that should be applied to this SkeletalMesh when rendered. */
struct ActiveMorph
{
	/** The morph target that we want to apply. */
	var	MorphTarget		Target;

	/** Strength of the morph target, between 0.0 and 1.0 */
	var	float			Weight;
};

/** Array indicating all active MorphTargets. This array is updated inside UpdateSkelPose based on the AnimTree's st of MorphNodes. */
var	array<ActiveMorph>	ActiveMorphs;


// Attachments.

struct Attachment
{
	var() editinline ActorComponent	Component;
	var() name						BoneName;
	var() vector					RelativeLocation;
	var() rotator					RelativeRotation;
	var() vector					RelativeScale;

	structdefaultproperties
	{
		RelativeScale=(X=1,Y=1,Z=1)
	}
};

var duplicatetransient const array<Attachment> Attachments;

var	transient const array<byte>	SkelControlIndex;

var() int			ForcedLodModel; // if 0, auto-select LOD level. if >0, force to (ForcedLodModel-1)
var	int			PredictedLODLevel;
var	int			OldPredictedLODLevel; // LOD level from previous frame, so we can detect changes in LOD to recalc required bones

/**	High (best) DistanceFactor that was desired for rendering this SkeletalMesh last frame. Represents how big this mesh was in screen space   */
var const float		MaxDistanceFactor;

var int			bForceWireframe;	// Forces the mesh to draw in wireframe mode.

/** If true, force the mesh into the reference pose - is an optimization. */
var int			bForceRefpose;
/** If bForceRefPose was set last tick. */
var int			bOldForceRefPose;

/** Skip UpdateSkelPose. */
var int			bNoSkeletonUpdate;

/** Draw the skeleton hierarchy for this skel mesh. */
var int			bDisplayBones;

/** Bool that enables debug drawing of the skeleton before it is passed to the physics. Useful for debugging animation-driven physics. */
var int			bShowPrePhysBones;

var int			bHideSkin;
var int			bForceRawOffset;
var int			bIgnoreControllers;
var	int			bTransformFromAnimParent;
var	const transient int	TickTag;
var const transient int	CachedAtomsTag;
var	const int	bUseSingleBodyPhysics;
var transient int	bRequiredBonesUpToDate;

/**
 *	If non-zero, skeletal mesh component will not update kinematic bones and bone springs when distance factor is greater than this (or has not been rendered for a while).
 *	This also turns off BlockRigidBody, so you do not get collisions with 'left behind' ragdoll setups.
 */
var float		MinDistFactorForKinematicUpdate;

/** When blending in physics, translate data from physics so that this bone aligns with its current graphics position. Can be useful for hacking 'frame behind' issues. */
var	name		PhysicsBlendZeroDriftBoneName;

/** Used to keep track of how many frames physics has been asleep for (when using PHYS_RigidBody). */
var transient int		FramesPhysicsAsleep;

/** When true, if owned by a PHYS_RigidBody Actor, skip all update (bones and bounds) when physics are asleep. */
var bool bSkipAllUpdateWhenPhysicsAsleep;

/** if true, update skeleton/attachments even when our Owner has not been rendered recently
 * @note if this is false, bone information may not be accurate, so be careful setting this to false if bone info is relevant to gameplay
 * @note you can use ForceSkelUpdate() to force an update
 */
var bool bUpdateSkelWhenNotRendered;

/** If true, do not apply any SkelControls when owner has not been rendered recently. */
var bool bIgnoreControllersWhenNotRendered;

/** If this is true, we are not updating kinematic bones and motors based on animation because the skeletal mesh is too far from any viewer. */
var	const bool bNotUpdatingKinematicDueToDistance;

/** force root motion to be discarded, no matter what the AnimNodeSequence(s) are set to do */
var() bool bForceDiscardRootMotion;

/**
 * if TRUE, notify owning actor of root motion mode changes.
 * This calls the Actor.RootMotionModeChanged() event.
 * This is useful for synchronizing movements.
 * For intance, when using RMM_Translate, and the event is called, we know that root motion will kick in on next frame.
 * It is possible to kill in-game physics, and then use root motion seemlessly.
 */
var bool bRootMotionModeChangeNotify;

/**
 * if TRUE, the event RootMotionExtracted() will be called on this owning actor,
 * after root motion has been extracted, and before it's been used.
 * This notification can be used to alter extracted root motion before it is forwarded to physics.
 */
var bool bRootMotionExtractedNotify;

/** If true, FaceFX will not automatically create material instances. */
var() bool bDisableFaceFXMaterialInstanceCreation;

/** If true, AnimTree has been initialised. */
var const transient bool bAnimTreeInitialised;

/**
 *	Indicates whether this SkeletalMeshComponent should have a physics engine representation of its state.
 *	@see SetHasPhysicsAssetInstance
 */
var() const bool bHasPhysicsAssetInstance;

/** If we are running physics, should we update bFixed bones based on the animation bone positions. */
var() bool	bUpdateKinematicBonesFromAnimation;

/**
 *	If we should pass joint position to joints each frame, so that they can be used by motorized joints to drive the
 *	ragdoll based on the animation.
 */
var() bool	bUpdateJointsFromAnimation;

/** Indicates whether this SkeletalMeshComponent is currently considered 'fixed' (ie kinematic) */
var const bool	bSkelCompFixed;

/** Used for consistency checking. Indicates that the results of physics have been blended into SpaceBases this frame. */
var	const bool	bHasHadPhysicsBlendedIn;

/**
 *	If true, attachments will be updated twice a frame - once in Tick and again when UpdateTransform is called.
 *	This can resolve some 'frame behind' issues if an attachment need to be in the correct location for it's Tick, but at a cost.
 */
var() bool	bForceUpdateAttachmentsInTick;

/** Enables blending in of physics bodies with the bAlwaysFullAnimWeight flag set. */
var() bool	bEnableFullAnimWeightBodies;

/**
 *	If true, when this skeletal mesh overlaps a physics volume, each body of it will be tested against the volume, so only limbs
 *	actually in the volume will be affected. Useful when gibbing bodies.
 */
var() bool		bPerBoneVolumeEffects;

/** If true, will move the Actors Location to match the root rigid body location when in PHYS_RigidBody. */
var() bool		bSyncActorLocationToRootRigidBody;

/** If TRUE, force usage of raw animation data when animating this skeletal mesh; if FALSE, use compressed data. */
var const bool	bUseRawData;

/** Disable warning when an AnimSequence is not found. FALSE by default. */
var bool		bDisableWarningWhenAnimNotFound;

/** if set, components that are attached to us have their bOwnerNoSee and bOnlyOwnerSee properties overridden by ours */
var bool bOverrideAttachmentOwnerVisibility;

/** pauses this component's animations (doesn't tick them) */
var bool bPauseAnims;
/** If true, DistanceFactor for this SkeletalMeshComponent will be added to global chart. */
var bool	bChartDistanceFactor;
// CLOTH
// Under Development! Not a fully supported feature at the moment.

/**
 *	Whether cloth simulation should currently be used on this SkeletalMeshComponent.
 *	@see SetEnableClothSimulation
 */
var(Cloth)	const bool		bEnableClothSimulation;

/** Turns off all cloth collision so not checks are done (improves performance). */
var(Cloth)	const bool		bDisableClothCollision;

/** If true, cloth is 'frozen' and no simulation is taking place for it, though it will keep its shape. */
var(Cloth)	const bool		bClothFrozen;

/** If true, cloth will automatically have bClothFrozen set when it is not rendered, and have it turned off when it is seen. */
var(Cloth)	bool			bAutoFreezeClothWhenNotRendered;

/** It true, clamp velocity of cloth particles to be within ClothOwnerVelClampRange of Base velocity. */
var(Cloth)	bool			bClothBaseVelClamp;

/** If true, fixed verts of the cloth are attached in the physics to the physics body that this components actor is attached to. */
var(Cloth)	bool			bAttachClothVertsToBaseBody;

/** Should anim sequence nodes cache the calculated values when not actually playing an animation? */
var bool bCacheAnimSequenceNodes;

/** Should the mesh object be updated even when the component hasn't recently been rendered (fixes popping for cinematic cuts) */
var bool bForceMeshObjectUpdates;

/** Constant force applied to all vertices in the cloth. */
var(Cloth)	const vector	ClothExternalForce;

/** 'Wind' force applied to cloth. Force on each vertex is based on the dot product between the wind vector and the surface normal. */
var(Cloth)	vector			ClothWind;

/** Amount of variance from base's velocity the cloth is allowed. */
var(Cloth)	vector			ClothBaseVelClampRange;

/** How much to blend in results from cloth simulation with results from regular skinning. */
var(Cloth)	float			ClothBlendWeight;

var const native transient pointer	ClothSim;
var const native transient int		SceneIndex;

var const array<vector> ClothMeshPosData;
var const array<vector> ClothMeshNormalData;
var const array<int> ClothMeshIndexData;
var int NumClothMeshVerts;
var int NumClothMeshIndices;

/** Cloth parent indices contain the index of the original vertex when a vertex is created during tearing.
 *  If it is an original vertex then the parent index is the same as the vertex index.
 */
var const array<int> ClothMeshParentData;
var int NumClothMeshParentIndices;

/** buffers used for reverse lookups to unweld vertices to support wrapped UVs. */
var const native transient array<vector>	ClothMeshWeldedPosData;
var const native transient array<vector>	ClothMeshWeldedNormalData;
var const native transient array<int>		ClothMeshWeldedIndexData;

/** flags to indicate which buffers were recently updated by the cloth simulation. */
var int ClothDirtyBufferFlag;

/** Enum indicating what type of object this cloth should be considered for rigid body collision. */
var(Cloth)	const ERBCollisionChannel			ClothRBChannel;

/** Types of objects that this cloth will collide with. */
var(Cloth)	const RBCollisionChannelContainer	ClothRBCollideWithChannels;

/** How much force to apply to cloth, in relation to the force(from a force field) applied to rigid bodies(zero applies no force to cloth, 1 applies the same) */
var(Cloth)	const float				ClothForceScale;

/**
    The cloth tear factor for this SkeletalMeshComponent, negative values take the tear factor from the SkeletalMesh.
    Note: UpdateClothParams() should be called after modification so that the changes are reflected in the simulation.
*/
var(Cloth)	const float				ClothAttachmentTearFactor;

var	material	LimitMaterial;

/** Root Motion extracted from animation. */
var const	transient	BoneAtom	RootMotionDelta;
/** Root Motion velocity for this frame, set from RootMotionDelta. */
var			transient	Vector		RootMotionVelocity;

/**
 * Offset of the root bone from the reference pose.
 * Used to offset bounding box.
 */
var const transient Vector	RootBoneTranslation;

/** Scale applied in physics when RootMotionMode == RMM_Accel */
var vector RootMotionAccelScale;

enum ERootMotionMode
{
	RMM_Translate,	// move actor with root motion
	RMM_Velocity,	// extract magnitude from root motion, and limit max Actor velocity with it.
	RMM_Ignore,		// do nothing
	RMM_Accel,		// extract velocity from root motion and use it to derive acceleration of the Actor
};
var() ERootMotionMode		RootMotionMode;
/** Previous Root Motion Mode, to catch changes */
var	const ERootMotionMode	PreviousRMM;

var		ERootMotionMode		PendingRMM;
var		ERootMotionMode		OldPendingRMM;

/** Handle one frame delay with PendingRMM */
var	const INT				bRMMOneFrameDelay;

/** Root Motion Rotation mode */
enum ERootMotionRotationMode
{
	/** Ignore rotation delta passed from animation. */
	RMRM_Ignore,
	/** Apply rotation delta to actor */
	RMRM_RotateActor,
};
var() ERootMotionRotationMode RootMotionRotationMode;

enum EFaceFXBlendMode
{
	/**
	 * Face FX overwrites relevant bones on skeletal mesh.
	 * Default.
	 */
	FXBM_Overwrite,
	/**
	 * Face FX transforms are relative to ref skeleton and added
	 * in parent bone space.
	 */
	FXBM_Additive,
};

/** How FaceFX transforms should be blended with skeletal mesh */
var()	EFaceFXBlendMode	FaceFXBlendMode;

/** The valid FaceFX register operations. */
enum EFaceFXRegOp
{
	FXRO_Add,	   // Add the register value with the Face Graph node value.
	FXRO_Multiply, // Multiply the register value with the Face Graph node value.
	FXRO_Replace,  // Replace the Face Graph node value with the register value.
};

/** The FaceFX actor instance associated with the skeletal mesh component. */
var transient native pointer FaceFXActorInstance;

/**
 *	The audio component that we are using to play audio for a facial animation.
 *	Assigned in PlayFaceFXAnim and cleared in StopFaceFXAnim.
 */
var AudioComponent	CachedFaceFXAudioComp;

//=============================================================================
// Animation.

// Attachment functions.
native final function AttachComponent(ActorComponent Component,name BoneName,optional vector RelativeLocation,optional rotator RelativeRotation,optional vector RelativeScale);
native final function DetachComponent(ActorComponent Component);


/**
 * Attach an ActorComponent to a Socket.
 */

native final function AttachComponentToSocket(ActorComponent Component, name SocketName);

/**
 *	Find the current world space location and rotation of a named socket on the skeletal mesh component.
 *	If the socket is not found, then it returns false and does not change the OutLocation/OutRotation variables.
 *	@param InSocketName the name of the socket to find
 *	@param OutLocation (out) set to the world space location of the socket
 *	@param OutRotation (out) if specified, set to the world space rotation of the socket
 *	@return whether or not the socket was found
 */
native final function bool GetSocketWorldLocationAndRotation(name InSocketName, out vector OutLocation, optional out rotator OutRotation);


/**
 * Returns SkeletalMeshSocket of named socket on the skeletal mesh component.
 * Returns None if not found.
 */

native final function SkeletalMeshSocket GetSocketByName( Name InSocketName );


/**
 * Returns component attached to specified BoneName. (returns the first entry found).
 * @param	BoneName		Bone Name to look up.
 * @return	First ActorComponent found, attached to BoneName, if it exists.
 */

native final function ActorComponent FindComponentAttachedToBone( name InBoneName );


/**
 * Returns true if component is attached to skeletal mesh.
 * @param	Component	ActorComponent to check for.
 * @return	true if Component is attached to SkeletalMesh.
 */

native final function bool IsComponentAttached( ActorComponent Component, optional Name BoneName );

/** returns all attached components that are of the specified class or a subclass
 * @param BaseClass the base class of ActorComponent to return
 * @param (out) OutComponent the returned ActorComponent for each iteration
 */
native final iterator function AttachedComponents(class<ActorComponent> BaseClass, out ActorComponent OutComponent);

// Skeletal animation.

/** Change the SkeletalMesh that is rendered for this Component. Will re-initialize the animation tree etc. */
simulated native final function SetSkeletalMesh(SkeletalMesh NewMesh, optional bool bKeepSpaceBases);

/** Change the Physics Asset of the mesh */
simulated native final function SetPhysicsAsset(PhysicsAsset NewPhysicsAsset, optional bool bForceReInit);

/** Change whether to force mesh into ref pose (and use cheaper vertex shader) */
simulated native final function SetForceRefPose(bool bNewForceRefPose);

// Cloth

/** Turn on and off cloth simulation for this skeletal mesh. */
simulated native final function SetEnableClothSimulation(bool bInEnable);

/** Toggle active simulation of cloth. Cheaper than doing SetEnableClothSimulation, and keeps its shape while frozen. */
simulated native final function SetClothFrozen(bool bNewFrozen);

/** Update params of the this components internal cloth sim from the SkeletalMesh properties. */
simulated native final function UpdateClothParams();

/** Modify the external force that is applied to the cloth. Will continue to be applied until it is changed. */
simulated native final function SetClothExternalForce(vector InForce);

/** Attach/detach verts from physics body that this components actor is attached to. */
simulated native final function SetAttachClothVertsToBaseBody(bool bAttachVerts);

/** Move all vertices in the cloth to the reference pose and zero their velocity. */
simulated native final function ResetClothVertsToRefPose();

//Some get*() APIs
simulated native final function float GetClothAttachmentResponseCoefficient();
simulated native final function float GetClothAttachmentTearFactor();
simulated native final function float GetClothBendingStiffness();
simulated native final function float GetClothCollisionResponseCoefficient();
simulated native final function float GetClothDampingCoefficient();
simulated native final function int GetClothFlags();
simulated native final function float GetClothFriction();
simulated native final function float GetClothPressure();
simulated native final function float GetClothSleepLinearVelocity();
simulated native final function int GetClothSolverIterations();
simulated native final function float GetClothStretchingStiffness();
simulated native final function float GetClothTearFactor();
simulated native final function float GetClothThickness();
//some set*() APIs
simulated native final function SetClothAttachmentResponseCoefficient(float ClothAttachmentResponseCoefficient);
simulated native final function SetClothAttachmentTearFactor(float ClothAttachTearFactor);
simulated native final function SetClothBendingStiffness(float ClothBendingStiffness);
simulated native final function SetClothCollisionResponseCoefficient(float ClothCollisionResponseCoefficient);
simulated native final function SetClothDampingCoefficient(float ClothDampingCoefficient);
simulated native final function SetClothFlags(int ClothFlags);
simulated native final function SetClothFriction(float ClothFriction);
simulated native final function SetClothPressure(float ClothPressure);
simulated native final function SetClothSleepLinearVelocity(float ClothSleepLinearVelocity);
simulated native final function SetClothSolverIterations(int ClothSolverIterations);
simulated native final function SetClothStretchingStiffness(float ClothStretchingStiffness);
simulated native final function SetClothTearFactor(float ClothTearFactor);
simulated native final function SetClothThickness(float ClothThickness);
//Other APIs
simulated native final function SetClothSleep(bool IfClothSleep);
simulated native final function SetClothPosition(vector ClothOffSet);
simulated native final function SetClothVelocity(vector VelocityOffSet);
//Attachment API
simulated native final function AttachClothToCollidingShapes(bool AttatchTwoWay, bool AttachTearable);
//ValidBounds APIs
simulated native final function EnableClothValidBounds(bool IfEnableClothValidBounds);
simulated native final function SetClothValidBounds(vector ClothValidBoundsMin, vector ClothValidBoundsMax);

/**
 * Find a named AnimSequence from the AnimSets array in the SkeletalMeshComponent.
 * This searches array from end to start, so specific sequence can be replaced by putting a set containing a sequence with the same name later in the array.
 *
 * @param AnimSeqName Name of AnimSequence to look for.
 *
 * @return Pointer to found AnimSequence. Returns NULL if could not find sequence with that name.
 */
native final function AnimSequence FindAnimSequence( Name AnimSeqName );


/**
 * Saves the skeletal component's current AnimSets to a temporary buffer.  You can restore them later by calling
 * RestoreSavedAnimSets().
 */
native final function SaveAnimSets();

/**
 * Restores saved AnimSets to the master list of AnimSets and clears the temporary saved list of AnimSets.
 */
native final function RestoreSavedAnimSets();


/**
 * Finds play Rate for a named AnimSequence to match a specified Duration in seconds.
 *
 * @param	AnimSeqName	Name of AnimSequence to look for.
 * @param	Duration	in seconds to match
 *
 * @return	play rate of animation, so it plays in <duration> seconds.
 */
final function float GetAnimRateByDuration( Name AnimSeqName, float Duration )
{
	local AnimSequence AnimSeq;

	AnimSeq = FindAnimSequence( AnimSeqName );
	if( AnimSeq == None )
	{
		return 1.f;
	}

	return (AnimSeq.SequenceLength / Duration);
}


/** Returns the duration (in seconds) for a named AnimSequence. Returns 0.f if no animation. */
final function float GetAnimLength(Name AnimSeqName)
{
	local AnimSequence AnimSeq;

	AnimSeq = FindAnimSequence(AnimSeqName);
	if( AnimSeq == None )
	{
		return 0.f;
	}

	return (AnimSeq.SequenceLength / AnimSeq.RateScale);
}


/**
 * Find a named MorphTarget from the MorphSets array in the SkeletalMeshComponent.
 * This searches the array in the same way as FindAnimSequence
 *
 * @param AnimSeqName Name of MorphTarget to look for.
 *
 * @return Pointer to found MorphTarget. Returns NULL if could not find target with that name.
 */
native final function MorphTarget FindMorphTarget( Name MorphTargetName );

/**
 * Find an Animation Node in the Animation Tree whose NodeName matches InNodeName.
 * Warning: The search is O(n^2), so for large AnimTrees, cache result.
 */
native final function	AnimNode			FindAnimNode(name InNodeName);

/** returns all AnimNodes in the animation tree that are the specfied class or a subclass
 * @param BaseClass base class to return
 * @param Node (out) the returned AnimNode for each iteration
 */
native final iterator function AllAnimNodes(class<AnimNode> BaseClass, out AnimNode Node);

native final function	SkelControlBase		FindSkelControl( name InControlName );

native final function	MorphNodeBase		FindMorphNode( name InNodeName );

native final function quat GetBoneQuaternion( name BoneName, optional int Space ); // 0 == World, 1 == Local (Component)
native final function vector GetBoneLocation( name BoneName, optional int Space ); // 0 == World, 1 == Local (Component)

/** returns the bone index of the specified bone, or INDEX_NONE if it couldn't be found */
native final function int MatchRefBone( name BoneName );

/** returns the matrix of the bone at the specified index */
native final function matrix GetBoneMatrix( int BoneIndex );

/** returns the name of the parent bone for the specified bone. Returns 'None' if the bone does not exist or it is the root bone */
native final function name GetParentBone(name BoneName);

/** fills the given array with the names of all the bones in this component's current SkeletalMesh */
native final function GetBoneNames(out array<name> BoneNames);

/** finds a vector pointing along the given axis of the given bone
 * @param BoneName the name of the bone to find
 * @param Axis the axis of that bone to return
 * @return the direction of the specified axis, or (0,0,0) if the specified bone was not found
 */
native final function vector GetBoneAxis(name BoneName, EAxis Axis);

/**
 *	Transform a location/rotation from world space to bone relative space.
 *	This is handy if you know the location in world space for a bone attachment, as AttachComponent takes location/rotation in bone-relative space.
 */
native final function TransformToBoneSpace( name BoneName, vector InPosition, rotator InRotation, out vector OutPosition, out rotator OutRotation );

/**
 *	Transform a location/rotation in bone relative space to world space.
 */
native final function TransformFromBoneSpace( name BoneName, vector InPosition, rotator InRotation, out vector OutPosition, out rotator OutRotation );

/** finds the closest bone to the given location
 * @param TestLocation the location to test against
 * @param BoneLocation (optional, out) if specified, set to the world space location of the bone that was found, or (0,0,0) if no bone was found
 * @param IgnoreScale (optional) if specified, only bones with scaling larger than the specified factor are considered
 * @return the name of the bone that was found, or 'None' if no bone was found
 */
native final function name FindClosestBone(vector TestLocation, optional out vector BoneLocation, optional float IgnoreScale);

native final function SetAnimTreeTemplate(AnimTree NewTemplate);
native final function SetParentAnimComponent(SkeletalMeshComponent NewParentAnimComp);

native final function UpdateParentBoneMap();
native final function InitSkelControls();

final native function int	FindConstraintIndex(name ConstraintName);
final native function name	FindConstraintBoneName(int ConstraintIndex);

/** Find a BodyInstance by BoneName */
final native function	RB_BodyInstance	FindBodyInstanceNamed(Name BoneName);

/**
 *	Set value of bHasPhysicsAssetInstance flag.
 *	Will create/destroy PhysicsAssetInstance as desired.
 */
final native function SetHasPhysicsAssetInstance(bool bHasInstance);

/** Force an update of this meshes kinematic bodies and springs. */
native final function UpdateRBBonesFromSpaceBases(bool bMoveUnfixedBodies, bool bTeleport);

/** forces an update to the mesh's skeleton/attachments, even if bUpdateSkelWhenNotRendered is false and it has not been recently rendered
 * @note if bUpdateSkelWhenNotRendered is true, there is no reason to call this function (but doing so anyway will have no effect)
 */
native final function ForceSkelUpdate();

/**
 * Force AnimTree to recache all animations.
 * Call this when the AnimSets array has been changed.
 */
native final function UpdateAnimations();

/**
 *	Find all bones by name within given radius
 */
native final function bool GetBonesWithinRadius( Vector Origin, FLOAT Radius, INT TraceFlags, out array< Name > out_Bones );

// FaceFX.

/**
 * Play the specified FaceFX animation.
 * Returns TRUE if successful.
 * If animation couldn't be found, a log warning will be issued.
 */
native final function bool PlayFaceFXAnim(FaceFXAnimSet FaceFXAnimSetRef, string AnimName, string GroupName);

/** Stop any currently playing FaceFX animation. */
native final function StopFaceFXAnim();

/** Is playing a FaceFX animation. */
native final function bool IsPlayingFaceFXAnim();

/** Declare a new register in the FaceFX register system.  This is required
  * before using the register name in GetRegister() or SetRegister(). */
native final function DeclareFaceFXRegister( string RegName );

/** Retrieve the value of the specified FaceFX register. */
native final function float GetFaceFXRegister( string RegName );

/** Set the value and operation of the specified FaceFX register. */
native final function SetFaceFXRegister( string RegName, float RegVal, EFaceFXRegOp RegOp, optional float InterpDuration );
/** Set the value and operation of the specified FaceFX register. */
native final function SetFaceFXRegisterEx( string RegName, EFaceFXRegOp RegOp, float FirstValue, float FirstInterpDuration, float NextValue, float NextInterpDuration );

/** simple generic case animation player
 * requires that the one and only animation node in the AnimTree is an AnimNodeSequence
 * @param AnimName name of the animation to play
 * @param Duration (optional) override duration for the animation
 * @param bLoop (optional) whether the animation should loop
 * @param bRestartIfAlreadyPlaying whether or not to restart the animation if the specified anim is already playing
 */
function PlayAnim(name AnimName, optional float Duration, optional bool bLoop, optional bool bRestartIfAlreadyPlaying = true)
{
	local AnimNodeSequence AnimNode;
	local float DesiredRate;

	AnimNode = AnimNodeSequence(Animations);
	if (AnimNode == None && Animations.IsA('AnimTree'))
	{
		AnimNode = AnimNodeSequence(AnimTree(Animations).Children[0].Anim);
	}
	if (AnimNode == None)
	{
		WarnInternal("Base animation node is not an AnimNodeSequence (Owner:" @ Owner $ ")");
	}
	else
	{
		if (AnimNode.AnimSeq != None && AnimNode.AnimSeq.SequenceName == AnimName)
		{
			DesiredRate = (Duration > 0.0) ? (AnimNode.AnimSeq.SequenceLength / Duration) : 1.0;
			if (bRestartIfAlreadyPlaying || !AnimNode.bPlaying)
			{
				AnimNode.PlayAnim(bLoop, DesiredRate);
			}
			else
			{
				AnimNode.Rate = DesiredRate;
				AnimNode.bLooping = bLoop;
			}
		}
		else
		{
			AnimNode.SetAnim(AnimName);
			if (AnimNode.AnimSeq != None)
			{
				DesiredRate = (Duration > 0.0) ? (AnimNode.AnimSeq.SequenceLength / Duration) : 1.0;
				AnimNode.PlayAnim(bLoop, DesiredRate);
			}
		}
	}
}

/** simple generic case animation stopper
 * requires that the one and only animation node in the AnimTree is an AnimNodeSequence
 */
function StopAnim()
{
	local AnimNodeSequence AnimNode;

	AnimNode = AnimNodeSequence(Animations);
	if (AnimNode == None && Animations.IsA('AnimTree'))
	{
		AnimNode = AnimNodeSequence(AnimTree(Animations).Children[0].Anim);
	}
	if (AnimNode == None)
	{
		WarnInternal("Base animation node is not an AnimNodeSequence (Owner:" @ Owner $ ")");
	}
	else
	{
		AnimNode.StopAnim();
	}
}

defaultproperties
{
   GlobalAnimRateScale=1.000000
   WireframeColor=(B=28,G=221,R=221,A=255)
   bTransformFromAnimParent=1
   bUpdateSkelWhenNotRendered=True
   bUpdateKinematicBonesFromAnimation=True
   bSyncActorLocationToRootRigidBody=True
   bCacheAnimSequenceNodes=True
   ClothBlendWeight=1.000000
   ClothRBChannel=RBCC_Cloth
   ClothAttachmentTearFactor=-1.000000
   RootMotionAccelScale=(X=1.000000,Y=1.000000,Z=1.000000)
   RootMotionMode=RMM_Ignore
   PreviousRMM=RMM_Ignore
   FaceFXBlendMode=FXBM_Additive
   TickGroup=TG_PreAsyncWork
   Name="Default__SkeletalMeshComponent"
   ObjectArchetype=MeshComponent'Engine.Default__MeshComponent'
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: tr 31-1-2018 17:17:56.000 - Creation time: sk 18-3-2018 10:01:14.338 - Created with UnCodeX