Browse Source

updated packages.
removed obsolete methods.

Vicente Penades 4 years ago
parent
commit
3d4ebb2977

+ 1 - 1
build/SharpGLTF.CodeGen/SharpGLTF.CodeGen.csproj

@@ -8,7 +8,7 @@
 
   <ItemGroup>
     <PackageReference Include="LibGit2Sharp" Version="0.26.2" />    
-    <PackageReference Include="NJsonSchema.CodeGeneration.CSharp" Version="10.3.5" />
+    <PackageReference Include="NJsonSchema.CodeGeneration.CSharp" Version="10.3.10" />
   </ItemGroup>
 
 </Project>

+ 0 - 20
src/SharpGLTF.Core/Runtime/SceneTemplate.cs

@@ -15,26 +15,6 @@ namespace SharpGLTF.Runtime
     {
         #region lifecycle
 
-        /// <summary>
-        /// Creates a new <see cref="SceneTemplate"/> from a given <see cref="Schema2.Scene"/>.
-        /// </summary>
-        /// <param name="srcScene">The source <see cref="Schema2.Scene"/> to templateize.</param>
-        /// <param name="isolateMemory">True if we want to copy data instead of sharing it.</param>
-        /// <returns>A new <see cref="SceneTemplate"/> instance.</returns>
-        [Obsolete("Use Create(Schema2.Scene srcScene, RuntimeOptions options)")]
-        public static SceneTemplate Create(Schema2.Scene srcScene, bool isolateMemory)
-        {
-            RuntimeOptions options = null;
-
-            if (isolateMemory)
-            {
-                options = new RuntimeOptions();
-                options.IsolateMemory = true;
-            }
-
-            return Create(srcScene, options);
-        }
-
         /// <summary>
         /// Creates a new <see cref="SceneTemplate"/> from a given <see cref="Schema2.Scene"/>.
         /// </summary>

+ 0 - 7
src/SharpGLTF.Core/Schema2/gltf.Accessors.cs

@@ -80,13 +80,6 @@ namespace SharpGLTF.Schema2
 
         public AttributeFormat Format => new AttributeFormat(_type, _componentType, this._normalized.AsValue(false));
 
-        /// <summary>
-        /// Gets the number of bytes required to encode a single item in <see cref="SourceBufferView"/>
-        /// Given the current <see cref="Dimensions"/> and <see cref="Encoding"/> states.
-        /// </summary>
-        [Obsolete("Use Format.ByteSize instead")]
-        public int ElementByteSize                 => Encoding.ByteLength() * Dimensions.DimCount();
-
         #endregion
 
         #region API

+ 0 - 62
src/SharpGLTF.Core/Schema2/gltf.Animations.cs

@@ -221,68 +221,6 @@ namespace SharpGLTF.Schema2
         }
 
         #endregion
-
-        #region obsolete
-
-        [Obsolete("Use FindScaleChannel(node)?.GetScaleSampler()")]
-        public IAnimationSampler<Vector3> FindScaleSampler(Node node) => FindScaleChannel(node)?.GetScaleSampler();
-
-        [Obsolete("Use FindRotationChannel(node)?.GetRotationSampler()")]
-        public IAnimationSampler<Quaternion> FindRotationSampler(Node node) => FindRotationChannel(node)?.GetRotationSampler();
-
-        [Obsolete("Use FindTranslationChannel(node)?.GetTranslationSampler()")]
-        public IAnimationSampler<Vector3> FindTranslationSampler(Node node) => FindTranslationChannel(node)?.GetTranslationSampler();
-
-        [Obsolete("Use FindMorphChannel(node)?.GetMorphSampler()")]
-        public IAnimationSampler<Single[]> FindMorphSampler(Node node) => FindMorphChannel(node)?.GetMorphSampler();
-
-        [Obsolete("Use FindMorphChannel(node)?.GetSparseMorphSampler()")]
-        public IAnimationSampler<SparseWeight8> FindSparseMorphSampler(Node node) => FindMorphChannel(node)?.GetSparseMorphSampler();
-
-        [Obsolete("Use node.GetCurveSamplers(anim).GetLocalTransform(time)")]
-        public AffineTransform GetLocalTransform(Node node, Single time)
-        {
-            Guard.NotNull(node, nameof(node));
-            Guard.MustShareLogicalParent(this, node, nameof(node));
-
-            return node.GetCurveSamplers(this).GetLocalTransform(time);
-        }
-
-        [Obsolete("Use node.GetCurveSamplers(anim).GetMorphingWeights(time)")]
-        public IReadOnlyList<float> GetMorphWeights(Node node, Single time)
-        {
-            Guard.NotNull(node, nameof(node));
-
-            var morphWeights = node.MorphWeights;
-            if (morphWeights == null || morphWeights.Count == 0) return morphWeights;
-
-            Guard.MustShareLogicalParent(this, node, nameof(node));
-
-            return FindMorphChannel(node)
-                ?.GetMorphSampler()
-                ?.CreateCurveSampler()
-                ?.GetPoint(time)
-                ?? default;
-        }
-
-        [Obsolete("Use node.GetCurveSamplers(anim).GetSparseMorphingWeights(time)")]
-        public SparseWeight8 GetSparseMorphWeights(Node node, Single time)
-        {
-            Guard.NotNull(node, nameof(node));
-
-            var morphWeights = node.MorphWeights;
-            if (morphWeights == null || morphWeights.Count == 0) return default;
-
-            Guard.MustShareLogicalParent(this, node, nameof(node));
-
-            return FindMorphChannel(node)
-                ?.GetSparseMorphSampler()
-                ?.CreateCurveSampler()
-                ?.GetPoint(time)
-                ?? default;
-        }
-
-        #endregion
     }
 
     public sealed partial class ModelRoot

