Null / undefined object fields are not exported

Hi :slight_smile:

I enabled the option to export default value fields and it does work for others field types but for object field type, any undefined / 0 value won’t be exported, causing lot of troubles trying to recover my data with my tools.
Can we imagine having the value “0” used for undefined ? I believe 0 is never used as object id, otherwise we could always use an empty value. Thanks !

Welcome to the Tiled forum, @Stephane-D!

Do you mean the “Resolve object types and properties” export option?

In which format? I tried this with both the JSON and TMX formats and I got a 0 for any unset object reference property, as follows:

                        {
                         "name":"o",
                         "type":"object",
                         "value":0
                        }],
    <property name="o" type="object" value="0"/>

Thanks for your fast reply !

Do you mean the “Resolve object types and properties” export option?

Yeah exactly :slight_smile: Sorry for not being very precise, I didn’t remembered well the setting name.

In which format? I tried this with both the JSON and TMX formats and I got a 0 for any unset object reference property, as follows:

It was TMX format, but i realized then that the bug only happen for embedded object fields !
Here’s a description of what i mean:


The embedded base object fields are not exported when having their default value (tested with both an object and boolean field now) while others are correctly exported.

Best.

Right, that is indeed not limited to object fields. This problem is covered by the following issue:

So it’s on the list of things to improve. Since there are multiple people looking for this functionality I could try to get around to it soon.

Oh indeed it seems to be the same issue, sorry for the duplicate, i should have checked Github issue as well ! Will follow the issue then.
Thanks again for your reply :slight_smile:
It would be nice if it could get addressed as that is indeed a bug preventing my tools to work and there is no easy workaround on my side (I have many different object types so i can’t just hardcode everything for now :-/)

1 Like