View Full Version : finding an orientation after frozen transforms
DanHaffner 10-17-2009, 12:07 AM I have a mechanical model I am rigging, and the model was extremely nit picky when he modeled it and named every single piece, took him about 19 hrs, lol, but he also froze transforms on every piece. So now I have no way of rotation an object on it's local axis, as it not has no local orientation. There has got to be a work around to find it's orientation, for example, I am rotating a cylinder that is used a hinge, and it now wobbles due to not rotating on it's single axis.
I found a semi way around it, but it's really tedious and not exact, it still wobbles slightly, and it annoys me. Surely there is a way to get around this, right?
I should also add, he has deleted history on every item as well......
|
|
will quatToEuler (theObj.transform * inverse theParent.transform) work ?
DanHaffner
10-17-2009, 01:40 AM
That MEL?
Also, nothing is parented, EVERYTHING is out in world space.
Leffler
10-17-2009, 03:13 AM
If you parent-constrain something to it, without maintain offset, you should se the rotate-values on that items being the Lra .... i think
DanHaffner
10-17-2009, 03:28 AM
Nah, that will only show the values to snap it to it's spot. And Orient without offset shows no values as well.
theflash
10-17-2009, 04:40 AM
Freezing the transform will reset the orientation without storing the reference point of original orientation. There is no direct way to get it back. However I found one way that can be used to find the original orientation. If you have a geometry whose face aligns with any of the orthogonal planes or if you know a face aligns with any arbitrary plane then you can use normals to find the orientation.
DanHaffner
10-17-2009, 04:48 AM
And if nothing aligns with an orthographic view?
theflash
10-17-2009, 04:55 AM
Then you have to define something that aligns with it either manually or by looking at combination of vertices. And you can really go complicated to automate this. Can you post what kind of geometry is it?
DanHaffner
10-17-2009, 05:02 AM
I will have to get permission first.
Coyote12
10-17-2009, 08:42 PM
I don't understand why you need the rotation axis for the model pieces? Why not just use the joints that bind the pieces and rorate it from their axis. I think you are assuming that rotation axis was correct in the model at all times. How do you know this? All objects rotation point comes from the pivot which can be moved or centered on the object and by default they all are oriented to world space. The moment the modeler adds geometry the pivot is no longer truley in the center. It is where the center use to be.
I just dont see why you dont just move the pivot point on every object that needs it to where you think it needs to be. Then just rotatate it's LRA to the direction you need it to face. Problem solved.
DanHaffner
10-18-2009, 06:34 AM
Let's say you have a cylinder. This cylinder is to act as a hinge for other items. If the cylinder is rotated in several angles, and then transforms are frozen, when you go to rotated that cylinder to act as a hinge, it is going to wobble all over the place. Yes, I could use joints, however, unless the joint is oriented perfectly, when it rotates and therefor rotating the cylinder, there will be wobbling. That is why I am looking for the orientation of the cylinder, so I can rotate it on a single axis and it won't wobble in place. Make sense?
theflash
10-18-2009, 05:35 PM
I think what you really need in that case is to find the right pivot point and use joints to rotate in a particular orientation. You can write a script to find the pivot mathematically based on scenarios like, use center of two faces to make a line and use the middle point of that line. Then you can put a joint there and use aim constraint to find the twist axis. And either use orient constraint or just bind the skin.
Coyote12
10-18-2009, 06:29 PM
Dan I understand why you need the right pivot location for your model pieces I just don't see why you are not just moving the pivot to where it needs to be. Several people here are giving good advice to finding the centerpoint between poly faces and verts. Follow that advice. You can not assume that the pivot point when a model is started will be the correct place for it to be when completed. And if it is moved then move it to where it needs to be. If something wobbles because it is not in the right place then level it first, then find the center.
Piflik
10-18-2009, 07:58 PM
It's not about the position, but the orientation.
Doesn't Maya have a feature similar to Max' AutoGrid or Normal Align? You can align a second object to a flat surface of your model (if you have some...) and align the pivots. At least that's what I'd do in Max.
Or attach the Model to a newly created one that has the right orientation/position...
DanHaffner
10-18-2009, 08:42 PM
Yes, they have good advice for finding where to position the pivot, but that isn't the problem. Center Pivot works just fine to put the pivot in the center, but that doesn't help when it's not oriented properly. The closest method I have gotten to making it work is using aim constraints and flat out making a new piece and positioning it to the old piece as close as possible. The problem is this mesh has thousands of pieces that I am going to have to rely on orientation of the piece and doing this for every piece isn't gonna make rigging this enjoyable at all.
theflash
10-18-2009, 10:18 PM
Yes if the model has many such pieces it's not going to be fun doing this manually. You should write a MEL so when you select a face(s) and run script it will place a joint and align it with the face normal so it's aiming in the twist axis. If I were you I will use joints instead of manipulating geometry. Good luck.
CGTalk Moderation
10-18-2009, 10:18 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.