Jump to content

Blender -> Secondlife Positioning


Tommy Rampal
 Share

You are about to reply to a thread that has been inactive for 4585 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

So I'm designing a mesh building of quite a large scale, and have split this up into seperate meshes so that it is less harsh when texturing. I have set my scale to how I want it in Secondlife, so I don't have to worry about scaling after uploading.

Though one major problem I am facing right now is trying to take the position coordinates from Blender and recreate it in Secondlife, so it is as accurate as it can be. This doesn't seem to be as straight forward for me. Upon selecting 'Set Origin to Geometry' in Blender, it doesn't seem to set the same origin/pivot point as what Secondlife would upon uploading the mesh. So I don't have any true positioning differences to take to Secondlife.

Any advice guys?
Thanks for your time!

 

Link to comment
Share on other sites

After thinking about this: Maybe one could position a sculpted sphere at each mesh objects' centre. Once in position, (using Dominos blender plugins) export the spheres as a linked object using the sculptie lsl exporter and then re-build inworld.

Once built inworld, replace the sculpts with the mesh pieces in their respective positions.

Link to comment
Share on other sites

The origin/pivot inworld is always the center of the bounding box (until we get offset pivots). The Blender Set Origin To Geometry sets the origin/pivot of the selected object to a position dependent on the setting of the pivot type widget at the bottom of the 3D view. The default for this is Median point, which is not generally the same as the centre of the bounding box. You can set it to Bounding Box Center. Then the Set Origin To Geometry buttton will put the origin there, the same as it will be inworld.

You can also upload several objects at the same time. They will appear as a linkset after upload, with their relative positions conserved. However, you may find problems with getting the right LOD meshes for the cright objects, and there can be problems if you use autoLOD and some objects get decimated away.  Also I have no idea what happens if the objects are too many or too big to be a linkset.

  • Like 1
Link to comment
Share on other sites

I believe the collada node transformations are the same as the object mode transformations in Blender. Those don't affect the origin, but are applied to the origin once the object is rezzed. That's how the positions of the objects in a linkset are conserved. At least that's how it used to be. In the upload process, the local (relative to object origin) vertex positions are scaled and shifted so that they fit exactly inside a perfect unit cube bounding box. That gives the best overall accuracy with minimum data size. Before the object is rezzed, the inverse scaling is applied to restore the geometry, but the shift is lost. That's why there are no offset pivots. The Blender origin is effectively forgotten. Instead, the locating origin and pivot is set to the center of the bounding box. Then the object mode (==node) transformations are applied to each object.

So in the case shown, the object happens to have its Blender origin at 0,0,0. If you move it in Blender (object mode), you should see different numbers here.

However, this may all have changed since I looked at this stuff properly.

  • Like 1
Link to comment
Share on other sites

The physics would need to vary, especially it being a building too right? Does the upload window support that

You mean for uploading multiple objects? Each object has to have its own physics shape. As far as I know, the uploader will try to recognise which object in the physics shape file goes with which visual object, probably by the order of nodes geometries in the collada files (unless it's been updated to use names in some way). If there aren't enough, it will make only the default convex hull for the remaining visual objects. I haven't done enough of this to know how well it works (or how badly it fails) in the present viewers.

ETA Arrggh. Geometry, not node !!!


Link to comment
Share on other sites


Drongle McMahon wrote:

You can also upload several objects at the same time. They will appear as a linkset after upload, with their relative positions conserved. However, you may find problems with getting the right LOD meshes for the cright objects, and there can be problems if you use autoLOD and some objects get decimated away.  Also I have no idea what happens if the objects are too many or too big to be a linkset.

The meshes that are too far to be linked or too many are just left unlinked, so you get a coalesced object with one linkset and the rest separate.

However, the root object may be any mesh in the linkset. and only the root name is preserved, all others are 'Object', so bigger linksets require a lot manual work after uploading.

 

Edit: about the wrong LOD meshes.. i havnt confirmed this with any tests yet but i suspect the mesh uploader sorts the meshes in the linkset by some bounding box dimension (and that's why the linkset is not in the same order as your collada objects and the root may be any of the meshes) and if the sorting is done independently for each LOD, it may lead to different ordering and wrong associations. This needs experimental confirmation.

 

 

Link to comment
Share on other sites


Drongle McMahon wrote:

You mean for uploading multiple objects? Each object has to have its own physics shape

Is that possible? How do you specify physics shapes for the individual objects in a multi object upload?

Also, I'm currently building a boat consisting of like a 1000 separate objects. The physics shape is supposed to wrap around the hull of the boat, but the uploader in stead wraps it around, and scales it to, the last added object in the build. That is, the first object in the geometry section of the collada file. To fix this, I have simply cut and pasted the hull object as the first object in the collada file. Anybody know how to do this a better way?

All other objects in the build, as you say, are assigned a default convex hull as their physics shape. Come to think of it, even the object which have the physics shape assigned to it are assigned a convex hull as a physics shape, resulting in a higher PE/LI than it becomes after changing it.

- Luc -

Link to comment
Share on other sites


Luc Starsider wrote:


Drongle McMahon wrote:

You mean for uploading multiple objects? Each object has to have its own physics shape

Is that possible? How do you specify physics shapes for the individual objects in a multi object upload?

 

Exactly the same way you specify the LOD levels for multiple meshes. I dont know how it's done in Blender but in the collada file they must be specified as separate <geometry> blocks.

 

Link to comment
Share on other sites

LindaB - "if the sorting is done independently for each LOD, it may lead to different ordering and wrong associations."

I did investigate this some time ago. There is discussion in this thread. See especially messages 6 and 15. It was the order of the <geometry> tags in the collada file that controlled which mesh was which at the different LODs (and presumably physics). Of course they may have changed things since then. They certainly made material/face associations depend on names instead of order (which broke all, my dae files). I think that would stop the automatic association of a single physics mesh with the first object though, so it's probably the same as it was. The patch I described to get alphabetical order in Blender so that you could control the order is only for Blender 2.49. No idea about 2.5x.

Luc - Have a look at the link above. It was discussed at some length there. When you only have one physics shape mesh, it will be used for the first <geometry> in the collada file. That is a result of using the ordering for association. If you have more physics shape meshes than visual meshes, the extra ones are ignored (I think). Every mesh (blender object) gets a defualt convex hull which is used when it is first rezzed whether you specify a shape or not. (There is a jira asking for the specified shape to be used if it's there.)

1000 objects is a bit much. If some of them are simple, they will still cost at least 0.5 PE each (server weight). You might be able to get a lot of saving by joining some of them in Blender. A mesh does not have to be completely connected. As long as that doesn't make them need more than 8 materials, it will give a lower download weight. However, it may increase the physics weight if it makes complex default hulls. So you might have to make physics shapes or set them to None to get the benefit.

Link to comment
Share on other sites

Thanks for the explanation Drongle. I'll have a look at the thread you linked to and se if I can make some sense of it. :)

Btw. 1000 objects was a huge exaggeration that didn't come across. (It's more like 20, but it feels like a lot, with meshes for the different LODs, physics and parts in the process of being redesigned. :)) I'll look into it, though, and see if I can join a few objects.

ETA. The penny finally dropped with regards to physics shapes! Duh! Thanks again Drongle and LindaB!

- Luc -

Link to comment
Share on other sites

This isn't really a good pathway for me, as I rebuild my complicated meshes to simple boxes/watered down versions (e.g. a wall or stairs) to save unnessecary physics loading.

Though I took your advice on uploading the entire mesh as a linkset, then used that as a reference when uploaded the building again, piece by piece with specific LODs and physics.

Link to comment
Share on other sites

 

Oh, I thought the LOD mixup problem was collada uploader issue, but from the thread it seems it's Blender issue. I have uploaded linksets of 65 parts, with all LODS and physics and i havnt observed any LOD mixups, but i make the collada files directly, with complete control over the order of the <geometry> elements.

I have other issues with the uploader though, with arbitrary  root and link order, whined about in this thread

hmmm.. i can't get the link work.. in this thread

http://community.secondlife.com/t5/Mesh/Mesh-linkset-root-part-names-and-part-order/td-p/1173915 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4585 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...