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

Automatic Ball Rotation Crash

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
Anonymous
1014 Views, 8 Replies

Automatic Ball Rotation Crash

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 🙂

8 REPLIES 8
Message 2 of 9
leeminardi
in reply to: Anonymous

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
Message 3 of 9
Anonymous
in reply to: leeminardi

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.

Message 4 of 9
leeminardi
in reply to: Anonymous

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
Message 5 of 9
Anonymous
in reply to: leeminardi

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?

Message 6 of 9
leeminardi
in reply to: Anonymous

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
Message 7 of 9
Anonymous
in reply to: leeminardi

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

Message 8 of 9
Anonymous
in reply to: Anonymous

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

Message 9 of 9
leeminardi
in reply to: Anonymous

Great! Would you post your code?

lee.minardi

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

Post to forums  

Autodesk Design & Make Report