Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ The contract between CLI and GUI. Stable across releases.
```json
{"type": "start", "file": "foo.mdl", "index": 1, "total": 1234}
{"type": "done", "file": "foo.mdl", "index": 1, "total": 1234, "fixes": 3,
"result": { "file": "foo.mdl", "checks": [...], "repairs": [...], "actions": [...], "warnings": [...] }}
"result": { "file": "foo.mdl", "checks": [...], "repairs": [...], "actions": [...], "warnings": [...],
"parse_warnings": [...], "notes": [...] }}
{"type": "error", "file": "bar.mdl", "index": 2, "total": 1234, "message": "..."}
{"type": "summary", "total": 1234, "fixes": 421, "message": "Processed 1234 files, 12 warnings, 3 errors"}
```
Expand All @@ -171,6 +172,7 @@ Field rules:
- `type` is always present and stable: `start`, `done`, `error`, `summary`, and `source` (`variants --preview-dir` only).
- `file` is the model's base name (for `variants`, the version's).
- `result` matches `Result` in `process.go` exactly. Only present on `done`.
- `warnings` are decompile and compile warnings: `kind`, `offset` (in the binary, 0 when there is none), `node` and `message`. A NaN warning covers every NaN float of one list of one node and gives the count. `parse_warnings` are the ASCII parser's, as text with the line number, node and list. `notes` have the same fields as `warnings` but are info: what the decompiler dropped that is known and harmless, such as light controller 144. They are not counted as warnings, and the text output shows them only with `--verbose`.
- `sameShape` (variants): this body got that body's fit, renamed (same skeleton joints and base parts); no preview is written for it.
- `adjusts` (variants): the adjustments that change this variant, from `width`, `length` and the `--shape` regions (`shoulders`, `chest`, `waist`, `hips`, `hem`); a GUI can disable the others. `hem` is for robes and cloaks only; armour parts below the hips (shins, feet) have no regions.
- `learnedFrom` (variants): the armour part's fit was learned from this many versions of its slot that already exist for both bodies; absent for the measured fit.
Expand Down
5 changes: 5 additions & 0 deletions cmd/cleanmodels/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ func (tw *termWriter) printResultDetail(res Result, parseErrs []mdl.ParseError,
}
fmt.Fprintf(tw.w, " %s decompile [%s] off=%d: %s\n", tw.yellow("[WARN]"), wn.Node, wn.Offset, wn.Message)
}
if verbose {
for _, n := range res.Notes {
fmt.Fprintf(tw.w, " %s decompile [%s] off=%d: %s\n", tw.dim("[INFO]"), n.Node, n.Offset, n.Message)
}
}
for _, pe := range parseErrs {
fmt.Fprintf(tw.w, " %s parse: %v\n", tw.yellow("[WARN]"), pe)
}
Expand Down
4 changes: 4 additions & 0 deletions cmd/cleanmodels/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ import (
type Result struct {
File string `json:"file"`
Warnings []mdl.DecompileWarning `json:"warnings,omitempty"`
// Notes are decompile notes at info level (mdl.Model.Notes): what was
// dropped that is known and harmless. Not counted as warnings.
Notes []mdl.DecompileWarning `json:"notes,omitempty"`
// ParseWarnings are the ASCII parser's complaints ("line 352: ... set to 0").
// They are in the text output; this puts them in JSON and JSON-lines too, so
// the GUI and scripts see what the parser had to work around.
Expand Down Expand Up @@ -711,6 +714,7 @@ func processOne(path, outputPath string, o procOpts) (res Result, model *mdl.Mod

if model != nil {
res.Warnings = model.Warnings
res.Notes = model.Notes
}

if !o.decompileOnly && model != nil {
Expand Down
29 changes: 0 additions & 29 deletions pkg/checks/tiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
func init() {
Register("tilefade_validation", "tiles", false, "Detect tilefade on non-TILE models", checkTilefadeValidation)
Register("rotate_texture", "tiles", false, "Detect RotateTexture on non-TILE models", checkRotateTexture)
Register("lightmapped_tile", "tiles", false, "Detect LightMapped on TILE model meshes", checkLightmappedTile)
}

func checkTilefadeValidation(model *mdl.Model, file string, _ bool) []mdl.CheckResult {
Expand Down Expand Up @@ -68,31 +67,3 @@ func checkRotateTexture(model *mdl.Model, file string, _ bool) []mdl.CheckResult
}
return out
}

func checkLightmappedTile(model *mdl.Model, file string, _ bool) []mdl.CheckResult {
if model == nil {
return nil
}
if !strings.EqualFold(model.Classification, "TILE") {
return nil
}
var out []mdl.CheckResult
for _, n := range model.Nodes {
if n == nil || n.Mesh == nil {
continue
}
if n.Mesh.LightMapped != 0 {
out = append(out, mdl.CheckResult{
Check: "lightmapped_tile",
Node: n.Name,
Severity: mdl.SevInfo,
Message: fmt.Sprintf(
"%s: TILE model mesh node %q has LightMapped=%d",
file, n.Name, n.Mesh.LightMapped,
),
Fixed: false,
})
}
}
return out
}
Loading
Loading