How to make customizable character in Rive

I want to make customizable character in rive to change his outfit during runtime in flutter, and because there is no way to change assets during runtime I added them in rive and joined to my amimated bones. But i cant find the way to change them whem my main "anim" playing. I wish if I could do it with using inputs as an IDs of clothes. workspace

I make a few animations-states which changes opacity and make visible one clothes and transparent others. I can change them with blend state in state machine but can`t play "anim" at the same time. I expect to someany offer me some way to change clothes

1 Answer

I don't know how to solve the problem, I change colors of the animation in this way, maybe I can help you to achieve it.

final bytes = await rootBundle.load(animationPath); final RiveFile file = RiveFile.import(bytes); _riveArtboard = file.mainArtboard ..forEachChild((c) { if (c is Shape) { if (c.name == 'SKY') { c.fills.first.paint.colorFilter = ColorFilter.mode( Customization.variable_6.withOpacity(.9), BlendMode.lighten); } } return true; }) ..addController( _controller = SimpleAnimation('Untitled 1'), ); 
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like