September 11, 2002
at 12:00 pm /
#13930
If it is just wheels/rods we’re interested in here, my Engineer plugin already has the code to animate them, it would be a matter of extracting the code. (and adding a few more parameters)
A few more tips…
You don’t need to define all 9 key frames in your set – 5 at 90 degrees in frames 0,2,4,6 andamp; 8 will do the trick as well
Quartering – make the wheels on one side a sub-group of the wheel on the other and rotate it by 90 degrees – automatically quartered.
Make connecting rods sub groups of the rear wheel group, pivoting around the connection to that wheel – then animate with the reverse angle to the wheel so it remains horizontal.
This is how my Engineer plugin builds the wheels – try a simple test build with animation and have a look at the wheel and rod group animations.
12 quartered drivers and 2 rods would make 6*5+2*5 = 40 positions to change
A copy and paste rotations script would be useful, but suffers from the same Quaternion/polar coord conversion problem <!– s:( –><img src="{SMILIES_PATH}/icon_e_sad.gif" alt="" title="Sad" /><!– s:( –>
Paul
Whilst I’m here I might as well post the script code to re-set the positions for all animations…
Beware, it currently removes rotations, but all the positions will be correct
Just copy and paste this code into the edit script window (Pro version) and save it – beware of long lines that wrap round, I think there’s only one – andquot;Reply = andquot;
[pre class=’ip-ubbcode-code-pre’]
Language = VBScript
‘*********************************************************************************
‘ Purpose: Set all animation positions to the current selected object position
‘*********************************************************************************
Option Explicit ‘require variable declarations
Sub Main (3DCApp)
Dim Scene,Object,Group,GP,Tim
Dim ActiveObjectCount
Dim X,Y,Z,I
Dim PX,PY,PZ
Dim Reply
‘get the scene
Set Scene = 3DCApp.GetActiveScene
‘get the active object count
ActiveObjectCount = Scene.GetActiveObjectCount
‘only proceed if there is an active object
If ActiveObjectCount = 0 Then
MsgBox andquot;Please select an object.andquot;
Else
Set Object = Scene.GetActiveObject(0)
Set Group=Object.GetParentGroup()
Set GP=Group.GetParent()
Reply=msgbox(andquot;Set all key frame positions for Group andquot; andamp; Group.GetName() andamp; andquot; to the current position? (no undo available)andquot;,vbYesNo)
if Reply=vbYes then
Group.GetPosition GP,X,Y,Z
For I=0 to Group.GetPositionKeyFrameCount()-1
Group.GetPositionKeyFrame I,Tim,PX,PY,PZ
Group.SetPosition GP,Tim,X,Y,Z
Next
End If
End If
End Sub
[/pre]