public override void ConnectSrcObject(FbxObject fbxObject /*, Connection.EType type = Connection.EType.None*/) { base.ConnectSrcObject(fbxObject /*, type*/); if (fbxObject is AnimStack && this.GetCurrentAnimationStack() == null) { this.SetCurrentAnimationStack((AnimStack)fbxObject); } foreach (var srcobj in fbxObject.SrcObjects) { if (!SrcObjects.Contains(srcobj)) { this.ConnectSrcObject(srcobj); } } foreach (Property prop in fbxObject.Properties) { foreach (var srcobj in prop.SrcObjects) { if (!SrcObjects.Contains(srcobj)) { this.ConnectSrcObject(srcobj); } } } }
public void SetAnimationEvaluator(AnimEvaluator pEvaluator) { var current = GetAnimationEvaluator(); if (current != null) { SrcObjects.Remove(current); } SrcObjects.Add(pEvaluator); }
public Scene(string name = "") : base(name) { RootNode = new Node(); Poses = SrcObjects.CreateCollectionView <Pose>(); Materials = SrcObjects.CreateCollectionView <SurfaceMaterial>(); Textures = SrcObjects.CreateCollectionView <Texture>(); Nodes = SrcObjects.CreateCollectionView <Node>(); SrcObjects.Add(new GlobalSettings()); SetAnimationEvaluator(new AnimEvaluator()); }
public AnimCurveNode GetCurveNode(AnimStack pAnimStack, bool pCreate = false) { if (pAnimStack == null) { return(null); } var currentLayers = new HashSet <AnimLayer>(pAnimStack.GetSrcObjects <AnimLayer>()); return((AnimCurveNode)SrcObjects.FirstOrDefault(x => { if (!(x is AnimCurveNode)) { return false; } var acn = (AnimCurveNode)x; var layers = new HashSet <AnimLayer>(acn.GetDstObjects <AnimLayer>()); return layers.Intersect(currentLayers).Any(); })); }
protected FbxGeometry(string name = "") : base(name) { Deformers = SrcObjects.CreateCollectionView <FbxDeformer>(); }
public GlobalSettings GetGlobalSettings() { return((GlobalSettings)SrcObjects.FirstOrDefault(x => x is GlobalSettings)); }
public AnimEvaluator GetAnimationEvaluator() { return((AnimEvaluator)SrcObjects.FirstOrDefault(x => x is AnimEvaluator)); }
public Node(string name = "") { this.Properties.AddRange( new Property[] { LclTranslation, LclRotation, LclScaling, Visibility, VisibilityInheritance, QuaternionInterpolate, RotationOffset, RotationPivot, ScalingOffset, ScalingPivot, TranslationActive, TranslationMin, TranslationMax, TranslationMinX, TranslationMinY, TranslationMinZ, TranslationMaxX, TranslationMaxY, TranslationMaxZ, RotationOrder, RotationSpaceForLimitOnly, RotationStiffnessX, RotationStiffnessY, RotationStiffnessZ, AxisLen, PreRotation, PostRotation, RotationActive, RotationMin, RotationMax, RotationMinX, RotationMinY, RotationMinZ, RotationMaxX, RotationMaxY, RotationMaxZ, InheritType, ScalingActive, ScalingMin, ScalingMax, ScalingMinX, ScalingMinY, ScalingMinZ, ScalingMaxX, ScalingMaxY, ScalingMaxZ, GeometricTranslation, GeometricRotation, GeometricScaling, MinDampRangeX, MinDampRangeY, MinDampRangeZ, MaxDampRangeX, MaxDampRangeY, MaxDampRangeZ, MinDampStrengthX, MinDampStrengthY, MinDampStrengthZ, MaxDampStrengthX, MaxDampStrengthY, MaxDampStrengthZ, PreferedAngleX, PreferedAngleY, PreferedAngleZ, LookAtProperty, UpVectorProperty, Show, NegativePercentShapeSupport, DefaultAttributeIndex, Freeze, LODBox }); this.ChildNodes = SrcObjects.CreateCollectionView <Node>(); _parentNode = DstObjects.CreateObjectView <Node>(); DefaultAttributeIndex.Set(-1); nodeAttributes = SrcObjects.CreateCollectionView <NodeAttribute>(); Materials = SrcObjects.CreateCollectionView <SurfaceMaterial>(); }