Jump to content
Sign in to follow this  
Ashasekayi Ra

Changing Pivot Point

Recommended Posts

Has anyone had success uploading a mesh model with a changed pivot point? I haven't had success with Blender yet.

 

What I did:

1. Made a simple model.

2. Added an empty and named in "AssetPivot".

3.  Placed the empty where I wanted the pivot to be located.

4. Exported both.

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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.

Share this post


Link to post
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.

 

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

Update: In the mesh meeting today, Prep Linden stated that there will be an option added to just use the object's defined pivot point. This will make life much easier. ^^

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites

I think this may have been removed be because the offset was not recognised in the server, so that the physics was in the wrong place, CTS-500. Things uploaded before it was removed are still offset, but their physics is not. I reported the removal as a bug to seek clarification, CTS-567.

  • Like 1

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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.

 

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Oh good (unless it's a regression). I do hope Prep gets time to do the use-the-geometry-origin option too. Need to ask at meeting. My work-around with invisible flaps and solid decomposition is still working too.

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

It seems to be broken again - I have yet to sucessfully change the pivot points of any of my objects, be it by creating extra geometry within my file or by altering the .dae with notepad.

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.

Sign in to follow this  

×
×
  • Create New...