예제 #1
0
        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);
                    }
                }
            }
        }
예제 #2
0
        public void SetAnimationEvaluator(AnimEvaluator pEvaluator)
        {
            var current = GetAnimationEvaluator();

            if (current != null)
            {
                SrcObjects.Remove(current);
            }
            SrcObjects.Add(pEvaluator);
        }
예제 #3
0
        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());
        }
예제 #4
0
        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();
            }));
        }
예제 #5
0
 protected FbxGeometry(string name = "")
     : base(name)
 {
     Deformers = SrcObjects.CreateCollectionView <FbxDeformer>();
 }
예제 #6
0
 public GlobalSettings GetGlobalSettings()
 {
     return((GlobalSettings)SrcObjects.FirstOrDefault(x => x is GlobalSettings));
 }
예제 #7
0
 public AnimEvaluator GetAnimationEvaluator()
 {
     return((AnimEvaluator)SrcObjects.FirstOrDefault(x => x is AnimEvaluator));
 }
예제 #8
0
파일: Node.cs 프로젝트: halad/FbxSharp
        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>();
        }