Jump to content
Sy Beck

Aligning Imported Mesh Objects

Recommended Posts

I'm building a very large and complex shaped house, which at the moment is made up of 7 separate objects and will likely increase further and it has many curved surfaces that have to be accurately aligned together when assembled inworld.

So far on the beta grid I've just been eyeballing the alignment to check build quality and physics models etc, but as I progress further away from what I'll call my anchor object (first object imported) that I started aligning subsequent objects to any discrepancy in the initial alignments is telescoping out to larger misalignments further down the assembly process.  This hadn't bothered me so far as I had read in the past of something called cube/box alignment where each mesh object is imported as a linkset with a common single cube that you then make the root prim and set to say X:10 Y:10 Z:10 and as you import each object you set that root prim to the same coordinates then delete it and everything should align perfectly, which it does.

However the problem that I've run into is that it is breaking all my physics models.  First of all for ease I used just one common cube for all the mesh objects set to 0,0,0, , but inworld as I imported pieces that were further away from that location the cube was outside of the bounding box or rather the bounding box that was dictated in the original object and it broke its physics model.  I slapped myself for not realising that would happen beforehand and then gave each object its own cube but nestled within each object's bounding box and each cube was a set distance from the previous one so that I could easily replicate the offset inworld.  Once again though, for whatever reason the physics models were broken and I ended up with convex hulls even though the prim option was there and enabled.

My only workaround at the moment is to use the method above to get everything inworld and correctly aligned and then import the objects again without a cube and copy paste them to already aligned objects' coordinates, which I guess will work, but is tedious and obviously more expensive once I import to the main grid.

So my questions are, does the cube alignment system really work, if so what am I doing wrong and is there an easier or better way?  I did search the forum(s), but I couldn't find a similar topic or the original thread/post I recalled about this process so thanks in advance for anybody who links/points me to some.

Share this post


Link to post
Share on other sites

One important tip there: round off the sizes and locations for all elements at least to the nearest 2 mm, preferably to the nearest cm. If you don't, they will never line up properly in SL. If you do, aligning the elements should only be a question of typing the right numbers into the position fields. I prefer to do the math for this but you can also nudge the parts mm by mm - or possibly use Firestorm's elignment tool.

Also, keep in mind that Blender from significant vertice drift. So the last thing you do before exporting, is check that all vertices along the joint lines and the vertices defining the total size are all in exactly the right position.

Edited by ChinRey

Share this post


Link to post
Share on other sites
21 minutes ago, ChinRey said:

One important tip there: round off the sizes and locations for all elements at least to the nearest 2 mm, preferably to the nearest cm. If you don't, they will never line up properly in SL. If you do, aligning the elements should only be a question of typing the right numbers into the position fields. I prefer to do the math for this but you can also nudge the parts mm by mm - or possibly use Firestorm's elignment tool.

Also, keep in mind that Blender from significant vertice drift. So the last thing you do before exporting, is check that all vertices along the joint lines and the vertices defining the total size are all in exactly the right position.

Thanks for quick reply ChinRey.  I do build to scale and to a grid and everything is rounded to whole integers, I use Maya by the way.  I'd imagine that FS's alignment tool would be useless as it can only align to the extremities of X,Y,Z and therefore can't help if you want to align to something within those extremities.  You're correct that "doing the math" is an answer even if a long and tedious answer to the problem. 

However, my question was about this cube alignment process, which is at the most 3 copy and pastes per object for a perfect alignment except for the fact that it's breaking the physics models and whether it is a viable process and if so what I'm doing wrong with it.  If it isn't viable then I have the workaround I mentioned previously to fall back on or as you suggest, do the math ?

Share this post


Link to post
Share on other sites

When importing linksets, it's essential that you have a separate physics object for each mesh object in the dae file. And those physics objects have to be named properly in your modeling software, to get them assigned to the correct mesh counterpart by the importer.

Quote

The mesh uploader uses very strict naming rules for these custom LOD files:

  • File names ending with "_LOD2" must be used for Medium level of detail
  • File names ending with "_LOD1" must be used for Low level of detail
  • File names ending with "_LOD0" must be used for Lowest level of detail
  • File names ending with "_PHYS" must be used for the model's physics shape

 

Share this post


Link to post
Share on other sites
40 minutes ago, arton Rotaru said:

When importing linksets, it's essential that you have a separate physics object for each mesh object in the dae file. And those physics objects have to be named properly in your modeling software, to get them assigned to the correct mesh counterpart by the importer.

 

Damn do I feel stupid.  Went back and looked and saw that the physics model for the alignment cube wasn't named properly and that on some exports the cube's physics model wasn't even attached/linked to an object's physics model in some cases.

Thank you Arton for solving my brain fart.  Lesson learned, don't work late into the night and if you do then lay off the gin and tonics!  ?

  • Like 1

Share this post


Link to post
Share on other sites

I really don't understand that extra cube part of the process as I have uploaded houses as a linkset without them -- thus being able to have more than eight materials in a model (each part of the linkset can have eight). No extra alignment "cube" was needed. 

Just in case someone is wondering about this process, here is the tutorial :D. Very handy now and then, but really better if you can LIMIT those materials to eight. *wink*. It always depends on the process.   AND there was actually really no reason to upload those gravestone markers in the tutorial as one mesh linkset -- except for saving Lindens. But it was what I was working on and I used it as an example.  Just saying.

 

Edited by Chic Aeon

Share this post


Link to post
Share on other sites

The alignment cube is nothing to do with textures or materials.  It's about accurately aligning your objects inworld e.g. making sure the walls of one room align exactly with the walls of another room if you're not going to import a whole house as one linkset but bring in each object separately.

Share this post


