Skip to content

Determined type based off input #7

@Scobalula

Description

@Scobalula

Some single-value types support storing smaller values depending on the required bits of the input, for getting those values, we support the following by hinting to the internal Get method what our max bits are:

        /// <summary>
        /// Gets or Sets the number of uv layers within this mesh.
        /// </summary>
        public int UVLayerCount { get => (int)GetFirstInteger("ul", 0, 32); set => AddValue("ul", (uint)value); }

        /// <summary>
        /// Gets or Sets the number of color layers within this mesh.
        /// </summary>
        public int ColorLayerCount { get => (int)GetFirstInteger("cl", 0, 32); set => AddValue("cl", (uint)value); }

        /// <summary>
        /// Gets or Sets the max number of weight influences within this mesh.
        /// </summary>
        public int MaximumWeightInfluence { get => (int)GetFirstInteger("mi", 0, 32); set => AddValue("mi", (uint)value); }

The problem comes when we set the value, we are now forcing the wider type, when the internal AddValue should support using byte or short if the value can fit into those.

Not a huge priority right now as regardless of what type we write, it should be supported, but tracking regardless for addressing or documenting this behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions