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.
Post Reply
GGianpy
Posts: 57
Joined: Wed Mar 11, 2020 3:09 pm
Graphics Processor: Not Listed
Location: Italy

What is the best way to animate a model skin?

Post by GGianpy »

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/1WpPQuV ... sp=sharing

This is the code in MODELDEF:

Code: Select all

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.
User avatar
Cherno
Posts: 1337
Joined: Tue Dec 06, 2016 11:25 am

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

Post by Cherno »

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
HAL9000
Posts: 266
Joined: Fri Mar 16, 2018 7:44 am
Contact:

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

Post by HAL9000 »

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
GGianpy
Posts: 57
Joined: Wed Mar 11, 2020 3:09 pm
Graphics Processor: Not Listed
Location: Italy

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

Post by GGianpy »

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
User avatar
CBM
Posts: 373
Joined: Wed Oct 09, 2019 3:39 am
Graphics Processor: nVidia with Vulkan support
Location: The Shores of Hell

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

Post by CBM »

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)
Post Reply

Return to “Assets (and other stuff)”