public static void EmitPivotSO(SceneSerializer s, IOutputStream o, PivotSO so)
 {
     o.AddAttribute(IOStrings.ASOName, so.Name);
     o.AddAttribute(IOStrings.ASOUuid, so.UUID);
     s.EmitTransform(o, so);
     s.EmitMaterial(o, so.GetAssignedSOMaterial());
 }
 public static void EmitGenericSO(this SceneSerializer s, IOutputStream o, SceneObject so)
 {
     o.AddAttribute(IOStrings.ASOType, IOStrings.TypeUnknown);
     o.AddAttribute(IOStrings.ASOName, so.Name);
     o.AddAttribute(IOStrings.ASOUuid, so.UUID);
     s.EmitTransform(o, so);
 }
예제 #3
0
 public static void Emit(this SceneSerializer s, IOutputStream o, PivotSO so)
 {
     o.AddAttribute(IOStrings.ASOType, IOStrings.TypePivot);
     o.AddAttribute(IOStrings.ASOName, so.Name);
     s.EmitTransform(o, so);
     s.EmitMaterial(o, so.GetAssignedSOMaterial());
 }
        public static void EmitMeshSO(SceneSerializer s, IOutputStream o, MeshSO so)
        {
            o.AddAttribute(IOStrings.ASOName, so.Name);
            o.AddAttribute(IOStrings.ASOUuid, so.UUID);
            s.EmitTransform(o, so);
            SimpleMesh m = so.GetSimpleMesh(true);

            s.EmitMeshBinary(m, o);
        }
 public static void EmitPolyCurveSO(SceneSerializer s, IOutputStream o, PolyCurveSO so)
 {
     o.AddAttribute(IOStrings.ASOName, so.Name);
     o.AddAttribute(IOStrings.ASOUuid, so.UUID);
     s.EmitTransform(o, so);
     s.EmitMaterial(o, so.GetAssignedSOMaterial());
     o.AddAttribute(IOStrings.APolyCurve3, so.Curve.Vertices);
     o.AddAttribute(IOStrings.APolyCurveClosed, so.Curve.Closed);
 }
 public static void EmitBoxSO(SceneSerializer s, IOutputStream o, BoxSO so)
 {
     o.AddAttribute(IOStrings.ASOName, so.Name);
     o.AddAttribute(IOStrings.ASOUuid, so.UUID);
     s.EmitTransform(o, so);
     o.AddAttribute(IOStrings.AWidth, so.Width);
     o.AddAttribute(IOStrings.AHeight, so.Height);
     o.AddAttribute(IOStrings.ADepth, so.Depth);
     s.EmitMaterial(o, so.GetAssignedSOMaterial());
 }
예제 #7
0
 public static void Emit(this SceneSerializer s, IOutputStream o, PolyTubeSO so)
 {
     o.AddAttribute(IOStrings.ASOType, IOStrings.TypePolyTube);
     o.AddAttribute(IOStrings.ASOName, so.Name);
     s.EmitTransform(o, so);
     s.EmitMaterial(o, so.GetAssignedSOMaterial());
     o.AddAttribute(IOStrings.APolyCurve3, so.Curve.Vertices);
     o.AddAttribute(IOStrings.APolyCurveClosed, so.Curve.Closed);
     o.AddAttribute(IOStrings.APolygon2, so.Polygon.Vertices);
 }
        public static void EmitCylinderSO(SceneSerializer s, IOutputStream o, CylinderSO so)
        {
            o.AddAttribute(IOStrings.ASOName, so.Name);
            o.AddAttribute(IOStrings.ASOUuid, so.UUID);
            s.EmitTransform(o, so);
            o.AddAttribute(IOStrings.ARadius, so.Radius);
            o.AddAttribute(IOStrings.AHeight, so.Height);
            Frame3f f = so.GetLocalFrame(CoordSpace.ObjectCoords);

            o.AddAttribute(IOStrings.AStartPoint, (f.Origin - 0.5f * so.ScaledHeight * f.Y));
            o.AddAttribute(IOStrings.AEndPoint, (f.Origin + 0.5f * so.ScaledHeight * f.Y));
            s.EmitMaterial(o, so.GetAssignedSOMaterial());
        }
        public static void EmitMeshReferenceSO(SceneSerializer s, IOutputStream o, MeshReferenceSO so)
        {
            o.AddAttribute(IOStrings.ASOName, so.Name);
            o.AddAttribute(IOStrings.ASOUuid, so.UUID);
            s.EmitTransform(o, so);
            // [TODO] be smarter about paths
            o.AddAttribute(IOStrings.AReferencePath, so.MeshReferencePath);

            StringBuilder rel_path = new StringBuilder(260); // MAX_PATH

            if (PathRelativePathTo(rel_path,
                                   Path.GetDirectoryName(s.TargetFilePath), FILE_ATTRIBUTE_DIRECTORY,
                                   so.MeshReferencePath, FILE_ATTRIBUTE_NORMAL) == 1)
            {
                o.AddAttribute(IOStrings.ARelReferencePath, rel_path.ToString());
            }
        }
        public static void EmitDMeshSO(SceneSerializer s, IOutputStream o, DMeshSO so)
        {
            SceneSerializer.EmitOptions opt = s.CurrentOptions;

            o.AddAttribute(IOStrings.ASOName, so.Name);
            o.AddAttribute(IOStrings.ASOUuid, so.UUID);
            s.EmitTransform(o, so);
            s.EmitMaterial(o, so.GetAssignedSOMaterial());
            //s.EmitDMeshBinary(so.Mesh, o);
            if (opt.MinimalMeshStorage)
            {
                s.EmitDMeshCompressed_Minimal(so.Mesh, o);
            }
            else
            {
                s.EmitDMeshCompressed(so.Mesh, o);
            }
        }
예제 #11
0
 public static void Emit(this SceneSerializer s, IOutputStream o, TransformableSO so)
 {
     o.AddAttribute(IOStrings.ASOType, IOStrings.TypeUnknown);
     o.AddAttribute(IOStrings.ASOName, so.Name);
     s.EmitTransform(o, so);
 }