script controller

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 10 October 2003   #1
script controller

I was hoping someone here could help me with a problem I have.

I would like to pick up the angle of a protractor and use that to move an object along a path.
I attach the protractor to my bone system pivot point and select the 2 bones to create the angle but I can't seem to extract that angle information. As I move my Ik bones around the angle changes as expected but I can't wire this or seem to use it.

So I figured that I might be able to use controller scripts to convert the angle from the protractor (approx range 10-180 degrees) and link that into a percentage along path.

My scripting is almost non existent - ie I can read scripts (generally) but struggle to write them...... come to think of it, its a bit like my french.
Any help would be greatly appreciated.

regards

El-d
 
Old 10 October 2003   #2
Hi El-d, as far as i know, it is not possible to get or set any information from a protractor. i ran into the same problem some days ago and didn't found a solution. it isn't accessable in maxscript, and wireing doesnt work either. maybe you should look for an alternative for the protractor, i finally came up with a z-downscaled sphere, where the sliceFrom/To parameters represent the angle (i wanted to create a visual feedback for ik limits, and the spheres look way cooler than the ugly protractor )
__________________
Don't panic!

Piranha-Bytes
Risen 2
3dsmax scripts


 
Old 10 October 2003   #3
Thanks for the response, and unfortuneately I thought as much with regards the protractor.

Its good to hear you found a solution using the slice from /to parameters.
I assume that you link the sphere to the upper arm bone (elbow joint) with the slice from aligned with the bone. What I am not sure about is how do you go about linking the slice to angle to the forearm bone so that as the arm bends the slice to angle follows it?
Could you please explain how to do thius as its been driving me crazy

Many thanks in advance

El-d
 
Old 10 October 2003   #4
hi, sorry for the long delay, i have been pretty busy..
yes, you link the sphere to the first bone and then wire the sliceTo parameter to the proper rotationaxis of the second bone, you might have to apply some offset to the wiring, if the bone has already rotation.
i can sent you an example scene later, i don't have access to my webspace right now.. hope this helps!
__________________
Don't panic!

Piranha-Bytes
Risen 2
3dsmax scripts


 
Old 10 October 2003   #5
This is what I assumed and tried after your first explanation. The trouble is that it doesn't work as soon as IK Hi Solver is applied to the bones.

If you have managed to do it with the Ik solver then the test file would be gratefully received.

Thanks again

El-d
 
Old 10 October 2003   #6
Since IK doesn't use the bones' rotation controllers, you have to extract the angle the hard way. Here's an example of how to extract the angle between two bones:

q_rot = ($bone02.transform * (inverse $bone01.transform)).rotation

This will return a quat result, so you will want to convert it to euler in order to make sensible use of it:

e_rot = q_rot as eulerangles

If you're using IK, you can then just use e_rot.z to get the angle.


RH
__________________
Got Maxscript?
RHTools
 
Old 10 October 2003   #7
Talking Many Thanks

I finally got the time to try your script and it works perfectly. A great multitude of thanks for that as it was really starting to irritate me.

El-d
 
Old 01 January 2006   #8
Thread automatically closed

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.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 11:20 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.