Allow to export not overridden properties in json

Would it be possible to add an option for the export command to allow us to export default values of objects in json format?

Thank you :slight_smile:

Edit > Preferences > Resolve object types and properties

The CLI equivalent is including the --resolve-types-and-properties option.

Note that this is currently bugged for class member values when classes are used as property types, those are still not resolved. Any regular properties are resolved correctly.

Thank you for you quick answer :slight_smile:

I already added this option in my command.
To clarify my situation: I have an object layer where I put tiles as objects, all theses tiles come from the same tileset where I set their type as a custom object type so they inherit its custom properties.
But theses porperties are present in the json file only if I override them in the objects placed on the map.
Is this the bug you are mentionning?

No, the bug I mentioned only applies to properties which are custom classes, the members of those classes aren’t written out even with those options enabled. Basic inherited properties should be resolved fine.

Does the export option work for you if you use it from the GUI? If it’s broken in the CLI, that could be a separate bug. Double-check your spelling of the option though, and that it has --, not -.

If you think you’re seeing a bug, please provide information on the OS and Tiled version you’re using, as well as details on how you’re doing your exports (exact CLI command, for example).

OS: Windows 10 - Tiled version: 1.8.5

-I have an object “City” with properties faction, population and provinceId
-a tileset with my different cities where I set their type as “City” and override only the faction property
-an object layer “Cities” where I placed theses tiles and override the population and provinceId properties

-I created a project command with the argument %mapfile and linekd to a .bat file containing the line
“tiled.exe --export-map json %mapFileTmx% %mapFileJson% --resolve-types-and-properties”
this creates a json file whre my cities objects only contain the population and provinceId properties

btw I tested to export it via Tiled as you suggested, the “Resolve object types and properties” was checked and the exported file (.tmj or .json) correctly contained all cities properties.

So you’re right, I 'm sorry I thought it was not implemented.
Do I post a bug ticket or maybe there is something I 'm doing wrong?

If it’s the same map, --resolve-types-and-properties should work the same in the GUI and in CLI, so if it doesn’t, that’s a bug. This forum thread can be your bug report, you should be able to edit it to be in the Bug section, and you may want to edit the title to say something like “CLI --resolve-types-and-properties doesn’t work”. If you can’t change the section, then leave it where it is and bjorn can move it for you when he’s back.

I can’t find where to edit this post :confused: