feat: add SMP <pattern> macro grammar to the physics XSD#7
Draft
DaymareOn wants to merge 3 commits into
Draft
Conversation
FSMP expands <pattern>/<pattern-default> macros before validation, but an
external XML editor validating a pattern-bearing file against this schema would
flag the new elements. Add them so editors accept such files:
- system now allows pattern, pattern-default, and repeat.
- pattern-default: name (required) plus optional author (namespace) and version;
holds param* then one body.
- param: name (required) plus optional default.
- body / repeat content is lax (xsd:any skip) because templates carry
${placeholders} the strict element types would reject; FSMP validates the
expanded output strictly.
- pattern (use): name (required) plus optional version plus any other attribute
(the parameter values).
Schema version 2.1.0 -> 2.2.0. Verified with .NET XmlSchema: the schema
compiles, a pattern-bearing sample validates, and invalid docs (missing name,
unknown element) still error.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Completes editor support for pattern files: - hdtSMP64.xsd gains a <patterns> root element so shared pattern-library files (patterns/*.xml) validate, not just <system> files that use patterns. - hdtSMP64.sch gains a pattern-macros rule set: repeat count must be a non-negative integer or a placeholder, repeat from must be an integer or a placeholder, count="0" warns (emits nothing), and param / pattern-default names must not contain spaces. Written without XPath-2.0 regex so they never error in the runtime validator (which only ever sees expanded docs) yet fire in an authoring editor. Verified with .NET XmlSchema: the schema compiles; a system doc and a patterns library both validate; a bone in a patterns root is rejected; the count rule flags only the malformed repeats. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A worked example for the modder guide: rebuilds one Cloaks of Skyrim cloak as a crossed 2-D tissue using the FSMP pattern feature. Ships only XML config (cloak.xml consumer + shared patterns/DaydreamingDay.xml library), no art assets; requires Cloaks of Skyrim + Artesian Cloaks of Skyrim for the rigged NIF. Includes a README (requirements, install, credits, permissions) and a reproducible package.ps1 that builds the versioned zip (attached to a GitHub Release, not committed). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Adds the
<pattern>/<pattern-default>/<param>/<body>/<repeat>grammar tohdtSMP64.xsd(2.1.0 -> 2.2.0), so an external XML editor validating a pattern-bearing physics file against this schema accepts it instead of flagging the new elements. FSMP itself expands patterns before its own validation, so in-game and the FSMP validator are unaffected - this is purely for author tooling. ## Details -systemnow allowspattern,pattern-default,repeat. -pattern-default:name(required) plus optionalauthor(namespace) andversion; holdsparam*then onebody. -body/repeatcontent is lax (xsd:anyskip), because templates carry${placeholders}the strict element types would reject; the expanded output is still validated strictly. -pattern(use):name(required) plus optionalversionplus any other attribute (the parameter values). ## Verified .NET XmlSchema: the schema compiles clean, a pattern-bearing sample validates, and invalid docs (missingname, unknown element) still error - and the allowed-children list now includespattern, pattern-default, repeat. ## Companion PR Implements the editor-schema half of DaymareOn/hdtSMP64#397 (feat/xml-patterns). ## Status Draft. Branched fromorigin/main, isolated from the in-progress work onfeat-sch-degrees-warning. 🤖 Generated with Claude CodeUpdate (da42538)
Also adds, so that pattern library files (the
patterns/*.xmlkind) validate, not just<system>files that use patterns:<patterns>root element (holdspattern-defaultdefinitions only).hdtSMP64.sch): apattern-macrosrule set —<repeat count>must be a non-negative integer or a${...}placeholder,<repeat from>an integer or placeholder,count="0"warns, andparam/pattern-defaultnames must not contain spaces. Written without XPath-2.0 regex so they never error in the runtime validator (which only sees expanded docs) yet fire in an authoring editor.Verified with .NET XmlSchema (schema compiles; system + patterns docs validate; bad library rejected; count rule flags only malformed repeats).