stride3d/stride · error · InvalidOperationException

Model property is unset.

Error message

Model property is unset.

What it means

SkeletonModelPropertyTemplateProvider.MatchNode switches over the SkeletonProperty enum; if the value is none of the known cases (NodeInformation / NodeInformationList), it throws InvalidOperationException because no model property was configured. It is a defensive guard against an unset or unknown enum member.

Solutions

  1. Set the SkeletonProperty to NodeInformation or NodeInformationList in the skeleton template/configuration
  2. Extend MatchNode's switch to handle any newly added SkeletonProperty enum members
  3. Inspect the stack trace / property value to confirm which SkeletonProperty member is reaching the switch

Example fix

// before
case SkeletonProperty.NodeInformationList:
    return typeof(IEnumerable<NodeInformation>).IsAssignableFrom(node.Type);
default:
    throw new InvalidOperationException("Model property is unset.");
// after
case SkeletonProperty.NodeInformationList:
    return typeof(IEnumerable<NodeInformation>).IsAssignableFrom(node.Type);
case SkeletonProperty.ModelProperty:
    return typeof(Model).IsAssignableFrom(node.Type); // handle previously-unset member
Defensive patterns

Strategy: validation

Validate before calling

if (!Enum.IsDefined(typeof(SkeletonProperty), prop)) throw new InvalidOperationException($"Unknown SkeletonProperty {prop}");

Type guard

bool HasModelPropertyHandler(SkeletonProperty p) => p == SkeletonProperty.NodeInformation || p == SkeletonProperty.NodeInformationList;

Try / catch

try { MatchNode(node); }
catch (InvalidOperationException) { // log unsupported property and use a default matching rule
}

Prevention

When it happens

Trigger: MatchNode is invoked with a SkeletonProperty value other than NodeInformation or NodeInformationList — typically SkeletonProperty.ModelProperty (unset) or an enum value added in a newer Stride version that this provider does not handle.

Common situations: Skeleton bone/retargeting template configuration pointing at the default/unset SkeletonProperty member; upgrading Stride introduces new SkeletonProperty enum members not covered by this switch (no default case).

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14). Data as JSON: /api/errors/3dc20711bb0b1eae. Report an issue: GitHub.

Appendix: source

Thrown at sources/editor/Stride.Assets.Presentation/TemplateProviders/SkeletonModelPropertyTemplateProvider.cs:39

        public SkeletonProperty Property { get; set; }

        public override bool MatchNode(NodeViewModel node)
        {
            if (!typeof(SkeletonAsset).IsAssignableFrom(node.Root.Type))
                return false;

            if (node.Parent == null)
                return false;

            switch (Property)
            {
                case SkeletonProperty.NodeInformation:
                    return node.Type == typeof(NodeInformation);
                case SkeletonProperty.NodeInformationList:
                    return typeof(IEnumerable<NodeInformation>).IsAssignableFrom(node.Type);
                default:
                    throw new InvalidOperationException("Model property is unset.");
            }
        }
    }
}

View on GitHub (pinned to 96fad776d2)