Link to post
Share on other sites

I made myself a python routine in Maya to extrapolate LSL script compatible data, write it down into a script to import and that does the job for me (and the counterpart LSL scripts to make this possible in SL). Demonstration video using quickly made objects. It's tuned to reassemble builds sim-wide, so you can rebuild single buildings, then make a whole sim scene with those buildings within Maya and reconstruct the whole sim from the previously rebuilt single buildings too, with absolute precision in location and rotation.

If you're doing it in Blender, you may want to try and make your own version of it. What you need is to extrapolate quaternions (rotation) for objects, and their absolute location in the scene, assuming that 0,0,0 is the box you rez things from AND that every object has its origin point set to geometry center.

Share this post


Link to post
Share on other sites
28 minutes ago, OptimoMaximo said:

I made myself a python routine in Maya to extrapolate LSL script compatible data, write it down into a script to import and that does the job for me (and the counterpart LSL scripts to make this possible in SL). Demonstration video using quickly made objects. It's tuned to reassemble builds sim-wide, so you can rebuild single buildings, then make a whole sim scene with those buildings within Maya and reconstruct the whole sim from the previously rebuilt single buildings too, with absolute precision in location and rotation.

If you're doing it in Blender, you may want to try and make your own version of it. What you need is to extrapolate quaternions (rotation) for objects, and their absolute location in the scene, assuming that 0,0,0 is the box you rez things from AND that every object has its origin point set to geometry center.

That looks to be exactly what I need, now and in the future!  Can you clarify something.  In Maya (I'm using 2018 btw) I can select all the objects of a house say and run the script and can I then upload each of those objects separately into SL and drop them in box and get the same result or do I have to upload the object as a linkset?  It appears that I could upload separately (with no model changes obviously) and it would still reassemble them and what if I were to run the script without some of the original objects included for changes on the fly inworld?

Genius little script Optimo you've definitely got my interest and nearly my L$ ?

Share this post


Link to post
Share on other sites
1 hour ago, Sy Beck said:

That looks to be exactly what I need, now and in the future!  Can you clarify something.  In Maya (I'm using 2018 btw) I can select all the objects of a house say and run the script and can I then upload each of those objects separately into SL and drop them in box and get the same result or do I have to upload the object as a linkset?  It appears that I could upload separately (with no model changes obviously) and it would still reassemble them and what if I were to run the script without some of the original objects included for changes on the fly inworld?

Exactly that, separate objects, no linksets :) it will work based upon your selection, provided you won't move anything within your scene, and you can do it in separate iterations. Just remember that LSL lists are limited to 72 entries when initialized as populated already (the only way i could make it work), so a limit of 72 objects per time. It's based on objects names from Maya, so in my video example there are several columns, i uploaded just one and renamed it inworld to match the names within the script. If i had 144 objects, i would start with first 72 (my script warns you when you exceed the limit), export the scene script, move them to a visibility layer and turn it off, select the next 72 and repeat, exporting a second script with a meaningful name. Once you're done, in SL, add the repositioner script in the all the pieces and take them back to inventory. Throw them in a cube's inventory, create a new script and load in the first script you generated , then click the box. Wait until it's done with the first set, then load the second script and click. Etc etc :) 

 

Share this post


Link to post
Share on other sites
4 hours ago, Sy Beck said:

The alignment cube is nothing to do with textures or materials.  It's about accurately aligning your objects inworld e.g. making sure the walls of one room align exactly with the walls of another room if you're not going to import a whole house as one linkset but bring in each object separately.

But you don't NEED to bring them in separately.  That was my point. You can bring them in all at once LINKED and they can EACH have up to 8 materials. If you can do that in Blender, you can certainly do that in Maya (one would think :D )  I suspect that you didn't get to the end of the video and that's OK> 

But we each do things our own way. I hope yours works out for you. And hopefully this will help other folks that find the thread. 

 

 

Edited by Chic Aeon

Share this post


Link to post
Share on other sites
8 minutes ago, Chic Aeon said:

But you don't NEED to bring them in separately.  That was my point. You can bring them in all at once LINKED and they can EACH have up to 8 materials. If you can do that in Blender, you can certainly do that in Maya (one would think :D )  I suspect that you didn't get to the end of the video and that's OK> 

But we each do things our own way. I hope yours works out for you. And hopefully this will help other folks that find the thread. 

 

 

I do "NEED" to bring them in separately.  It's a large build and the difference already between uploading a linkedset and uploading each object individually is @40 LI and that will only rise as I add more on.  I'm well aware of material limits to each object, but that has nothing to do with this situation, which was about aligning individual objects inworld IF I have to bring them in separately.

Share this post


Link to post
Share on other sites
22 minutes ago, Sy Beck said:

I do "NEED" to bring them in separately.  It's a large build and the difference already between uploading a linkedset and uploading each object individually is @40 LI and that will only rise as I add more on.  I'm well aware of material limits to each object, but that has nothing to do with this situation, which was about aligning individual objects inworld IF I have to bring them in separately.

OK. I have done tests a few times and found no difference between linkset and separate but assume you have. Good luck!

 

Share this post


Link to post
Share on other sites
7 hours ago, Chic Aeon said:

OK. I have done tests a few times and found no difference between linkset and separate but assume you have. Good luck!

I made this tool because builds with a more organic shape do not keep LoDs consistency between linkset and single objects uploads, when using the LoD generator in the upload window, whereas single objects give you more control over the GLoD degradation. It is also easier for physics shapes assignment, avoiding the exact renaming if you will. Moreover, this is designed to work on sim-wide distances for recreating whole scenes, so one can either group a whole build and use that to reposition a series of already reconstructed and linked ones inworld.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...