+ 0 - 10
src/SharpGLTF.Core/Schema2/gltf.Images.cs

@@ -43,16 +43,6 @@ namespace SharpGLTF.Schema2
 
         #region properties
 
-        /// <summary>
-        /// Gets or sets the in-memory representation of the image file.
-        /// </summary>
-        [Obsolete("Use Content property instead.")]
-        public Memory.MemoryImage MemoryImage
-        {
-            get => Content;
-            set => Content = value;
-        }
-
         /// <summary>
         /// Gets or sets the in-memory representation of the image file.
         /// </summary>

+ 0 - 11
src/SharpGLTF.Core/Schema2/gltf.Textures.cs

@@ -32,17 +32,6 @@ namespace SharpGLTF.Schema2
             }
         }
 
-        [Obsolete("Use PrimaryImage")]
-        public Image Image
-        {
-            get => PrimaryImage;
-            set
-            {
-                if (value == null) ClearImages();
-                else SetImage(value);
-            }
-        }
-
         public Image PrimaryImage => _GetPrimaryImage();
 
         public Image FallbackImage => _GetFallbackImage();

+ 0 - 51
src/SharpGLTF.Toolkit/Scenes/NodeBuilder.cs

@@ -283,57 +283,6 @@ namespace SharpGLTF.Scenes
             }
         }
 
-        /// <summary>
-        /// Rename all the <see cref="NodeBuilder"/> elements in <paramref name="collection"/>
-        /// so every node has a valid, unique name.
-        /// </summary>
-        /// <param name="collection">A collection of <see cref="NodeBuilder"/> elements.</param>
-        /// <param name="namePrefix">The name prefix.</param>
-        /// <remarks>
-        /// This was originally intended to help in solving the problem that many engines don't
-        /// support two nodes to have the same name. But ultimately, it's these engine's responsability
-        /// to deal with glTF specifications.
-        /// </remarks>
-        [Obsolete("It does not belong here.")]
-        public static void Rename(IEnumerable<NodeBuilder> collection, string namePrefix)
-        {
-            if (collection == null) return;
-
-            var names = new HashSet<string>();
-            var index = -1;
-
-            foreach (var item in collection)
-            {
-                ++index;
-
-                // if the current name is already valid, keep it.
-                if (!string.IsNullOrWhiteSpace(item.Name))
-                {
-                    if (item.RenameIfAvailable(item.Name, names)) continue;
-                }
-
-                // try with a default name
-                var newName = $"{namePrefix}{index}";
-                if (item.RenameIfAvailable(newName, names)) continue;
-
-                // retry with different names until finding a valid name.
-                for (int i = 0; i < int.MaxValue; ++i)
-                {
-                    newName = $"{namePrefix}{index}-{i}";
-
-                    if (item.RenameIfAvailable(newName, names)) break;
-                }
-            }
-        }
-
-        private bool RenameIfAvailable(string newName, ISet<string> usedNames)
-        {
-            if (usedNames.Contains(newName)) return false;
-            this.Name = newName;
-            usedNames.Add(newName);
-            return true;
-        }
-
         #endregion
 
         #region API - transform

+ 3 - 3
src/SharpGLTF.Toolkit/Scenes/SceneBuilder.cs

@@ -88,19 +88,19 @@ namespace SharpGLTF.Scenes
 
         #region Obsolete API
 
-        [Obsolete("Remove name param and use .WithName(name);")]
+        [Obsolete("Remove name parameter and use .WithName(name);", true)]
         public InstanceBuilder AddRigidMesh(MESHBUILDER mesh, String nodeName, Matrix4x4 meshWorldMatrix)
         {
             return AddRigidMesh(mesh, meshWorldMatrix).WithName(nodeName);
         }
 
-        [Obsolete("Remove name param and use .WithName(name);")]
+        [Obsolete("Remove name parameter and use .WithName(name);", true)]
         public InstanceBuilder AddSkinnedMesh(MESHBUILDER mesh, String nodeName, Matrix4x4 meshWorldMatrix, params NodeBuilder[] joints)
         {
             return AddSkinnedMesh(mesh, meshWorldMatrix, joints).WithName(nodeName);
         }
 
-        [Obsolete("Remove name param and use .WithName(name);")]
+        [Obsolete("Remove name parameter and use .WithName(name);", true)]
         public InstanceBuilder AddSkinnedMesh(MESHBUILDER mesh, string nodeName, params (NodeBuilder Joint, Matrix4x4 InverseBindMatrix)[] joints)
         {
             return AddSkinnedMesh(mesh, joints).WithName(nodeName);

+ 1 - 1
tests/SharpGLTF.Tests/SharpGLTF.Core.Tests.csproj

@@ -26,7 +26,7 @@
       <PrivateAssets>all</PrivateAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
     </PackageReference>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.1" />
   </ItemGroup>  
 
 </Project>

+ 1 - 1
tests/SharpGLTF.Toolkit.Tests/SharpGLTF.Toolkit.Tests.csproj

@@ -26,7 +26,7 @@
       <PrivateAssets>all</PrivateAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
     </PackageReference>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.1" />
   </ItemGroup>  
 
 </Project>