rive-ios icon indicating copy to clipboard operation
rive-ios copied to clipboard

exposed inputs from nested artboards are not working.

Open mjtalbot opened this issue 1 year ago • 2 comments

Now I noticed some other bug: exposed inputs from nested artboards are not working.

I've updated the repository with a new Rive file that has a state machine with both nested input and normal input.

image

Do I need to open a new issue?

Originally posted by @jonyw4 in https://github.com/rive-app/rive-ios/issues/302#issuecomment-2091424033

mjtalbot avatar May 03 '24 09:05 mjtalbot

link to repository with a repro to the issue: https://github.com/Ursula-AI/rive-ios-nested-artboard-bug

(contains .riv, .rev & ios project that will repro the issue)

mjtalbot avatar May 03 '24 09:05 mjtalbot

Okay. Hey folks, do you have any timelines on when are you are taking a look into this bug?

jonyw4 avatar May 08 '24 13:05 jonyw4

Hi @jonyw4, we've been talking about this issue internally, and while its a known issue I do not have a timeline for a fix for this at this point. We are also working on data binding, which will negate the need for an api like this.

The high level api simply does not allow setting states on nested artboards in a nice way at this point. But there are work arounds, which are a little tedious. I've attached a .rev file using a work around to set nested artboard inputs

nested_inputs.rev.zip

mjtalbot avatar May 10 '24 09:05 mjtalbot

Thank you!

But there are work arounds, which are a little tedious. I've attached a .rev file using a work around to set nested artboard inputs

How would that work?

jonyw4 avatar May 10 '24 11:05 jonyw4

Is there a way for me to do a workaround?

jonyw4 avatar May 16 '24 20:05 jonyw4

Hi @jonyw4, to elaborate on the method @mjtalbot mentioned, essentially, you can use an input on the main artboard to change the value of the nested input on a nested artboard. So in that .rev file, he has set up 4 inputs on the main artboard (tl, tr, bl, br), and you can set those directly from your iOS runtime code. When set, those inputs will cause the main state machine to transition to a state that causes the corresponding nested input to also change value. In the .rev file you can see 4 layers on the main artboard's state machine that handle this.

So from the runtime, you only need to be concerned with setting the values of the inputs tl, tr, bl, br.

philter avatar May 22 '24 17:05 philter

I see. That would not work for us, we have 100+ inputs. 😆 Do you guys have any timeline on when this is going to be fixed? 🤔

jonyw4 avatar May 22 '24 18:05 jonyw4

This is now possible on the latest version of the runtime! See our docs: https://rive.app/community/doc/state-machines/docxeznG7iiK#nested-inputs

HayesGordon avatar Jun 07 '24 19:06 HayesGordon