Jump to content

Object pivot point.


Johan Laurasia
 Share

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

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

Recommended Posts

Ok, I've been gone a while, and I understand things change, but this is odd to me.  When mesh was first brought into SL, the pivot point you defined in Blender (by editing the object in edit mode, selecting all the verts, and adjusting it's position relative to the object center) was a way to adjust the registration point.  Life was simple.  So lately, I'm making some things that need a pivot point located other than the geometric center of the object, and, as before, I'm editing the mesh in Blender and moving the mesh to where it needs to be to set the object center where I want the pivot point.  However, when I upload it to second life, SL seems to ignore where I set the registration point and rotates the object about the geometric center. 

 

What Gives?

 

Link to comment
Share on other sites

I have to imagine your recollections are inaccurate. As far as I remember, the inworld pivot/origin has always been the center of the xyz-aligned bounding box. During the beta, there was an experimental pivot offset mechanism, but it was discarded. However, if you are using Blender, there is are two simple ways to move the pivot. However, both of these are ways of extending the bounding box beyond the extent of the visible and physics meshes. That inevitably increases the LOD switch distance, and therefore the download weight.

First is the invisible tab method, described in an old thread. The trick here is how to make sure the added tab doesn't get included in the physics. This is undocumented and is therefore not guaranteed to be everlasting. It's unlikely any changes would affect existing assets though.

The second depends on an even more ubscure "feature", that I did actually report as a bug. So it may be even less likely to remain effective. Again, any change is unlikely to affect existing content. It depends on the detail of how the bounding box is initialised in the uploader, as a zero-sized box at the position of the first encountered geometric point. Subsequently, the box is updated whenever any corner of any triangle lies outside it. If the first point in the collada file is outside the bounding box of all triangles, then the final box will still include that outlying point. So all we need to do is to add a point in the appropriate place, and make it first in the list.

Here is how to do it in Blender, for a simple door. There are variations, of course, in how to place the extra vertex. The crucial step is the sorting of the elements so that the extra point, not part of a triangle, is first.



1. A simple door.

2. Snap the cursor to where you want the pivot/origin. Set editing to cursor mode.

3. Extrude the opposite extreme point and mirror it in X, Y and Z.

4. Snap the cursor to the extra point.

5. Select all and sort elements (Mesh->Sort Elements->Cursor Distance).

Here is the result inworld...



ETA: To get the physics right for this door, it is essential to use the high LOD, then to "Analyze", and to set the type to "Prim. Otherwise the whole bounding box will be solid with an invisible other half. If the door is more complex, then you could use a simple mesh like this as the physics mesh, remembering to Analyze and set to Prim.

ETA: Also, don't forget to add the extra poit to all LODs and to redo the sorting before you export after any changes!

  • Like 1
Link to comment
Share on other sites

Good tip to remind us about, Drongle.

I'd prefer myself probably to calculate the offset through scripting instead, rather than 'hard-modelling' (made up word :D) it into the mesh itself. Is there any reason why scripting wouldn't be preferrable over this method?

Link to comment
Share on other sites

Thanks for the verbose explanation Drongle, I had already figured out that I can add the extra vert offset so that the registration point is where it needs to be, I was just wondering why things had changed.  My memory definitely serves me correctly though.  One used to be able to simply edit a mesh and select all verts, and the move the mesh so that the object center would wind up being offset, and it did work throughout beta and even into when it was first released.  I was just curious as to why that had changed.

Thanks again for the info though.

 

- Johan

Link to comment
Share on other sites


Johan Laurasia wrote:

Thanks for the verbose explanation Drongle, I had already figured out that I can add the extra vert offset so that the registration point is where it needs to be,
I was just wondering why things had changed.
 My memory definitely serves me correctly though.  One used to be able to simply edit a mesh and select all verts, and the move the mesh so that the object center would wind up being offset, and it did work throughout beta and even into when it was first released.
 I was just curious as to why that had changed.

Thanks again for the info though.

 

- Johan

When I asked you, you did not say you "were wondering why things have changed", you said you were wondering:

"how to adjust the pivot point of a mesh object in blender before uploading to SL so that when it uploads to SL, it pivots at the point I set, not the center."  If you already knew the answer, Drongle would not have taken his time to give you nice detailed instructions.

And no, nothing changed. 

Link to comment
Share on other sites

Yeah right, nothing changed in that regard. The pivot offset never made it on the main grid. The method used was a quick try from Prep to make pivot offsets work, but it never took the collision shape into account as well.

However, in fact it was possible to upload a mesh with that flawed pivot offset even after that abillity was removed during beta. It only worked with meshes which had been uploaded while that offset worked, and you kept the generated .slm file of that mesh upload as well. Uploading that mesh again (after the removal of the offset abillity) utilizing the .slm file during import, kept the pivot offset in-world as well.

Link to comment
Share on other sites


entity0x wrote:

Good tip to remind us about, Drongle.

I'd prefer myself probably to calculate the offset through scripting instead, rather than 'hard-modelling' (made up word
:D
) it into the mesh itself. Is there any reason why scripting wouldn't be preferrable over this method?

