Jump to content

Changing Pivot Point


Ashasekayi Ra
 Share

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

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

Recommended Posts

Ash. See my comment in the jira , I did the same as you say you did. It did work, but not the way ypou would expect. It looks like the coordinates of the AssetPivot point are used with the units of the mesh AFTER it is normalised and cetered into a 1x1x1 box.  It doesn't matter where your mesh is - if your AssetPivot is at 0,0,0 therewill be no offset from the default pivot. If you offset by <-0.5,0,0>  it wil be on the left (x) side of the bounding box, etc. This is independent of the position of size of your mesh. If ypou scale the AssetPivot differently from <1,1,1>, then the offset will be different by that scaling.

To me this is very bizarre and not very useful, because there is no obvious relationship between the place you put your AssetPivot and where it appears on the mesh. I have suggested in the jira that the useful way to do this is not to use a separate object (with non-standard use of Collada name), but to use the actual origin of the geometry in the Collada file. That is the pink object point in Blender and so is easy and intuitive to place.

The offset can be calculated easily by applying the translation and scale to <0,0,0> that are already applied to the vertices for the normalisation. I am looking at the source code now in the hope that I can understand it well enough to be more explicit because I think it is important this is got right.

*I put an example dae file there, a simple door hinged at the edge. Here are Blender and in-world pictures...adoor.png

Link to comment
Share on other sites

What I did.

I added the AssetPivot node manually by editing the dae file in Notepad++.

Here's what I added. (Taken from prepDuckPivotShifted.dae)

<node id="AssetPivot" name="AssetPivot">
<translate sid="translate">-0.50000 0.50000 0.00000</translate>
<rotate sid="rotateZ">0 0 1 0.00000</rotate>
<rotate sid="rotateY">0 1 0 -0.00000</rotate>
<rotate sid="rotateX">1 0 0 0.00000</rotate>
<scale sid="scale">1.00000 1.00000 1.00000</scale>
</node>

between the lines:

<visual_scene id="Scene" name="Scene">

</visual_scene>

Worked for me. But I have to agree with Drongle. The implementation is not what I had expected. More complex shapes needs some test uploads to get it right.  But I'm happy custom pivots are possible now.

Link to comment
Share on other sites

Whatever method is chosen should be made easy to set up in all the various programs people are using. I expect the main use for offset pivots is in aligning objects in a more complex build.

What has been used in another virtual world is that the object pivot is set to the origin (0,0,0), and then the mesh geometry is positioned as needed relative to it.  So if you want the pivot at a corner, just place the corner of the mesh at 0,0,0.  If you want the pivot centered, place the mesh centered on 0,0,0.  It doesn't have to work that way, as long as whatever method we end up with is easy to explain and use in practice.

 

Link to comment
Share on other sites

I found another problem that is a bit disappointing, and won't be solved by my suggested alternative ... the edit handles are, of course, not offset. This is prfect for rotation because it shows you the right pivot. I guess move isn't too bad, but stretch is just wierd. What's more, the stretch handles have unexpected effects. Makes me wonder about encroachment too. Could this be a new griefing tool?

Perhaps the offset should be restricted to remain within the boundig box? That would solve a bug just found with large offsets. Any views on this? I think I might do a jira for it. Are there any good reasons to have the pivot outside the bonding box?

Link to comment
Share on other sites

  • 1 month later...

Using "AssetPivot" doesn't work anymore? I haven't played with pivots anymore since "AssetPivot" isn't a good or predictable solution for Blender users. So, I haven't noticed any changes with it. You might want to see if there is a jira open about that bug though. I think "AssetPivot" is still supposed to be operational. As for keeping the object's native pivot point on upload, Prep Linden said they still plan on adding it as an option. 

Link to comment
Share on other sites

I could be wrong here, but If I remember correctly, in 3ds max, if you just attach another primitive to the model, and then unattach it, the new pivot point is now where the unattach primitive was. No labeling or actually adding any verts. Generally, I usually have to do this for other reasons, I just noticed that it also changed the pivot. I have no idea how this is in Blender, and If I'm wrong about 3ds max, please do correct me.

Link to comment
Share on other sites

In Blender you can see the pivot point as a pink dot. You can move the mesh relative to it in edit mode. It is the origin of the local vertex positions. In the exported Collada file it is not explicitly defined, as it is implicit as the point 0,0,0 in the same frame of reference as the vertex coordinates. However, the uploader ignores this and applies a translation (and scaling, but that is a different story) to the vertices so that the geometric origin is the center of the x,y,z bounding box. I presume the same would be true for the Collada file expoted from any other software. They did introduce a method of specifying an offset origin so that, for example, a door would naturally rotate around its edge. However, that was removed recently, possibly because of complications for the physics engine and the forthcoming encroachment detection system.

Link to comment
Share on other sites

Yes, that's basically the way Prep designed it: add a node or empty, name it "AssetPivot" and there's your new pivot point. I *believe* the method worked for Max/Maya. It didn't work well for Blender however. But according to Drongle, the pivot code and/or physics code related to it is borked in general now.

 

Link to comment
Share on other sites

Pivot points can also get hairy with physics boxes. I made a basic box for the physics of a mesh, and because they did not have the same pivot point, or even position, it was way off. So, again, in 3ds max, I'd have to create a primitive as a pivot point and attach the mesh, physics box and probably all the LODs to it, then detach them all by selecting each as an element.

Link to comment
Share on other sites


Drongle McMahon wrote:

I found another problem that is a bit disappointing, and won't be solved by my suggested alternative ... the edit handles are, of course, not offset. This is prfect for rotation because it shows you the right pivot. I guess move isn't too bad, but stretch is just wierd. What's more, the stretch handles have unexpected effects. Makes me wonder about encroachment too. Could this be a new griefing tool?

Perhaps the offset should be restricted to remain within the boundig box? That would solve a
with large offsets. Any views on this? I think I might do a jira for it. Are there any good reasons to have the pivot outside the bonding box?

I've totally seen this. I'm a noob really tho, and figured I was just doing something wrong. To me, it seemed to be related to scaling the whole mesh but not by scaling the verts, even tho that is the end result. I have no idea tho, as I've not messed with it all enough to understand it completely.

Link to comment
Share on other sites

  • 3 weeks later...

Looks like custom pivots are working again.

Today I uploaded a .dae (Latest Mesh Project Viewer on Mesh SB 21) that contained the "old" AssetPivot node. The pivot was set correctly inworld. Though, the collision mesh is still offset from the visual mesh.

Link to comment
Share on other sites

 


Ashasekayi Ra wrote:

Hmm... I just tried with build 232686 (and the previous build) on Mesh Sandbox 21 and can't see any pivot changes.

The mesh with the working pivot was uploaded using the .slm import file. Probably it's a bug that this file sets the custom pivot.

Link to comment
Share on other sites

Go to Advanced Menu > Debug Settings > MeshImportUseSLM and set it to TRUE. Upload your mesh. Next time you upload that same mesh, the LODs and normally the physics mesh will be loaded automatically with the settings you used at the first upload.

Currently decomposed physics meshes won't load. While undecomposed phys meshes does. That's a bug. At least it was the case the last time I uploaded a mesh, which was yesterday.

  • Like 1
Link to comment
Share on other sites

  • 5 weeks later...
You are about to reply to a thread that has been inactive for 4663 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...