Sorry, we don't support your browser.  Install a modern browser

Solos#159

Implement the Solo object, as in Rive 1. A solo is similar to a group, but it adds the ability to toggle the rendering of nested objects. It works like a radio button, so it will de-activate other objects on the same level. This is much faster than having to animate the opacity of each object individually.

2 years ago
Merged Single Nodes#158
2 years ago
Changed the status to
Planned
2 years ago

Hi! What workaround can we use right now to avoid layered several similar objects at the same position in the editor?
For example, I need to change my character’s clothes or hairstyle (more than ten). I have to display them all simultaneously in the editor and hide them in the animation. It turns out that several elements of the same type are layered on top of each other on the editor screen.

a year ago

Hi! Are you looking to hide the layers while in design mode? If so, you can try using the visibility toggle via the eye icon when hovering over a layer in the hierarchy. That isn’t an animatable property, however. You may need to use opacity to switch between them in the animations themselves.

a year ago

Yes, as @Alex Gibson says, that is an option until the object is implemented. There is another way that might work for you.In this case it would be necessary to have a background. The idea is to apply a Draw Order to each clothing or hairstyle, so that in the normal position, all these elements are behind the background and by activating each of them you can make them change position above the character. You could do a test and see if it works for you. This is an example.

a year ago

Thank you for such a fast response. Yes, I need to hide objects in the design mode. However, I can’t use eye toggle because every time before start State Machine (to change the hairstyle), I should toggle on all hidden hairstyles. Because if I hide any object with the toggle of the eye icon, it will not show in the animation when I change the visibility with the animation. The workaround with background and draw order works, but I need to animate the draw order, and I don’t need the background, so I need to hide it in State Machine. It’s not difficult, but there are too many steps to produce the result. Because I need to change visibility in the State Machine anyway, the easiest way for me to hide and show objects in the design mode is to click on the object in the hierarchy and change the visibility of the layer to 0% or 100%. So it’s not much harder than switching the drawing hierarchy below. But I don’t need to remember that I need to change them in the State Machine. Anyway, thank you for such great work! I will be waiting for Solos and other new great features in Rive 2.

a year ago

Since you’re already using the state machine, I wonder if another work around would be to use a blend state.

You can create an animation for each of your outfits and add a single keyframe to all of the objects that you need to switch between – 0% opacity for the hidden ones and 100% for the item to show. Then create a new layer on your state machine and add a 1D blend state connected to the entry node.

Create a number input to control which item to show, then add all your static animations to the blend state at different numbers. Then you can set the number to control which outfit to show.

Here’s a very basic example of it switching between different coloured boxes when you move the number up. I’ve also attached the file so you can open it in Rive to see how it’s put together.

Not sure if it’s any faster, but another option!

a year ago

Thank you for this solution. I have created another version of your example. Maybe it could help someone.

https://rive.app/community/502-962-change-layers-in-the-state-machine/

In this State Machine, I call the opacity reset animation for all layers every time the Input changes. It allows you to avoid adding 0% opacity to each animation for a layer whenever we add a new layer with 100% opacity. Instead, the animation for each layer (R, G, B) contains only 100% opacity for each of the layers, respectively.

It would be great if you could add the new state “Input Changed.” Or some similar option that allows you to catch the Input changes. In my example, I add the backward arrow with “outfit !=” condition to every animation to have the ability to catch Input changed. Of course, we have the workaround, we can create the new Input with type Trigger and call it whenever we change the Input with type Number, but it’s less convenient.

a year ago

Awesome! It sounds like we can simply use the ‘Any’ state to achieve what you’re describing. I’ve made a new version here. Like the first verion, it uses a second statemachine layer for the switching. Rather than using the entry node, the R,G,B animations are connected to the Any State, which will monitor input changes regardless of what state is currently active. That way you can avoid creating the backward connections.

ps – we just introduced an ‘Open in Rive’ button, so you can open the file directly from the community now!

a year ago

Great! I tried the same approach with Any State before, but I had Layer 1 and Layer 2 swapped. In this case, nothing works. Your example works even if you make animations like One Shot instead of Loop. But if you switch Layer 1 and Layer 2, everything stops working, and when you change the outfit’s value, the console only outputs information about changing Any State to G in Layer 2 (as if Layer 1 is not called). If I understand correctly, the layers in the State Machine are called each frame simultaneously but sequentially from top to bottom. And this happens all the time, every frame? Or not quite so? I posted a new example-based on yours (only replaced the Loop with One Shot). Please change the order of Layer 1 and Layer 2 in the State Machine, and you will see that this stops working (I did not do this, not to publish to the Community not working version). If I understand correctly, after changing the outfit, Animation 1 is still called, which resets the opacity of all objects. Please clarify.

https://rive.app/community/502-972-change-layers-in-the-state-machine/

‘Open in Rive’ is very helpful feature. Thank you!

a year ago

Really looking forward to Solos being released as will make it much easier!

9 months ago