Texture animation

GTA:V Modding with ZModeler3 discussion.
Post Reply
Danix.93
Posts: 36
Joined: Thu May 11, 2017 3:16 am

Texture animation

Post by Danix.93 »

Hello, is it possible to create animated textures on props with the new animation function?
User avatar
Oleg
Site Admin
Posts: 14045
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Texture animation

Post by Oleg »

no, .ycd animation creates movement and rotation for bones of skeletal objects, it does not animate UV on material.

May you specify me (file) location of an animated props, so I could take a look?
Danix.93
Posts: 36
Joined: Thu May 11, 2017 3:16 am

Re: Texture animation

Post by Danix.93 »

Of course, there is for example a Christmas tree which has emissive animated UV textures, ch_prop_tree_02a.ydr that is located in GTAV\update\x64\dlcpacks\mpheist3\dlc.rpf\x64\levels\gta5\props\prop_ch_penthouse.rpf. Also in the same folder there is the .ycd file which animates the UV.
There is this guide that explains how to make the animation with code, https://dekurwinator-mods.bitrix24.site ... #block2238, but it would be so good if it could just be made in Zmodeler!
Thank you for your attention!
User avatar
Oleg
Site Admin
Posts: 14045
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Texture animation

Post by Oleg »

can I spawn this model nearby with NativeTrainer (the one that comes with scriptHook) ?

Also, may you drop me references to some more files with UV animation, so I have several files to dig in and compare?
Danix.93
Posts: 36
Joined: Thu May 11, 2017 3:16 am

Re: Texture animation

Post by Danix.93 »

I don't know, but you can use Map Editor or Menyoo Object Spooner. You can also use CodeWalker (a GTA5 world editor) to see it animated without launching the game.

At this time I don't remember other objects (if I remember i'll post here) but you can dig in my mod DNX Christmas Lights, which has UV animated textures that i've created with the guide in my previous post.
User avatar
Oleg
Site Admin
Posts: 14045
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Texture animation

Post by Oleg »

I was able to spawn objects with native trainer.

The UV animation support added, get an update.
UV animation will have _uv_* in an animation name, where * is a material index. Note, the index is zero-based, unlike the tutorial given above. So, to animate the first material of the model, animation name should be like this: test_animation_uv_0

You can check materials order in ZModeler's materials editor window, but an exporter can skip unused materials, so this is not the best option. I would suggest to use OpenIV to check for material number: press "More Information" -> Shaders and inspect a list of shaders there. Once you find the shader with textures that need to be animated, this shader order number is the one you need to specify in animation name. For example, if the shader to animate is the second in a list, animation name will be test_anim_uv_1 (mind the first material is _uv_0, second material -> _uv_1 etc.)

One animation can contain only one UV animation data, so if your model requires several animated materials, you will need to create several animations like "test_anim_uv_0", "scroll_anim_uv_1", "another_anim_uv_4". You still can save several animations into ONE ycd file, just select several animations before saving a file.

UV animation track have to be named [uv]

P.S. there are some issues with .ydr export, I get game crash when I spawn modified .ydr file. So, I've tested modified animation .ycd file on native objects.
Danix.93
Posts: 36
Joined: Thu May 11, 2017 3:16 am

Re: Texture animation

Post by Danix.93 »

Thank you for this update!! I'll give it a look as soon as possible!
Wycc
Posts: 2
Joined: Sat Dec 25, 2021 11:45 pm

Re: Texture animation

Post by Wycc »

Is there a detailed tutorial on texture animation, preferably with video, and is the texture animation visible in zmodeler3? I'm pretty much done with the normal ycd animation files and would like to learn about textures in zmodeler3.
User avatar
Oleg
Site Admin
Posts: 14045
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Texture animation

Post by Oleg »

No, you can't see UV animation in ZModeler, it's not supported.
In general, UV animation track has a movement on X and/or Y axis that will move UV mapping on associated material. The entire Texture is 1.0 x 1.0, so movement on X from 0.0 to 1.0 will scroll entire texture horizontally. Movement from 0.0 to 3.0 will scroll texture 3 times.

Some texture animations use non-interpolated animation, say 0 -> 0.25 -> 0.5 -> 0.75 where "->" is a jump in one frame. You can make this "ladder" by setting Interpolate mode to "None". If you do so, texture data on material will jump from default to 25% shift, then to 50% shift, then to 75% shift. Doing so, you can render an animation frames onto texture one by one and map an object onto the first frame. Animating with ladder will create a video effect when frames are changing one another. An example can be found in "ch_prop_ch_arcade_space.ycd" file in "ch_prop_arcade_space_01a_scrn_uv_uv_0" animation (see attached image). You can see a 4 steps on X track for every step on Y track (so 16 steps on X and 4 on Y). This will iterate UV mapping on texture with 4x4 rendered frames. See a layout image example. Red square is where original UV mapped to. Other squares is where UV animation moves this mapping to.

P.S. Don't mind Y animation using values in range 1.0 -> 1.75. In UV animation 1.0 is the same as 2.0, 3.0, since texture is tiled (repeat texture data from 0.0 upon reaching 1.0). So track animation in range 1.0 -> 2.0 is identical to animation in range 0.0 -> 1.0
Attachments
uv_anim_video_frames.jpg
uv_anim_video_frames_layout.jpg
Wycc
Posts: 2
Joined: Sat Dec 25, 2021 11:45 pm

Re: Texture animation

Post by Wycc »

Does the texture animation run on the car?
User avatar
Oleg
Site Admin
Posts: 14045
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: Texture animation

Post by Oleg »

if you know how to force the game to play some specific animation from ycd file, yes, it will work on yft file too.
Lokithan
Posts: 5
Joined: Thu Jan 13, 2022 10:56 am

Re: Texture animation

Post by Lokithan »

Any tutirial How is work
Post Reply