Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query on Controlling Nested Artboard State Machines from Main Artboard #365

Open
blake-lim opened this issue Mar 11, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@blake-lim
Copy link

Dear Team,

I hope this message finds you well. I am currently working on a project where I am utilizing Rive within a Flutter application. I have encountered a challenge that I hope you can help me with.

I have a main artboard that contains a nested artboard referred to as 'Hair1'. This nested artboard includes a state machine named 'State Machine 1' with an input titled 'Color Number'. My objective is to change the hair color in the nested artboard 'Hair1' to blue when 'Color Number' is set to 1 at runtime.

My questions are as follows:

  1. Is it possible to directly control the state machine of a nested artboard from the main artboard within the Rive runtime environment?

  2. If direct control is not possible, does Rive allow for 'Expose to Parent Artboard' settings that would enable the main artboard's runtime to control inputs that have been exposed from a nested artboard?

I am looking for a solution that allows me to manipulate the state machine inputs of a nested artboard or its exposed inputs through the main artboard at runtime in a Flutter application.

Any guidance or suggestions you can provide would be greatly appreciated. I am eager to find a solution that maintains the performance and responsiveness of the application while enabling the desired level of control over the nested artboard's elements.

Thank you for your time and assistance. I look forward to your response.

@blake-lim blake-lim added the bug Something isn't working label Mar 11, 2024
@S-Khavin
Copy link

I am also facing the same issue. I have exposed inputs to parent artboard in rive, but when I try to access those input's in my flutter application, the state machines inputs are empty. I still not found any solution for this.

I am using flutter flame.

Future<void> onLoad() async{
    controller = StateMachineController.fromArtboard(
      artboard,
      'State Machine 1',
    );
    artboard.addController(controller!);
    print(controller!.inputs);  // this prints '[]' but there are exposed input's in the artboard
    background = RiveComponent(artboard: artboard);
    add(background);
    return super.onLoad();
  }

@naychrist
Copy link

naychrist commented Apr 11, 2024

this works for me: #341

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants