Sac Posted June 13, 2017 Share Posted June 13, 2017 Hi All, We are facing a strange problem when exporting a babylon file from Max. Let us say we have 6 models. when we export, all the 5 models of the six stays intact, but the 6th model, is displaced to the top. Any reason why ? (AS shown in figure attached). 3dsmax version:2017 ,exporter_version:0.4.5 Any possible reason why ? because we are not able to identify why this model alone is displaced after exporting. Regards, Sac Quote Link to comment Share on other sites More sharing options...
Raggar Posted June 13, 2017 Share Posted June 13, 2017 Check the pivot point of the 6th mesh. It should be in the exact same spot as the 5 previous models. Sometimes you'll have to reset the transforms in Edit > Transform toolbox. Quote Link to comment Share on other sites More sharing options...
Sac Posted June 13, 2017 Author Share Posted June 13, 2017 Thank you very much Raggar, My 3d person says that the pivot point for each of the mesh is of its own, and has no relation to each other, and they all get exported properly, and why this gets shifted ? Quote Link to comment Share on other sites More sharing options...
Sac Posted June 13, 2017 Author Share Posted June 13, 2017 He also says that he cant reset the transforms in Edit > transform toolbox, as that will change all the animations(keyframed, not skeletal) embedded in each of the models completely. Quote Link to comment Share on other sites More sharing options...
Sac Posted June 13, 2017 Author Share Posted June 13, 2017 On top of it, the meshes that are exported, is not generating pickResult.hit, so any click on these meshes is not sensed Any help will be much appreciated. As we are new in this, we are out of options as we don't know where we are going wrong. Help Please ! Quote Link to comment Share on other sites More sharing options...
max123 Posted June 13, 2017 Share Posted June 13, 2017 I've seen this happen, this is most likely caused by the keyframed animations. Not sure if it's still relevant or will solve your issues: On 8/24/2016 at 1:57 PM, max123 said: I have reported the same issue here For now, I use the following work-around: - Make sure all animations start at frame 2. - Add suffix to Actions - in Babylon, iterate through all meshes in the scene and initiate animations from Frame1 to Frame2, like so: for (var i = 0; i < meshes.length; i++) { var obj = meshes[i]; if(obj.animations.length > 0) { scene.beginAnimation(obj, 1, 2); } } I do hope this gets fixed though as sometimes this creates weird jumps. Quote Link to comment Share on other sites More sharing options...
Sac Posted June 13, 2017 Author Share Posted June 13, 2017 Thank you very much for the reply. The work around looks tough, how has it costed you on performance ? Quote Link to comment Share on other sites More sharing options...
max123 Posted June 13, 2017 Share Posted June 13, 2017 There's no cost: the code is not in the render loop and runs just once Quote Link to comment Share on other sites More sharing options...
Sac Posted June 13, 2017 Author Share Posted June 13, 2017 True, Cool. Will try it out. Once again thanks a lot. Also any idea why the pickResult.hit, is not happening on these meshes (I used Append to add them to the scene) ? Quote Link to comment Share on other sites More sharing options...
max123 Posted June 13, 2017 Share Posted June 13, 2017 33 minutes ago, Sac said: Also any idea why the pickResult.hit, is not happening on these meshes (I used Append to add them to the scene) ? Something do with local vs global coordinates? I think pickResult.hit works in local space. Quote Link to comment Share on other sites More sharing options...
brianzinn Posted June 13, 2017 Share Posted June 13, 2017 Are they pickable - ie: in loader set importedMesh.isPickable = true? Quote Link to comment Share on other sites More sharing options...
Sac Posted June 13, 2017 Author Share Posted June 13, 2017 Just now, brianzinn said: Are they pickable - ie: in loader set importedMesh.isPickable = true? How to set it Pickable ? I am using Append to load the meshes, and I cycled through the loaded meshes and did mesh.pickable = true; but no effect. Quote Link to comment Share on other sites More sharing options...
brianzinn Posted June 13, 2017 Share Posted June 13, 2017 it's isPickable, but it's true by default, so not sure if that would be causing it. It's the only way I've seen something being not pickable unless I had multiple viewports. https://doc.babylonjs.com/classes/2.5/abstractmesh#ispickable-boolean Quote Link to comment Share on other sites More sharing options...
Sac Posted June 14, 2017 Author Share Posted June 14, 2017 Thank you Brian, I will modify it. AS you said it should be by default true, but it is false (may be because it is exported from Max). Quote Link to comment Share on other sites More sharing options...
Sac Posted June 14, 2017 Author Share Posted June 14, 2017 A small Update, It is working smoothly now when I set isPickable of that mesh to true. Thank you once again for pointing it out. Quote Link to comment Share on other sites More sharing options...
Sac Posted June 15, 2017 Author Share Posted June 15, 2017 unfortunately, further revelations, The Weirdness doesn't stop with just displacing a mesh. Some of the meshes do not have materials and its values applied from max. and further more, some mesh has texture UVs and some doesn't have the texture UVs, and on top of it the ones which has texture UVs doesn't have the texture name in it. Is there something that we are missing in Max or in exporter that causes these problems ? Can someone throw some light on me, so we can correct our wrongs. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 15, 2017 Share Posted June 15, 2017 Can you try to reset xform + empty the stack of each meshes in 3dsmax? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.