diff¶
diff imports two models and prints how they differ, one thing at a time. It compares the model’s contents, not how the files are formatted, so it works across formats: you can compare a CMO3 file with the MOC3 file that was exported from it.
Synopsis¶
diff <a> <b>
a and b are CMO3 files, MOC3 files, or .model3.json manifests, in any combination. diff takes no options. For example:
./gradlew -q :cli:run --args="diff before.cmo3 after.moc3"
Output Format¶
Two models that match print:
identical
Otherwise diff prints one section for each type of data that differs, in this order: [parameters], [parameterGroups], [parts], [deformers], [drawables], [glues], and [document]. A type with no differences has no section. Under a heading there is a line for each data item that differs, and the first character says how:
Line |
Meaning |
|---|---|
|
The data is only in |
|
The data is only in |
|
The data is in both, and the listed fields are different. |
[parts]
~ PartFace [GROUP_MODE]
~ PartEye [GROUP_MODE, COMPOSITE]
[document]
~ [SOURCE_LAYER_DISPLAY]
The id is the id of the parameter, group, part, deformer, or drawable. A glue has no id of its own, so it is named by the two drawables it joins and its number among the glues that join the same two, as in MeshA~MeshB#0. Under [document] there is no id, because the differences are in the model as a whole.
A changed data item lists the names of what differs. They are always listed in the same order, which is the order of the table below.
Section |
Fields |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Exit Code¶
A difference is not a failure. diff exits with 0 whether the models match or not, so read the output, and not the exit code, to find out which. The exit codes 1 and 2 are for the usual problems: a file that cannot be read, or a file that is the wrong kind. See Command Line.
Inputs¶
Both files are imported the way the editor imports them, and are compared in the same canvas space. A model in the CMO3 format and a model in the MOC3 format are comparable to each other.
Names, parameter groups, and linked parameters of a MOC3 model come from its .cdi3.json. Without one, those differ from a CMO3 model that has them, and a warning is generated.
diff needs a rig, so an artwork file is a usage error.