0

I have a .riv file which contains a static svg image (without any animations).

File structure: artboard->image.svg/group1/group2/(groupA/groupB/groupC). Groups A, B, C contain various shapes, ellipses, etc.

I have two questions:

Can I change the visibility of groupC so that the image does not show objects from this group?

Can I remove groupC and add groupD to the file instead? I have tried removing the group in many different ways, but the image stays the same.

     RiveFile riveFile = await RiveFile.asset('assets/images/rive.riv');
     var set = riveFile.mainArtboard
         .children.elementAt(0)        // image.svg
         .dependents.elementAt(0) // group1
         .dependents.elementAt(0) //group2
         .dependents;                       //groupA/groupB/groupC

     var groupC = set.firstWhere((element) => element.name == 'groupC');

     groupC.remove();
     groupC.onRemoved();

    ...

    return Scaffold(
      body: Center(
        child: Rive(
          artboard: riveFile!.mainArtboard,
          fit: BoxFit.fitWidth,
          alignment: Alignment.center,
        ),
      ),
    );

I would appreciate your help, thanks.

0 Answers0