Importer un script py externe dans un script blender?

Nov 05 2020

J'ai écrit un script py pour une exportation personnalisée. Je voudrais ajouter ce script à mon fichier blend et l'appeler en utilisant certains paramètres. Le script suivant est un dossier au-dessus de mon fichier blend:

from sys import path
path.append('//../fbx_collection_export.py')
from fbx_collection_export import export

Lors de son exécution, j'obtiens l'erreur suivante:

ModuleNotFoundError: Aucun module nommé 'fbx_collection_export'

Q: Qu'est-ce que je fais de mal et comment puis-je y remédier?

Réponses

1 readock Nov 07 2020 at 23:01
from sys import path
path.append(bpy.path.abspath("//")+'/../Scripts')
from fbx_collection_export import export