✅ SOLVED: Libraries - control child components viewmodel with DataBinding
Hello,
So I am trying to control a published library components state machine through a viewModel and enums and it doesn’t work in editor or in runtime javascript.
I have a root or parent rive file with one artboard. The root has its own viewModel that has one enum that changes a solo through a state machine. I can press play in the editor and change the enum and visually everything works in the root.
Now I created another child rive file that has one artboard that is a component. This child also have one enum and one viewModel. This enum controls a solo through a statemachine just like the root. When I press play and test the child in an editor it works great.
The problem is when i publish the child component rivefile as a library rive item and then import it into the root rive file. Everything seems to work, the childs artboard, enum and viewModel are all imported and look correct. But when I press play I can only change the value of the enum in the root parent. There is no way to set the enum on the child to change its statemachine.
I also have my javascritpt runtime loading the rive file. Its crazy, the code can see the root artboard, viewmodel and enums. The code can also see and bind the child library item and see its artboard, enum, viewmodel. It can even change the enum without errors and then read the value of the state machine is updated. But nothing visually updates in the childs statemachine.
TLDR - So basically having a root artboard that has an instance of a library component in it. you are unable to successfully control the library components attached state machine in the editor and also in code.
Thank you for anyone that has time to help. I have been debugging this for 3 days now and have created a very simple rev file showing the problem.