Model Animation From External Data (.Net)

Hello,

I'm pretty new to 3ds/Maxscript and am trying to create an animation script that moves models around (x,y,z position plus pitch, roll, yaw) using MaxScript talking to an external data service using .Net integration. I've got a script working that communicates with my .Net service and have successfully been able to generate pre-defined animations based on this data.

I would now like to make this work in a more "real time" fashion. Meaning the script would poll my .Net service and move the models around as data is changed on the backend.

I'm looking for some guidance on a basic approach. Should I:

1. Try to implement animation keyframes in some kind of loop? For example, should I constantly update position in keyframes 0 to 100 and try to get the animation to loop back to frame 0 and let it run continuously?

2. Create an infinite number of keyframes and try to get the script to continue running indefinitely?

3. Do something else?

Thanks in advance.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Anubis's picture

an advise

do not mix-in real-time & animating task in one process, instead just keep your time slider at time 0 and update your props (pos, rot, ...) w/o keyframing.

my recent MAXScripts RSS (archive here)

slgoode's picture

Real-time versus animation

Thanks for your response. I think I understand what you're saying. If I keep the slider at time=0, will I still get the position interpolation that I get when I create pre-defined animations?

I want to poll my back-end application for the current position (including pitch, roll, yaw) but I was hoping that moving from the previous position to the current position would create a smooth, interpolated path like it does in pre-defined animation.

I hope this makes sense.

TsveTan's picture

""

Sorry, I don't understand exactly what you want to realize when talking for looping.If you want to create a continuous animation you can repeat(loop) the sequence specific number of times or put a stopbutton in the program interface or play it at once (this is by your choice). Everytime you change something in the (loop) sequence , you should update the specific key (it doesn't matter what you are changing: position, rotation, materials, modifiers, controllers ... on the model). It is also good choice if you can write specific animation sequences in a external file and play them when specific event occurs like a button is pressed, a timer or a counter in your script reaches specified value or a condition (marked with a flag boolean in the script) is changed.
On the time slider you see in a frame only one key , but there can be more, which cover the basic one. You should update only the changed keys in your script.

slgoode's picture

Looping

Thank you for your response.

Sorry, I think my terminology is bad as I am just getting started with this. Another person responded that I should keep slider time=0 and not increment key frames. I think I understand what this means, but the reason I'm mixing up the animation aspect of this is that I would still like to get the positional interpolation that you get in pre-defined animation.

So I want to poll my back-end application for the current position (including pitch, roll, yaw) but I was hoping that moving from the previous position to the current position would create a smooth, interpolated path like it does in pre-defined animation.

I hope this makes sense.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.