Page 1 of 1

[SOLVED] animation to a single model in 2 models objects

Posted: Fri May 22, 2015 7:41 pm
by Granamir
Hi everyone,
is there a way to add animation only to one precise model (with a name) in an object with more than one model?
Or,
does error message, received in console for not founding a model for animation, affect somehow (maybe appearing while player is playing) the exported dungeon?

TY

Re: animatio to a single model in 2 models objects

Posted: Fri May 22, 2015 7:55 pm
by minmay
An AnimationComponent affects only one model. By default it will be the component named "model", but you can change it with AnimationComponent's model field.

Re: animatio to a single model in 2 models objects

Posted: Fri May 22, 2015 8:06 pm
by Granamir
Ty minmay, solved giving name "model" only to model i need.
Btw for better understanding of this component, initially i gave 2 names to my 2 models, and animation tryed to apply to both, to the right one it applyed and plyed, to the wrong one sent me am error message in console.
I looked in animation component https://github.com/JKos/log2doc/wiki/Co ... -component but found nothing. Can u tell me where can i find what i would need?
TY

Re: [SOLVED] animation to a single model in 2 models objects

Posted: Fri May 22, 2015 8:46 pm
by minmay
I already told you. AnimationComponent has a "model" field for choosing which model to apply the animations to. Example:

Code: Select all

defineObject{
	name = "forest_pit_trapdoor",
	baseObject = "base_pit_trapdoor",
	components = {
		{
			class = "Model",
			model = "assets/models/env/forest_pit.fbx",
			dissolveStart = 4,
			dissolveEnd = 6,
			staticShadow = true,
		},
		{
			class = "Model",
			name = "trapDoorModel",
			model = "assets/models/env/mine_pit_trapdoor.fbx",
		},
		{
			class = "Animation",
			model = "trapDoorModel",
			animations = {
				open = "assets/animations/env/mine_pit_trapdoor_open.fbx",
				close = "assets/animations/env/mine_pit_trapdoor_close.fbx",
			},
		},
	},
}

Re: [SOLVED] animation to a single model in 2 models objects

Posted: Sat May 23, 2015 8:33 am
by Granamir
TY
Got it.