sargon, Member Posted: 19 May 2013 08:18 PM Total Posts: 51
Hi.
I have my level done in blender and exported to dae. After importing it to AwayBuilder every thing seems to look great, but after I save the awd file and load it again, every object looks like it was randomly transformed. [the situation is the same when I load awd to engine].
Its look like something goes wrong while saving awd file ?
Am I doing something wrong ? bug ? any help will be very useful !
[Image shows the diferences]
EDIT: Transformation in AwayBuilder shows the same numbers in both situations. (Default)
EDIT2: After loading again awd file I noticed that textures are duplicated one with name “null” and one with name that contains path of the image. Meshes have material assigned with those where name is “null”
Best Regards
80prozent, Sr. Member Posted: 20 May 2013 01:24 AM Total Posts: 430
[ # 1 ]
Hi
I am not shure i understand. I tested lots of AWD import and export, and everything seamed to work.
Just to clarify:
You load the collada. it displays ok. you export as AWD. you import the AWD again. it displays wrong (but the values shown in the properties for translation / rotation / scale are the same as befor exporting as AWD) ?
When loading the Collada into AwayBuilder, you see 1 Material.
When loading the AWD you see 2 Materials ?
I never tried arround with Collada import into AwayBuilder.
Can you send the collada file ?
or try to reproduce the issue with another example-collada file ?
looking at the corruption of your scene, one thing i would check, is how the objects are related to each other in terms of parenting, and if the same Hirarchy is shown in AwayBuilder, that was shown in Blender. Especially check the scale and rotation of the parent-objects in Blender vs scale and rotation they show up in AwayBuilder.
Best Regards
sargon, Member Posted: 20 May 2013 11:37 AM Total Posts: 51
[ # 2 ]
Hi,
“You load the collada. it displays ok. you export as AWD. you import the AWD again. it displays wrong (but the values shown in the properties for translation / rotation / scale are the same as befor exporting as AWD) ?”
exactly… the props of translation/rotation/scale are all defaults 0/0/1 in imported dae or exported awd file (in AwayBuilder).
When loading the Collada into AwayBuilder I see one (origin)Texture (not material) after loading AWD I see two textures with the name that I described before.
I made an example with 3 cubes exported as dae file from blender. each one have different scale and position, after loading awd to AB every thing looks ok on the scene but transformation matrix of all cubes are the same. After changing for example position of cube that aren’t in the 0,0,0 position I see wierd situation that I described here
In zip file I have included dae file, awd file that is the save file after importing dae file to AwayBuilder, and texture.
I noticed that after importing Collada every think looks ok like in blender, but transformation matrix aren’t set, it looks like the geometry have this transoformation or whatever else. After saving awd file all meshes are saved without any transformation, their position scale and rotation are set to 0.
sargon, Member Posted: 20 May 2013 12:52 PM Total Posts: 51
[ # 3 ]
I figured out that AwayBuilder do not save transformation matrix at all ! the Mesh parents in collada file have all information about rotation,scale and position. after saving awd file all those informations are gone, thats why I have this problem.
Can any one from the Away team clear me if I am right?
Will this problem be solved ?
Best Regards
80prozent, Sr. Member Posted: 20 May 2013 07:01 PM Total Posts: 430
[ # 4 ]
Hm
If the AwayBuilder would not save tranformationMatrices at all, how would the objects end up on different positions than 0 / 0 / 0 ?
I dont think thats whats wrong here.
sargon, Member Posted: 20 May 2013 07:51 PM Total Posts: 51
[ # 5 ]
But they are at 0/0/0, all meshes have default position.
I have solved my problem by exporting Lvl to obj file and then in AwayBuilder save it as awd. Every thing works ok here but I must do the materials manually what is quite annoying.
Note : when importing collada file, every mesh has it own object container 3d parent
When loading obj file, every mesh is single mesh without any parent.
Note 2 : when importing collada to away engine all meshes has 0 position, rotation and 1 scale in all axis, the parent contains all transformations, so maybe awayBuilder do not handle this kind of situation properly.
Note 3 : when I have imported collada to away engine (in my game) and add all parsed meshes directly to scene (without parents and collada root) I have the same effect that I get when I save my collada in awayBuilder as awd and reload it again.
So I think it is really problem with saving transformations properly in this case.
Unfortunately I haven’t got time to read awd file to find in it what is going wrong there.
Bests regards
80prozent, Sr. Member Posted: 20 May 2013 08:46 PM Total Posts: 430
[ # 6 ]
Hi
i think the bug is in the collada import in awayBuilder. not with the AWD-export.
Your scene works fine when you use obj right ?
What i think is weird, is that the collada seams to import correctly, while in fact it doesnt import correctly.
Since the AWD works fine, when starting with a obj, it must be the collada that is messing things up somehow.
The export of the TransformationMatrix is quite simple, and done for every SceneObject the same way. It works for all my tests, so i do not see how this should not work for objects that are parsed in by collada, other that this objects do not have the correct transformationMatricies applyed after collada import in the first place.
f you send me the collada-file, i think i can find out whats going on there….
sargon, Member Posted: 21 May 2013 07:04 AM Total Posts: 51
[ # 7 ]
The zip file I seeded above have collada file that reproduce the situation that I am talking about
Regards!
Fabrice Closier, Administrator Posted: 21 May 2013 08:28 AM Total Posts: 1265
[ # 8 ]
The fact that it works with obj format says nothing. Obj format doesn’t store transforms. Transforms are applied to geometry during export.
An obj mesh is always at 0,0,0.
80prozent, Sr. Member Posted: 21 May 2013 06:58 PM Total Posts: 430
[ # 9 ]
Hi Fabrice
Of course you are right. Obj only stores geometry-info, not object-position.
I remember now, that this fact was messing up my zbrush-c4d export-import quite a few times
Hi Sargon
Sorry i didnt noticed the zip earlier…i downloaded it and played arround with the collada parser for some time.
finally figured it out.
In your scene there are 3 mesh-objects, and 4 containers. The UI shows that all objects are in default position (0/0/0), but we definitv know they are not.
This happens because the Collada-parser automaticcaly adds a parent-container for each mesh, and this parent-container is positioned instead of the mesh. What is going wrong at this point, is that the ColladaParser only fires a Asset_Complete event for the mesh, but not for the Parent-Container.
AwayBuilder needs a Asset_Complete event for each Asset to load in correctly. I think the Parent-Container only gets displayed in the scene-library-panel because they are child of another container, for which AwayBuilder had recieved a Complete-Event.
Solution is to add this to the DAEParser.as at Line 597:
finalizeAsset(container);
To test this yourself, you would have to compile the AwayBuilder yourself with FlashBuilder.
I did no test with DAE-Animations or so, so i cannot tell if this fix will mess anything up for Callada-files with animations, but i do not think so.
Hope that makes sense
sargon, Member Posted: 21 May 2013 07:58 PM Total Posts: 51
[ # 10 ]
Thanks for info about obj Fabrice ! Didn’t know.
80prozent thanks so much for help ! I hope I will have time to check it or maybe later release will contain your fix (I am on deadline in my project so I decided to use obj as import format)
Any way very nice performance from using awd ! My level load 2x more faster than dae from 9 sec to 4 sec in Ipad2 so this is huuuuuge ! And quite bit less kb have awd than dae with textures. But maybe in future AB will have option for making shared library just to don’t save the same texture twice.
Thanks for help !!
Best regards
80prozent, Sr. Member Posted: 22 May 2013 01:15 AM Total Posts: 430
[ # 11 ]
Hi Sargon
AwayBuilder-Installer has just been updated.
Collada-import should work fine now. Same for Mesh.castSahdow=false.
In this build, the Import per DragnDrop is broken….should be fixed in the next update again.
[edit: final answer to your question: seams like you did nothing wrong at all. ]
Cheers
Robin
sargon, Member Posted: 22 May 2013 11:54 AM Total Posts: 51
[ # 12 ]