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

display live protractor angle parameter value as text in 3dsmax 2019 without any animated keys

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
tejam_prashant
719 Views, 9 Replies

display live protractor angle parameter value as text in 3dsmax 2019 without any animated keys

Hi , I am trying to display protractor angle parameter value as text . by using Set Value as Text option in Text plus. But when i click on set value as text  option in Text plus. and then in the window that opens i click on Pick value from scene button. and then selected protractor helper object in the scene i get only one option Transform and then position and rotation but no option to display angle parameter value .

 

basically i dont want to animate,  just display the angle value of a line object when i move its middle vertex .

 

i am following a tutorial in autodesk 3dsmax learning channel https://www.youtube.com/watch?v=W_DsXHpuUYw&t=1s

9 REPLIES 9
Message 2 of 10
MartinBeh
in reply to: tejam_prashant

Hi!

 

Protractor seems to be a really odd piece of code in 3ds Max, it has no properties one can use in MAXScript. Neither does it have any parameters available in Trackview. So you cannot "get" the Protactor angle, and you also cannot query the two target nodes it references. 

 

So I would suggest to use a bit of math in TextPlus to re-calculate the angle between the Protractor location and the two objects instead. 

 

For this, I would use the dot product:

-- location of three objects: Protractor, ObjectA and ObjectB
Ppos = $Protractor001.pos
Apos = $ObjectA.pos
Bpos = $ObjectB.pos

-- unit-length vectors from H to A and B
vecHA = normalize (Apos - Ppos) 
vecHB = normalize (Bpos - Ppos) 

-- angle in degrees 
angDeg = acos (dot vecHA vecHB)

Hope this helps

Martin B   EESignature
→ please 'Like' posts that are helpful; if a post answers your question please click the "Accept Solution" button.
Message 3 of 10
MartinBeh
in reply to: tejam_prashant

3ds max 2019 is too old for me, so here is a screenshot of the "Set value as text" dialog of TextPlus:

angle.png

Shown is the assignment of the "Ppos" variable to position track of the protractor - you will have to set the assignment for Apos and Bpos accordingly.

Martin B   EESignature
→ please 'Like' posts that are helpful; if a post answers your question please click the "Accept Solution" button.
Message 4 of 10

i kept tweaking the whole night . never knew it would be so difficult. but thanks for answering . i will surely try now.

Message 5 of 10
MartinBeh
in reply to: tejam_prashant

Please "accept solution" if this works for you, thanks!

Martin B   EESignature
→ please 'Like' posts that are helpful; if a post answers your question please click the "Accept Solution" button.
Message 6 of 10
tejam_prashant
in reply to: MartinBeh

thanks for the script it worked for me really well. But now i have a problem . the measure of angle does not exceed 180 degrees. i want the angle to read from 0 degree to 360 degrees.

Message 7 of 10
MartinBeh
in reply to: tejam_prashant

The angle always being between 0...180 is exactly what protractor does.

Martin B   EESignature
→ please 'Like' posts that are helpful; if a post answers your question please click the "Accept Solution" button.
Message 8 of 10

oops by mistake. pls ignore

Message 9 of 10
tejam_prashant
in reply to: MartinBeh

-- location of three objects: Protractor, ObjectA and ObjectB
Ppos = $Protractor001.transform.pos
Apos = $ObjectA.transform.pos
Bpos = $ObjectB.transform.pos

-- unit-length vectors from H to A and B
vecHA = normalize (Apos - Ppos) 
vecHB = normalize (Bpos - Ppos) 
vecC = cross vecHA vecHB 
-- angle in degrees 
angDeg = acos (dot vecHA vecHB)

If (dot vecC [0,0,1]) >= 0 then angDeg 
else (360 - angDeg )

thanks for the reply sir. You are exactly right the protractor can measure only till 180 degrees. 

I was about to give up the whole project because i couldn't get it right. But you got it going for me..

tejam_prashant_0-1728315507036.png

 

.

your solution set things right for me and instilled confidence in me to go with the project.

A member from your forum helped me in setting things right. the above script is exactly what i was looking for.

Excellent service from autodesk. Kudos to all you amazing people out there.

Message 10 of 10
tejam_prashant
in reply to: MartinBeh

pls ignore

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

Post to forums  

Autodesk Design & Make Report