Import actor that already exists appends strange numbering scheme
When I import an actor that already exists, saying Yes to use the next available id, the new actor appends a numbering scheme to the name that I don't understand. After three consecutive imports of the same DataTurbine actor, my tree now contains:
I'm assuming that's wrong and should just be one incrementing number.
#3 Updated by Derik Barseghian almost 10 years ago
I've checked in a fix, but am leaving this open and changing to a feature request -- see if there's a better way to go about this. When a user instantiates multiple copies of the same actor, kepler increments the number on the name of the actor on the canvas. Things can get confusing when looking back and forth between the canvas and actor tree.
#5 Updated by Derik Barseghian almost 10 years ago
Re: comment#4, for example, if an actor RExpressionRain2001 is created and saved in the library, when dragged to canvas, it becomes RExpressionRain. One reason is that NamedObj's uniqueName method strips the numeric suffix. I've made a change to NamedObj locally to not do this, to instead optionally append an underscore followed by a unique number. If it's the first instance, it will be RExpressionRain2001. The second would be RExpressionRain2001_2. However, the first instance still gets its numeric suffix (2001) stripped by the time the actor hits the canvas, because MoMLParser's attribute calls CompositeEntity's uniqueName().
I see 5 declarations of uniqueName(), and many calls to them. I'm a little reluctant to make changes, it seems like there could be many ramifications...
One slightly hackish solution is to have the first instance of e.g. RExpressionRain2001 dragged to canvas be called RExpressionRain2001_. This seems to work, but isn't very satisfying.