# - do not add class style tag with anything but animation name list (needs to be parsed! animation-name: animation_1, animation_2;), but repeat all the other data for each path. This is the only way to add two different animations to a single path.
# - fix delay
# - implement removal of animations
classLine_Animator(inkex.Effect):
def__init__(self):
inkex.Effect.__init__(self)
self.arg_parser.add_argument("--duration",
type=float,
default=10.0,
help="Duration in seconds")
self.arg_parser.add_argument("--repeat",
type=int,
default=1,
help="Number of repetitions for looping, 0 means infinite")
self.arg_parser.add_argument("--delay",
type=float,
default=0.0,
help="Delay of animation start in seconds")
self.arg_parser.add_argument("--identifier",
default="animation_1",
help="Unique identifier for the animation (only A-Z, a-z, 0-1, _)")
self.arg_parser.add_argument("--remove_from",
default="selected",
help="Remove animations from selected items")
self.arg_parser.add_argument("--action",
# other options: remove_anim, advanced, help
default="add_anim",
help="The active tab when Apply is pressed.")
self.arg_parser.add_argument("--timing",
# other options: ease-in, ease-out, ease-in-out, linear
default="ease")
defeffect(self):
self.root=self.document.getroot()
id_regex=re.compile('^[a-zA-Z0-9_]+$')
ifnotid_regex.match(self.options.identifier):
inkex.errormsg(_("Please make sure that the animation's name does not contain any other characters than uppercase or lowercase letters from A to Z, numbers from 0 to 9, or underscores."))
inkex.errormsg(_('At least one of the selected objects is not a path: {}\nPlease convert all objects to paths before running this extension.\n').format(element.get('id')))
total_length=sum(lengths)
#inkex.utils.debug(total_length)
#inkex.utils.debug(lengths)
end_percent=0
forindex,lengthinenumerate(lengths):
# if we're creating an animation just to
# hide a path during delay time
ifis_delay_anim==True:
# TODO: fix delay!
inkex.errormsg(_("Sorry, delay isn't working currently. Please set back to zero."))