Hallo I have this little demo patch where I have a spread of lines/paths and 2 different ways to show them, represented by a class or record. For the first time I am using Interfaces so I tried to keep it as simple as possible. I am not sure how to assign a different animation to each line without having to create an instance of the animation class/record for each line.
A possible solution using Delegates ( so I go both torns out at once ), not sure if this is optimal though. I think this could be a good and simple example of how/why to use Interfaces and Delegates, which is missing in the Help Browser.
when in your first example you say “works, but doesn’t look right”, what exactly do you mean does not look right?
the patch? if so, what makes you think so?
the rendering? if so, how should it look?
indeed what you could improve in the patch: currently you’re creating both animations for each TestPath, but then only use one of them. instead you could use two if regions and only create one of the animations. since the whole thing is in a Cache region, you also don’t have to put the Animation creators on Create().
What I meant is that creating the 2 animations for each path and then only applying one to the path did not look performing or neat, as you mentioned. In the second patch I think I have improved how the animation is assigned to the path, but as this is the first time I use Interfaces and Delegates I am open to suggestions and improvements.
For those who are also interested in the use of Interfaces and examples there is another interesting thread : The Interface Thread