Hi vizgl
Thanks for the reports. I have fixed the problem with full paths always being used, you can build v1.7.2 now.
vizgl wrote:
And another request, please add "path" ref to object into raw json file, it'w will be very usefull(I want bind real as3 class with rube object)
The path of objects is actually being exported, but nothing will be written if the path is empty (absence of a path property is interpreted as path = "", that is, no nested parent). You should see a "path" property for cases where objects are nested though. However, I would like to point out that this part of the export is not supported right now. So I have not mentioned this in the exported file format documentation, and I have not added any facility in b2dJson to use the "object" part of exported json files. The position, scale and angle properties are not very useful because they are relative to their parent, and there is no convenient way to traverse the structure and get the final transformed values. Custom properties are there though, which could be more useful. I want to have a better way to present this data in future, so the format may change a little which is why I'm not publicizing it right now.
What is supported now though, is getting the path of each item (body,joint,fixture,image) that was generated from an object instance. It's only in C++ b2dJson at the moment, but there are functions like getBodyPath, getBodiesByPath, getBodyByPathAndName. Perhaps you could pick one body from your object and get the path of it to use for your class matching.
I was not able to reproduce the other error you described, where the image was not attached to the body. Perhaps you had not yet saved the "hero.rube" with the image attached...? When objects are processed for export or for the player view, they use the file as it exists on disk. If you have a referenced object open in another view, you'll need to save it first before the changes will take effect in any references processed for that file.