Node animation is not visually played.

Post Reply
User avatar
Andrey01
Member
Posts: 2460
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

Node animation is not visually played.

by Andrey01 » Post

I made a moving animation of the curtains one block when clicked. To implement it I needed to duplicate repeatedly the blender model and shift to some spacing. Then unwrapped it so:
Image
Screenshot_20200125_221701.png
Unwrap
(696.92 KiB) Not downloaded yet
After clicking new node is set with moving animation, but to my surprising textures are not switched and also it looks like strange:
Image
Screenshot_20200125_225548.png
Curtain Moving
(146.75 KiB) Not downloaded yet
May I located or sized the unwrap elements wrong? Here is a source:
Screenshot_20200125_221701.png
Unwrap
(696.92 KiB) Not downloaded yet
Attachments
curtain.zip
Curtain
(375.9 KiB) Downloaded 11 times

User avatar
Nathan.S
Member
Posts: 1052
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

Re: Node animation is not visually played.

by Nathan.S » Post

Nodes can't be animated, you'd need to use an entity to do that. If you just want to swap between and open and closed curtain you need to register two nodes, and have them swap back and forth when clicked on.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
Andrey01
Member
Posts: 2460
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

Re: Node animation is not visually played.

by Andrey01 » Post

Nathan.S wrote:Nodes can't be animated, you'd need to use an entity to do that. If you just want to swap between and open and closed curtain you need to register two nodes, and have them swap back and forth when clicked on.
Nodes can be animated by using 'animation' field in 'tiles' and duplicating the blender models shifting a certain distance to give a look of moving smoothly. The sample mods releasing such trick are Gears3D, Watermill. But I don`t understand why those problems are caused to me descripting above though I followed the same principles which they did.

Eran
Member
Posts: 123
Joined: Fri May 03, 2019 16:46

Re: Node animation is not visually played.

by Eran » Post

I fixed it by adding an additional pair of braces like so:

Code: Select all

tiles =
{
	{
	 	name="simple_tulle_moving21.png^(simple_tulle_moving11.png^[multiply:#FF0000)",
		 animation=
		 {
			 type="vertical_frames",
			 aspect_w=256,
			 aspect_h=256,
			 length=1.5
		},
	},
},
In comparison, this was the original code:

Code: Select all

tiles =
{
	name="simple_tulle_moving21.png^(simple_tulle_moving11.png^[multiply:#FF0000)",
	animation=
	{
		type="vertical_frames",
		aspect_w=256,
		aspect_h=256,
		length=1.5
	},	
},

User avatar
Andrey01
Member
Posts: 2460
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

Re: Node animation is not visually played.

by Andrey01 » Post

Eran wrote:I fixed it by adding an additional pair of braces like so:

Code: Select all

tiles =
{
	{
	 	name="simple_tulle_moving21.png^(simple_tulle_moving11.png^[multiply:#FF0000)",
		 animation=
		 {
			 type="vertical_frames",
			 aspect_w=256,
			 aspect_h=256,
			 length=1.5
		},
	},
},
In comparison, this was the original code:

Code: Select all

tiles =
{
	name="simple_tulle_moving21.png^(simple_tulle_moving11.png^[multiply:#FF0000)",
	animation=
	{
		type="vertical_frames",
		aspect_w=256,
		aspect_h=256,
		length=1.5
	},	
},
Thanks, I doubted first it would fix the issue, but it has really done!

sofar
Developer
Posts: 2132
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: Node animation is not visually played.

by sofar » Post

Animating nodes like this is very triangle-costly and should be avoided. Even triangles with fully transparent textures get rendered - so you're making the node 20-50x more difficult to render than an entity.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests