Community
Maya Animation and Rigging
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya animation topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do I get the DistanceBetween node calc distance between RotatePivotTranslate

13 REPLIES 13
Reply
Message 1 of 14
Peteman12
1249 Views, 13 Replies

How do I get the DistanceBetween node calc distance between RotatePivotTranslate

I am currently studying the Rigging For Games book by Eyal Assaf, but I am having trouble in chapter 5, regarding the stretchy IK part.

The problem is is that it tells me I need to do the following:

1. topJnt_LOC > RotatePivotTranslate to topJnt_DBN > Point1
2. topJnt_LOC > RotatePivotTranslate to atRest_DBN > Point1
3. topJnt_LOC > World Matrix [0] to atRest_DBN > InMatrix1
4. midJnt_LOC > RotatePivotTranslate to topJnt_DBN > Point2
5. midJnt_LOC RotatePivotTranslate to endJnt_DBN > Point1
6. endJnt_LOC > World Matrix [0] to atRest_DBN > InMatrix2
7. endJnt_LOC > RotatePivotTranslate to atRest_DBN > Point2
8. endJnt _LOC > RotatePivotTranslate to endJnt_DBN > Point2

_LOC's are location objects and _DBN's are DistanceBetween nodes. However, when I try to connect the RotatePivotTranslates to their respective Points, the value I get is 0.0 for endJNT_DBN and topJNT_DBN. The atRest_DBN seems to work, so I assume it has something to do with the Matrices. Meanwhile, the file that I downloaded from http://www.thetingirl.com/rigging-for-games/ has these same nodes and they give me the right values ~5 for topJnt_DBN and ~6.6 for endJnt_DBN. Even more crazy, if I create a new node in the provided file, I get 0.0 for the values, while if I import those nodes from the provided file into my working file, the nodes give me the proper values. I am at a complete loss as to why one works and the other doesn't.

 

13 REPLIES 13
Message 2 of 14
sean.heasley
in reply to: Peteman12

Hi @Peteman12 and welcome!

 

I downloaded the chapter 5 files but I'm not really sure what file you're working with.

 

Also though, are your unit measurements the same as the one in the book you're following? Often if the units are different they can throw off things likes this.

 

Let me know if anything changes!

Message 3 of 14
Peteman12
in reply to: sean.heasley

Sorry, @sean.heasley

 

I was working on 01_Meep_leg_setup, and 02_Meep_wing_setup has the working distanceBetween nodes that I imported (I assume the rest do, but that's irrelevant at the moment). My problem is that whenever I create a new distanceBetween node, I get this problem, but when I use the preexisting distanceBetween nodes in 02_Meep_wing_setup, things work out fine.

 

I don't think the unit measurements would matter in this case. I get 0.0 for the values for the newly created distanceBetween nodes while the imported ones give me the proper values. Meanwhile the units are the same.

Message 4 of 14
sean.heasley
in reply to: Peteman12

Hi @Peteman12 sorry for the delayed response!

 

Can you reproduce it with a simple scene (just joints, or locators or transforms)?

Message 5 of 14
Peteman12
in reply to: sean.heasley

@sean.heasley

Here is the file, with only the original good utility nodes (_Good), and newly generated utility nodes (_New).

Message 6 of 14
sean.heasley
in reply to: Peteman12

Thanks for the file @Peteman12

 

While I'm looking at it, a coworker asked if you're using Maya in parallel mode? That can often cause some wonky issues with the Distance Node.

 

It might be better to set DG mode for evaluation to make sure the nodes are evaluated correctly. Worth giving it a shot 🙂

Message 7 of 14
Peteman12
in reply to: sean.heasley

@sean.heasley:

 

Settings->Animation->Evaluation Evaluation Mode: DG.

 

I just tried that, it didn't work. Any other ideas?

Message 8 of 14
sean.heasley
in reply to: Peteman12

Hmmm I'm not 100% sure.

 

Some co workers say it may be an issue on your end. Since I don't have access to the tutorial can you possibly start from scratch and see if there's a step you missed or potentially post it here so I can follow along with you.

Message 9 of 14
Peteman12
in reply to: sean.heasley

I'm not sure what step I could have missed. The only difference between the nodes is that one set is from a pre-existing scene where the nodes worked and the other are freshly generated. Why would the newly generated ones have this issue?

Message 10 of 14
mspeer
in reply to: Peteman12

Hi!

 

For me it looks that the old nodes (without Matrix Connection) outputs wrong (some sort of baked in values) and the new ones are correct.

If the 1. Rotate Pivot Translate has a value of 0 0 0 and the 2. also has 0 0 0, then the distance between them is 0.

This can change if you additional connect Matrix values.

 

Keep in mind that there are many changes since Maya 2014 (feature changes and bugfixes).

Message 11 of 14
Peteman12
in reply to: mspeer

Huh... That is strange. I am confused.

 

I won't say this fixes my problem, but it does make it make more sense.

 

This is frustrating.

 

Thanks for pointing this out.

Message 12 of 14
sean.heasley
in reply to: Peteman12

Hi @Peteman12

 

A co-worker read your issue and said this

 

"The behavior of connections is correct in value.

 

All of *Jnt_LOC.rotatePivotTranslate are surely set as 0 0 0. Thus distanceBetween.point1 and point2 will be 0 0 0. This is correct.

The point is what the rig needs to achieve. I couldn’t know it because I couldn’t access the tutorial book, but it’s better to change the connection source something topJnt_LOC.translate or something else.

 

.rotatePivotTranslate is the value of translation for the pivot point. This is 0 0 0 by default. I recommend the user set the new value and check the distanceBetween node.

 

It’s easy to set, just run following line in the script editor.

 

setAttr topJnt_LOC.rotatePivotTranslateX 1;

 

Then check atRest_DBN.point1. It should be 1.0. If it’s 1.0, the nodes are working properly but .rotatePivotTranslate should be replaced to another attribute where it works when animating the rig. .rotatePivotTranslate is not updated in animation usually. I guess .translate is just fine but there would be more suitable attribute. It depends on what the user wants to do."

 

Let me know if this helps!

Message 13 of 14
Peteman12
in reply to: sean.heasley

The purpose of this is to create a base length for a stretch IK. And when I tried to use the Translate value as an experiment, the length would change if I went to close in, meaning that the leg would shrink.

Message 14 of 14
Peteman12
in reply to: Peteman12

Okay, it turns out that even the book acknowledges the solution they provided doesn't work anymore. A later chapter seemed to have this work out without the need for the middle LOC and using world Matrices.

 

Thanks for your help anyways. I very much appreciate it.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report