[Python] Import ToonBoom Harmony's .tpl templates programmatically, inside an .xstage project

Discussão em 'Python' iniciado por Stack, Março 17, 2025.

  1. Stack

    Stack Membro Participativo

    Any idea about how to Import or Add some .tpl elements to the actual .xstage file via Python (or JS)?

    I can see there is an Add function, but it only works with Clipboard maybe?

    There is a copy_from_template function, but, unfortunately, I don't understand why I'm getting this error trying to copy the template:

    from ToonBoom import harmony
    harmony.Clipboard.copy_from_template("C:/path/to/the/tpldirectory")

    # > Traceback (most recent call last):
    # > File "<string>", line 1, in <module>
    # > TypeError: descriptor 'copy_from_template' for 'harmony.Clipboard' objects doesn't apply to a 'str' object


    More info on official documentation about copy_from_template here

    and here the documentation for the equivalent using Javascript API for the copyFromTemplate here

    Unfortunately I'm not sure if the approach I'm trying is feasible either...

    Thanks in advance.

    Continue reading...

Compartilhe esta Página