Mira Posted May 28, 2014 Author Share Posted May 28, 2014 gryff, thank you for your work! Yep, I know that this model is not good and export from skp->3ds->babylon just get it worse. Another models is loading okay, but they are have much more simple structure. Can you help me with second question? How to load mesh into the scene with their own texture? I wrote what I had change names of the textures in Blender but it doesnt work and all mesh which have been imported by ImportMesh have the textures of first loaded scene . Quote Link to comment Share on other sites More sharing options...
Wingnut Posted May 28, 2014 Share Posted May 28, 2014 If I may try to clarify the 2nd question, Mira, you imported mesh into Blender... using its ImportMesh option, then you renamed the textures that were on those mesh, but the textures stayed the same? I think that is normal. I think you have to somehow remove the textures from the imported mesh, and then apply new textures (with any name you choose). An imported mesh that has textures applied... will likely keep those textures even if they are renamed. Likely you need to remove the textures from the imported mesh, and then apply new textures... with Blender. But I am not a Blender user... so I am guessing. Modeling is lots of work, yes? Importing and exporting is even more work. Importing from Google Sketchpad... directly into Blender, without having to use 3DS... would be better, if possible. Using ONLY Blender would probably be the best, but I understand that Google has many nice models for Sketchpad. And thanks Gryff, and anyone else who is working with Mira's experiments. Mira, I hope the teacher realizes that you are trying things that are not easy at all, and you are experiencing the same problems with importing and exporting... that experts also have. Each modeling software handles their meshes/models differently, and there is not much cooperating... it seems. I think you will find that babylon.js will work very nicely... once the modeling is fixed... if it can be. I hope you get to play with a non-imported babylon.js BOX and GROUND someday soon, because there is lots of fun that can be had with those simple models... in babylon.js. And particles... oh they are fun. And physics applyImpulse... LOTS of fun. Sprites... fun. Shadows and animated lights and mesh... fun... and all easy. (Easier than loading complex models after going through many imports and exports.) Stay positive. Quote Link to comment Share on other sites More sharing options...
gryff Posted May 29, 2014 Share Posted May 29, 2014 Ok Mira an update for you. See image below - the 1K mesh babylon (in purple) loaded into scene with all the other meshes using your code. Now to get that to work I did the following things: 1. Removed any mesh faces that had no material assigned.2. Removed the faces for the little person. (If you want to keep that figure then it should be made a seperate object as to see it from both sides you would need to turn off backFaceCulling - no need to do that for the whole mesh.)3. Removed all those isolated vertices.4. Removed all the materials and textures, then assigned one simple material for the whole building - purple. It loads into your scene - and does not crash my browser - so even though the mesh topology is not great it can still be loaded. I have been through those materials and textures trying to see what maybe happening materials. 1.That mesh has 29 materials that make up one Multimaterial in the .babylon file, and those materials use 19 textures (some of which are massive in size)2. Very few of the textures are "Power Of Two" (POT) textures. Not sure what impact this has for WebGL and babylon.js as textures for your other models are also rarely POT.3. Materials _103, _104, _105, _201 seem to be the worst offenders.4. The texture for material _201 is 2 MB in size, yet is used to texture only 6 faces that are rather insignicant (horizontal guttering on back of the building). A sheer waste of bandwidth. So in a nutshell, there seem to be big issues with the materials and textures for this mesh cheers, gryff Quote Link to comment Share on other sites More sharing options...
Mira Posted June 5, 2014 Author Share Posted June 5, 2014 HI to everyone again! I have a really progress with my models, but I still cant understand problem with texturing of my models. May its problem just on my notebook, can someone help me and check? Now I see all models with the same textureThanks in advance!https://www.dropbox.com/s/7q5inf6jlhawmm6/htdocs.rar Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 5, 2014 Share Posted June 5, 2014 Hi Mira, I watch and I board not a problem with textures.but I noticed that all your objects does not 'name', (in BABYLON.SceneLoader.ImportMesh("??", .......)) you should give name to each object (real name of the objects when you saved).You'll have to furnish a scale your objects and can be repositioned. If all of your objects uses the same texture is that they have the same name I think. Quote Link to comment Share on other sites More sharing options...
Mira Posted June 6, 2014 Author Share Posted June 6, 2014 dad72, I create a new scene in Blender now where I define names for two objects like https://www.dropbox.com/s/w6544dbw04i1xx6/%D0%A1%D0%BA%D1%80%D0%B8%D0%BD%D1%88%D0%BE%D1%82%202014-06-06%2015.51.49.png and load with ImportMesh to my web-page using name of objects , but this models doesn't loadind )May be I do smth wrong ?https://www.dropbox.com/s/7q5inf6jlhawmm6/htdocs.rar here is my cod Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 6, 2014 Share Posted June 6, 2014 I'm sorry mira, I do not use blender, I don't know. I use 3ds max 2013. In importMesh, need the actual name so that it loads correctly Quote Link to comment Share on other sites More sharing options...
Mira Posted June 6, 2014 Author Share Posted June 6, 2014 dad72, name that you define in 3dsmax? I try to make analogy ) Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 6, 2014 Share Posted June 6, 2014 In your ca must be fields Items but I'm not sure. Quote Link to comment Share on other sites More sharing options...
Mira Posted June 6, 2014 Author Share Posted June 6, 2014 dad72, yep I did it like this way , but it still not ok Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 6, 2014 Share Posted June 6, 2014 I do not know how to help you more. Quote Link to comment Share on other sites More sharing options...
Mira Posted June 6, 2014 Author Share Posted June 6, 2014 dad72, I will try, thank you! Quote Link to comment Share on other sites More sharing options...
Mira Posted June 6, 2014 Author Share Posted June 6, 2014 One more question: How to change position of object, which was loaded by SceneLoader.ImportMesh? Is exist something like newMeshes[0].position = BABYLON.Vector3.Zero();newMeshes[0].position = new BABYLON.Vector3(9,9,-21);? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 6, 2014 Share Posted June 6, 2014 Yes you can do that. Quote Link to comment Share on other sites More sharing options...
Mira Posted June 6, 2014 Author Share Posted June 6, 2014 Oh Im so sorry!)) I too much study today ) I mean SceneLoader.Load, not ImportMesh Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 6, 2014 Share Posted June 6, 2014 You can also Quote Link to comment Share on other sites More sharing options...
Mira Posted June 12, 2014 Author Share Posted June 12, 2014 gryff, hello again I know you use Blender for import/export to Babylon, so can you ask for my question again please I have created a new model and solved problems with loading, but it still doesnt work with texturing https://www.dropbox.com/s/ji59k9hccgq64sx/1212.png I named model in blenderTried load from one directory and from separateTextures have different namesWhat else? Quote Link to comment Share on other sites More sharing options...
Wingnut Posted June 12, 2014 Share Posted June 12, 2014 Mira, where's the link to your .rar or .zip file that contains your textures, your .blender file and your .babylon file? Are the textures looking good when viewed/rendered in Blender, before export? (thanks) Quote Link to comment Share on other sites More sharing options...
Mira Posted June 12, 2014 Author Share Posted June 12, 2014 https://www.dropbox.com/s/bjmoydrc7rgthge/loadingsc.rar - here is my scene https://www.dropbox.com/s/x87ph1vhmkve4r3/blen.rar - here is blend files Yep, all is looking good, but I cant understand what the problem with textures Quote Link to comment Share on other sites More sharing options...
Mira Posted June 13, 2014 Author Share Posted June 13, 2014 "Valid manifest file not found. Scene & textures will be loaded directly from the web server." I have this kind of mistake when I import meshes. Can it be a reason for my problem with texture? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 13, 2014 Share Posted June 13, 2014 Hi Mira, No, it has no consequence, it's just a cache management and this file is not required. Your problem is either a the export of the models, or improper use of the code. Can be in us showing the part of code that loads your models, you will get more help. Quote Link to comment Share on other sites More sharing options...
Mira Posted June 13, 2014 Author Share Posted June 13, 2014 https://www.dropbox.com/s/bjmoydrc7rgthge/loadingsc.rar - here is my scenehttps://www.dropbox.com/s/x87ph1vhmkve4r3/blen.rar - here is blend files Yep, all is looking good, but I cant understand what the problem with textureshere is my code and blend files I use ImportMesh function likeBABYLON.SceneLoader.Load("mesh/3/", "3.babylon", engine, function (newScene) {BABYLON.SceneLoader.ImportMesh("tulpan", "mesh/tulpan/", "tulpan.babylon", newScene, function (newMeshes) {newMeshes[0].position = BABYLON.Vector3.Zero();newMeshes[0].position = new BABYLON.Vector3(-6,6,15);newMeshes[0].scaling.x = 0.1;newMeshes[0].scaling.y = 0.1;newMeshes[0].scaling.z = 0.1; }); BABYLON.SceneLoader.ImportMesh("dfk", "mesh/dfk/", "dfk.babylon", newScene, function (newMeshes) {newMeshes[0].position = BABYLON.Vector3.Zero();newMeshes[0].position = new BABYLON.Vector3(14.5,9,-24.5); }); Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 14, 2014 Share Posted June 14, 2014 Check with console.log (newMeshes) data (You will see the materials that the object uses.) Quote Link to comment Share on other sites More sharing options...
Mira Posted June 14, 2014 Author Share Posted June 14, 2014 dad72yep,l checked, meshes have right ID but they have used texture from scene whose that loaded first https://www.dropbox.com/s/ekozpt41bn6u8od/%D0%A1%D0%BA%D1%80%D0%B8%D0%BD%D1%88%D0%BE%D1%82%202014-06-14%2007.08.24.png Quote Link to comment Share on other sites More sharing options...
Mira Posted June 14, 2014 Author Share Posted June 14, 2014 how I can fix it? 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.