Jump to content

[SOLVED] Set animation name on skinner.animation by script


photo

Recommended Posts

Hi,

 

i try set animation file for the skinner.animation from the script.

 

In the script i use schemer.input and skinner.animation

post-716-0-84986100-1362321287_thumb.jpg

 

and code for set is: (inputName = Event_Jump_Anim ; value = asset_library/characters/horseman/animations/horse/horse_jump.sanim )

Unigine::Skinner::SkinnerMesh skinnerMesh;

void setSkinnerInputString(string inputName, string value) {
	int inputId = skinnerMesh.getInputID(inputName);
	if (inputId != -1) {
		skinnerMesh.setInput(inputId, value);
	} else {
		log.warning("Unknow Skinner Input: " + inputName);
	}
}

but it not working, so what i do wrong?

 

Or i must do it another way to set it?

 

Thank for reply

Honya

Link to comment

Jan,

 

The thing is Skinner in its blocks caches animations it uses by their ID, since caching allows for faster work. What you need to do is customize the blocks you use to dynamically change the animation. For that, edit data/core/systems/skinner/blocks/.

Link to comment
×
×
  • Create New...