Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

Automatic Ball Rotation Crash

Anonymous

Automatic Ball Rotation Crash

Anonymous
Not applicable

Hello,
I have a problem with an automatic ball rig. I followed the instructions laid out here: Ball Tutorial
But whenever I surpass frame 365 3ds Max just crashes without any notification what so ever. Up to that I can animate and everything works fine. I think it has to do with the code but I can't really pinpoint it to where exactly the problem is. 
I use the 2017 version of Max and so far I've installed all the service packs. The file is attached.

Thank you in advance 🙂

0 Likes
Reply
Accepted solutions (1)
1,074 Views
8 Replies
Replies (8)

leeminardi
Mentor
Mentor

How far did you get in the tutorial?  Did you make sure the rotation controller is a TCB controller?  I am not sure if Windup needs to be checked to ensure rotations > 360°.

The file was not attached.

lee.minardi
0 Likes

Anonymous
Not applicable

oh I'm sorry I thought I had attached it. I uploaded the file to my Google Drive HERE the attachements here don't seem to work for me.
For the rotation controller I assigned a script controller as it is mentioned in the tutorial. I changed the code slightly so it matches the node name and the radius because I don't intend to animate that.

0 Likes

leeminardi
Mentor
Mentor

The file crashed repeatedly for me at frame 340.  Although your code has a few minor differences with  the tutorial code I saw nothing that should cause a problem. You have a variable named ballRad with a constant value of 0.0 and a code variable with the same name and a value of 94.567.  I deleted the Named variable but nothing changed in the performance of the rig.  The file still crashed at frame 340.   Deleting the script eliminates the problem so the problem must be related to the script.    I cannot determine what is so magical about frame 340.  

 

 

lee.minardi

Anonymous
Not applicable

It's interesting that it varies from system to system. My assumption is that the problem lies within the recursive function: when it calls the rotation from the last frame it executes the same function again and again until it reaches frame 0, so I don't know if there's a limit to that.
So if there is not a solution to that, my workaround would be to write a script that computes the rotation similiar to what it does now but baking it down to keyframes. Would that be a smart decision?

0 Likes

leeminardi
Mentor
Mentor

It looks like it is a recursion problem.  CHeck out this thread:

http://forums.cgsociety.org/archive/index.php?t-1248627.html

 

I do not understand what recursion does in this example. I know that the program needs to determine not only the current position of the ball but also the position in the previous frame in order to determine the direction of rotation of the ball. Sorry I cannot help you.

lee.minardi
0 Likes

Anonymous
Not applicable

Looks like there's a limitation to recursive functions. Nevertheless thank you for your time

0 Likes

Anonymous
Not applicable
Accepted solution

Alright so to do this stuff recursively in the script controller always leads to crashing, but I managed to write an ordinary maxscript that computes the rotation based on the tutorial code. It isn't as convinient but at least it doesn't crash Smiley Happy

0 Likes

leeminardi
Mentor
Mentor

Great! Would you post your code?

lee.minardi
0 Likes