What is the best way to animate a model skin?

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!

Moderators: GZDoom Developers, Raze Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

What is the best way to animate a model skin?

Postby GGianpy » Tue Sep 29, 2020 9:51 am

Good afternoon.

I'm starting to create 3d models in .MD3 format to import them into my project.

I've created a model of a computer where you can put an animation on the screen:

https://drive.google.com/file/d/1WpPQuV1Bq3Yyxv0nxwQ1YfBl7BD7cIiL/view?usp=sharing

This is the code in MODELDEF:
Code: Select allExpand view
Model Dec_Computer
{

   Path "MODELS/Decorations"
   Model 0 "Dec_Computer.md3"
   Offset 0 0 0
   Scale 22 22 22

   SurfaceSkin 0 0 "COMPUTER_TEX1"

   Path "MODELS/Decorations/Anim"

   SurfaceSkin 0 1 "Anim1.png"
   FrameIndex MODA A 0 0
   SurfaceSkin 0 1 "Anim2.png"
   FrameIndex MODA B 0 0
   SurfaceSkin 0 1 "Anim3.png"
   FrameIndex MODA C 0 0
   SurfaceSkin 0 1 "Anim4.png"
   FrameIndex MODA D 0 0
   SurfaceSkin 0 1 "Anim5.png"
   FrameIndex MODA E 0 0
   SurfaceSkin 0 1 "Anim6.png"
   FrameIndex MODA F 0 0
   SurfaceSkin 0 1 "Anim7.png"
   FrameIndex MODA G 0 0
   SurfaceSkin 0 1 "Anim8.png"
   FrameIndex MODA H 0 0
   SurfaceSkin 0 1 "Anim9.png"
   FrameIndex MODA I 0 0
   SurfaceSkin 0 1 "Anim10.png"
   FrameIndex MODA J 0 0

}


The animation is shown on material 1 (the screen).
By doing so I have to write each frame it in MODELDEF and then in DECORATE.

I want to make animations that go beyond 120 frames, how can I simplify this operation?
is there any way to import video or gif to gzdoom?

I've tried using ANIMDEFS but it doesn't work on actors.
GGianpy
Banned User
 
Joined: 11 Mar 2020
Location: Italy
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Not Listed

Re: What is the best way to animate a model skin?

Postby Cherno » Tue Sep 29, 2020 1:29 pm

No, the way you have been doing it is the correct, and only, one. You have to define each frame with it's own SurfaceSkin.
User avatar
Cherno
 
Joined: 06 Dec 2016

Re: What is the best way to animate a model skin?

Postby HAL9000 » Wed Sep 30, 2020 2:38 am

Cherno wrote:No, the way you have been doing it is the correct, and only, one. You have to define each frame with it's own SurfaceSkin.


Huh, I have no problem with animdefs on models. Its working like a charm. You can even combine it with surfaceskin method
User avatar
HAL9000
I'm sorry Dave, I'm afraid I can't do that
 
Joined: 16 Mar 2018
Discord: HAL9000#9378

Re: What is the best way to animate a model skin?

Postby GGianpy » Wed Sep 30, 2020 9:29 am

I tried to use animdefs but the texture was not showing up on the model. Maybe I did something wrong ...

But why don't they implement video or gif support on gzdoom?

They could add a lump called "GIFDEFS" or add a "video" or "gif" property to ANIMDEFS
GGianpy
Banned User
 
Joined: 11 Mar 2020
Location: Italy
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Not Listed

Re: What is the best way to animate a model skin?

Postby CBM » Thu Oct 01, 2020 3:23 pm

in your case, I would consider writing a quick program that can read a video file and then output a folder with each image frame and a single modeldef file that contains a reference to each frame (once you have a simpler example running manually with just a few frames)
User avatar
CBM
Imp Slayer
 
Joined: 09 Oct 2019
Location: The Shores of Hell
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: Yes (Using Development/Testing Version)
Graphics Processor: nVidia with Vulkan support


Return to Assets (and other stuff)

Who is online

Users browsing this forum: No registered users and 0 guests