December 22, 2024, 04:57:40

Author Topic: Object animations in Layout  (Read 14230 times)

Offline jstubbles

  • Petty Officer
  • **
  • Posts: 169
  • Karma: 2
    • View Profile
    • http://www.ivassago.com
Object animations in Layout
« on: February 01, 2011, 06:16:14 »
Hey guys, had a quick question about animations in Layout. I got everything animated and it compiles and plays in the game. The problem I'm having though is that the animation looks like it's on a spline ramp instead of being linear. So when it starts, it starts slow then winds up faster and faster. This is not the behavior I want. It should have a constant speed.

I've gone into Layout's graph editor and set the animation keys to repeat in the pre/post behavior and also set the keys from TCBSpline to Linear. But this doesn't seem to help it at all in game.

Any ideas?

Offline Arparso

  • Administrator
  • Lieutenant
  • *****
  • Posts: 558
  • Karma: 14
  • I can see you...
    • View Profile
    • http://arparso.de/nexus
Re: Object animations in Layout
« Reply #1 on: February 01, 2011, 11:06:28 »
Well, the only animation I've worked on was a rotating radar dish (on the GTC Fenris and Leviathan models for the Freespace mod), so I'm not exactly an expert. :P

The way it worked for me was by using two keys for rotation: one had a value of 0°, the other one had 360° with both of them being 300 frames apart. Pre and post behaviour have been set to constant and both keys have their incoming curve set to TCB Spline (with tension, continuity and bias set to 0). This gives me a constant rotation, similar to the Stiletto's rotating mid-section.
« Last Edit: February 01, 2011, 11:11:12 by Arparso »

Offline DreamorCZ

  • Petty Officer
  • **
  • Posts: 110
  • Karma: 1
    • View Profile
    • Czech Gaming Nexus
Re: Object animations in Layout
« Reply #2 on: February 01, 2011, 11:21:11 »
Animation starts always slow and stops accelerating when it reaches specifications in Layout from what I know. If I'm right, you need this for Ragnar station, so I would recommend 1000 frames for one 360° rotation.
Editor in Chief at http://www.cgnexus.eu/

Offline jstubbles

  • Petty Officer
  • **
  • Posts: 169
  • Karma: 2
    • View Profile
    • http://www.ivassago.com
Re: Object animations in Layout
« Reply #3 on: February 01, 2011, 15:59:29 »
Nah, the animation plays fine in Lightwave. There's no slow down or speeding up. It's one constant smooth motion. But when I load the model in the game, it automatically starts the animation and when it does, it starts slow then ramps up to full speed and then plays forever. I do not want that ramp-up. It doesn't exist in the animation and it shouldn't be there in the game.

If I load the model in the model viewer there's no animation. If I press "1" to enable the first animation, it starts at fullspeed like I want - no ramp up time.

I don't know why it's giving the animation that ramp-up when loading it in the game or editor.

Offline Arparso

  • Administrator
  • Lieutenant
  • *****
  • Posts: 558
  • Karma: 14
  • I can see you...
    • View Profile
    • http://arparso.de/nexus
Re: Object animations in Layout
« Reply #4 on: February 01, 2011, 19:41:52 »
If it's a default animation (#anim def#), then I suppose this is "normal". Looking at the AnimateShip() command, which starts or stops the default animation, it explicitly mentions a gradual animation startup over the course of 10 seconds.

I don't know a way to avoid that. You might have to work around it, like making a short "intro" to your mission(s), carefully hiding the animation startup from the camera.

Offline jstubbles

  • Petty Officer
  • **
  • Posts: 169
  • Karma: 2
    • View Profile
    • http://www.ivassago.com
Re: Object animations in Layout
« Reply #5 on: February 02, 2011, 02:35:44 »
Damn, just one more limitation! hah. Thanks for looking that up, Arparso. :)

Offline Arparso

  • Administrator
  • Lieutenant
  • *****
  • Posts: 558
  • Karma: 14
  • I can see you...
    • View Profile
    • http://arparso.de/nexus
Re: Object animations in Layout
« Reply #6 on: February 02, 2011, 03:04:22 »
I suppose you could also use something like SetMotionFactor(factor) to fast-forward in time. Set factor to 10 and your 10 seconds animation startup phase would be over in just a single real-time second. Combined with a one-second-fade-in effect it could be a viable option to hide this startup phase.

The mission script would need some adjustments, though, because any timed event you have already scripted would also be accelerated by SetMotionFactor(factor). Delaying everything or preferably just the one event kicking off the whole mission script by 10s should do the trick. Might also be wise to prevent your ships from moving or shooting during that startup time.

Offline jstubbles

  • Petty Officer
  • **
  • Posts: 169
  • Karma: 2
    • View Profile
    • http://www.ivassago.com
Re: Object animations in Layout
« Reply #7 on: February 02, 2011, 04:00:20 »
Hmm. Do the #def# animations automatically play no matter what? I wonder if it would be possible to initialize it's animation right when the mission loads. Maybe it would start up instantly? I don't see why it works (as I think it should) in the model viewer, but not the game itself. Rather frustrating (chalk up another one! :P).

Offline jstubbles

  • Petty Officer
  • **
  • Posts: 169
  • Karma: 2
    • View Profile
    • http://www.ivassago.com
Re: Object animations in Layout
« Reply #8 on: February 05, 2011, 08:11:11 »
Having one hell of a time right now. Not sure exactly what I did but now my models wont export correctly from the LWS file. They come out as like 2KB files instead of the 2-3MB they should be. :|

Offline Arparso

  • Administrator
  • Lieutenant
  • *****
  • Posts: 558
  • Karma: 14
  • I can see you...
    • View Profile
    • http://arparso.de/nexus
Re: Object animations in Layout
« Reply #9 on: February 05, 2011, 13:49:10 »
Huh, sounds like a nasty bug. Does no model work anymore or just the ones you were working on?

If you send one my way, I could have a look at it and see if it converts for me.

Offline DreamorCZ

  • Petty Officer
  • **
  • Posts: 110
  • Karma: 1
    • View Profile
    • Czech Gaming Nexus
Re: Object animations in Layout
« Reply #10 on: February 05, 2011, 17:39:50 »
This happened to me only once when I didn't parent LoD phases with main layer. Also, converter is doing problems when you have more then 30 layers.

However, it can be anything because that is Nexus.
Editor in Chief at http://www.cgnexus.eu/

Offline jstubbles

  • Petty Officer
  • **
  • Posts: 169
  • Karma: 2
    • View Profile
    • http://www.ivassago.com
Re: Object animations in Layout
« Reply #11 on: February 05, 2011, 17:50:20 »
I feel quite the fool now. It was an easy fix.
Last night I had moved my projects folder to another hdd partition and re-copied content to the mod's art folder. When I did that though, I copied over Lightwave's folder structure with it. So the object were in a folder called "objects" not "obj", which is what the converter seems to require. Once I changed the folder name, re-linked the model in Layout and saved out the LWS, it converted fine ;)

Thanks guys.