Closed mikerreed closed 2 years ago
I think this is a great idea! It'll drive us more and more towards defining a default state/config from the editor. Which is what we want long term anyway.
This looks like a great simplification to me!
Does artboardDefault() always return a value now? I recall trying to draw some riv files in the past that didn't appear to have a default animation.
Should return something, or null if there are zero items -- if you have a riv that returned null, let's double check that it actually had the thing you're looking for
Make the 'default' way to use our public API be to use instances.
To achieve this, provide a way for clients iterate and find instances (artboards, animations, statemachines) without ever having to first use a "raw" object (i.e. the non-instance variants).
std::string File::artboardNameAt(index) std::string Artboard::animationNameAt(index) std::string Artboard::stateMachineNameAt(index)
std::unique_ptr File::artboardDefault()
std::unique_ptr File::artboardAt(index)
std::unique_ptr File::artboardNamed(name)
std::unique_ptr ArtboardInstance::animationDefault()
std::unique_ptr ArtboardInstance::animation(index)
std::unique_ptr ArtboardInstance::animationNamed(name)
std::unique_ptr ArtboardInstance::stateMachineDefault()
std::unique_ptr ArtboardInstance::stateMachineAt(index)
std::unique_ptr ArtboardInstance::stateMachineNamed(name)
Don't expose the "raw" variants, only the instances. This reduce the size of our API, making it simpler.