I used to do it with scripting only as well. And probably I would do on large meshes as well today. Because of the LI savings. On anything else I rather add the extra bit to make scripting much easier, and make use of TARGET_OMEGA smooth rotations. Unless you use like a 100 steps on a 90° turn it's still kinda wonky even when it's in a single llSLPPF call with sripting only.

Link to comment
Share on other sites

I agree that you needed that extra geometry when I started (about four years ago). Lots of conversation on the board then about it as there were plenty of new to mesh folks.  No one EVER mentioned that it had changed but I do remember Drongle saying that pivot points had been tested on the beta grid.  So perhaps it was the beta grid that is the "moving pivot point" memory --- OR for that matter another platform.

 

I always blame my memories that don't coincide with those of others on that alternate world thing -- you know, "B4762-I" :D

Link to comment
Share on other sites

"Is there any reason why scripting wouldn't be preferrable over this method?"

Is there any reason it would be preferable? I'm not sure whether you mean scripted editing of the collada file or scripted addition of a vertex. Either way, I would expect most would find it easier to do it this simply in the tool they are using already. Of course, if you spend a lot of time scripting, your preferences might get inverted.

ETA: Ah ... from Arton's post, I guess you may have meant scripting the rotation about a different axis. I wouldn't have described that as offsetting the pivot. As he says, that would save the LI penalty, but then you burden the server instead. Anyway, as I hate rotation maths ...

Link to comment
Share on other sites

  • 5 years later...
On 12/6/2016 at 3:03 AM, Drongle McMahon said:

I have to imagine your recollections are inaccurate. As far as I remember, the inworld pivot/origin has always been the center of the xyz-aligned bounding box. During the beta, there was an experimental pivot offset mechanism, but it was discarded. However, if you are using Blender, there is are two simple ways to move the pivot. However, both of these are ways of extending the bounding box beyond the extent of the visible and physics meshes. That inevitably increases the LOD switch distance, and therefore the download weight.

First is the invisible tab method, described in an old thread. The trick here is how to make sure the added tab doesn't get included in the physics. This is undocumented and is therefore not guaranteed to be everlasting. It's unlikely any changes would affect existing assets though.

The second depends on an even more ubscure "feature", that I did actually report as a bug. So it may be even less likely to remain effective. Again, any change is unlikely to affect existing content. It depends on the detail of how the bounding box is initialised in the uploader, as a zero-sized box at the position of the first encountered geometric point. Subsequently, the box is updated whenever any corner of any triangle lies outside it. If the first point in the collada file is outside the bounding box of all triangles, then the final box will still include that outlying point. So all we need to do is to add a point in the appropriate place, and make it first in the list.

Here is how to do it in Blender, for a simple door. There are variations, of course, in how to place the extra vertex. The crucial step is the sorting of the elements so that the extra point, not part of a triangle, is first.



1. A simple door.

2. Snap the cursor to where you want the pivot/origin. Set editing to cursor mode.

3. Extrude the opposite extreme point and mirror it in X, Y and Z.

4. Snap the cursor to the extra point.

5. Select all and sort elements (Mesh->Sort Elements->Cursor Distance).

Here is the result inworld...



ETA: To get the physics right for this door, it is essential to use the high LOD, then to "Analyze", and to set the type to "Prim. Otherwise the whole bounding box will be solid with an invisible other half. If the door is more complex, then you could use a simple mesh like this as the physics mesh, remembering to Analyze and set to Prim.

ETA: Also, don't forget to add the extra poit to all LODs and to redo the sorting before you export after any changes!

If I have a set of mesh doors that pivot on the hinges, but in another house I want to set the "eazyscript 4.0" into it, it pivots in the centre.  Can I change the pivot point of a 1 prim mesh door in sl or open sim?  They are both similiar homes, different designs made of mesh, with 1 prim doors.  I did a house with all the doors working, kitchen fridge as well, windows , doors, but this other house Ive noticed they dont swing open right, to set the script to open position,  The pivot point is in the centre, not on the hinges...grrrr...any fix?

Link to comment
Share on other sites

1 hour ago, Anne Zapedzki said:

If I have a set of mesh doors that pivot on the hinges, but in another house I want to set the "eazyscript 4.0" into it, it pivots in the centre.  Can I change the pivot point of a 1 prim mesh door in sl or open sim?  They are both similiar homes, different designs made of mesh, with 1 prim doors.  I did a house with all the doors working, kitchen fridge as well, windows , doors, but this other house Ive noticed they dont swing open right, to set the script to open position,  The pivot point is in the centre, not on the hinges...grrrr...any fix?

If the door's center is not at the hinges, you would need to explicitly account for that in the script with some offset math, but you won't be able to use certain features like llTargetOmega (which is the smoothest way to animate a door).

That's also to say, no, you can't change the pivot point once the object is in SL. That needs to be prepared before uploading.

  • Like 1
Link to comment
Share on other sites

There's an accepted JIRA for this. It's for the more general form, letting child prims have their own children. That solves the pivot problem. A hinge is attached to the doorframe, and that defines the pivot line. The door is attached to the hinge, offset so the edge of the door meets the hinge. Simple, easy to understand, and compatible with how Blender and Maya do things.

  • Like 2
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 543 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...