Page 1 of 1

Having issues with my my 3d model animation.

PostPosted: Tue Apr 03, 2018 12:28 pm
by Zen3001
I'm using blender with nash's md3 script(viewtopic.php?f=37&t=35790)
to create the model.

I didn't see any error anywhere during the whole process, and the model does get spawned in gzdoom but the animation just doesn't work.

here's a download link for the blend file and the pk3.

Re: Having issues with my my 3d model animation.

PostPosted: Tue Apr 03, 2018 2:50 pm
by R4L
How many frames is the animation? If it is ten frames for example (0-9), then you have to make sure your MODELDEF contains all your frames in FrameIndex. 10 frames, so 10 FrameIndex entries.

Re: Having issues with my my 3d model animation.

PostPosted: Tue Apr 03, 2018 4:22 pm
by Zen3001
just 3 frames

Re: Having issues with my my 3d model animation.

PostPosted: Tue Apr 03, 2018 4:31 pm
by R4L
Okay, so you will need to add three FrameIndex entries. Something like:

Code: Select allExpand view
FrameIndex LUMP A 0 0
FrameIndex LUMP B 0 1
FrameIndex LUMP C 0 2


If it's a decoration, just create a Spawn state for the object and loop through the frames:

Code: Select allExpand view
Spawn:

LUMP ABC 3
Loop

Re: Having issues with my my 3d model animation.

PostPosted: Wed Apr 04, 2018 8:51 am
by Zen3001
you should take a look at the download I provided.
This looks exactly like my code, except I'm using zscript instead of decorate
and the zscript is written properly, there are no errors in the log and the model appears in gzdoom when I spawn the actor but only uses the first frame without any animation.

Re: Having issues with my my 3d model animation.

PostPosted: Wed Apr 04, 2018 9:00 am
by Zen3001
OK I tried using decorate instead, here's what I wrote:
Code: Select allExpand view
ACTOR Dancer{
   States{
      Spawn:
         DANC ABCB 5
         Loop
   }
}


and in case you really don't want to click on that download link, here's the modeldef:
Code: Select allExpand view
Model Dancer{
   Path "model"
   Model 1 "DANCER"
   Skin 1 "TEXTURE_"
   AngleOffset 90
   
   Scale 7.33 7.33 7.33
   
   FrameIndex DANC A 1 0
   FrameIndex DANC B 1 1
   FrameIndex DANC C 1 2
}

Re: Having issues with my my 3d model animation.

PostPosted: Wed Apr 04, 2018 9:23 am
by R4L
I opened your blend file, but I do not see any frames for animation. In fact, it says you have 250 frames, starting at 1. There are no keyframes though.

Re: Having issues with my my 3d model animation.

PostPosted: Wed Apr 04, 2018 9:56 am
by Zen3001
stupid me, wrong file...
retry the link please

Re: Having issues with my my 3d model animation.

PostPosted: Wed Apr 04, 2018 10:07 am
by R4L
The new blend file has keyframes, but again it is 250 frames long. Also, your keyframes actually end up being 80 frames total. You need to set the end frame, and then you will need to add more FrameIndex entries. The reason nothing happens is because you have 3 frames defined in MODELDEF, when there are actually 80 total frames. Test this in Blender by setting your end frame to 80, and play the animation. As it is now, the animation ends around frame 80, and then just sits and does nothing for 170 frames.

Re: Having issues with my my 3d model animation.

PostPosted: Wed Apr 04, 2018 11:04 am
by Zen3001
understand, so I just didn't knew how to use frames.
did everything you said and it's working now

Re: Having issues with my my 3d model animation.

PostPosted: Wed Apr 04, 2018 11:11 am
by R4L
Good job! :)