2
$\begingroup$

I wrote a py script for a custom export. I'd like to append that script to my blend file and call it using some parameters. The following script is one folder above my blend file:

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

When running it, I get the this error:

ModuleNotFoundError: No module named 'fbx_collection_export'

Q: What am I doing wrong and how can I fix it?

$\endgroup$
3
  • 3
    $\begingroup$ Add a directory path to the system path not a filepath. (Not a relative path either) See blender.stackexchange.com/questions/5287/… $\endgroup$
    – batFINGER
    Nov 4, 2020 at 16:34
  • $\begingroup$ thank you @batFINGER that was the issue $\endgroup$
    – readock
    Nov 4, 2020 at 16:50
  • 1
    $\begingroup$ Please add your solution as an answer, not as edit to your question. $\endgroup$
    – Robert Gützkow
    Nov 4, 2020 at 22:02

1 Answer 1

2
$\begingroup$
from sys import path
path.append(bpy.path.abspath("//")+'/../Scripts')
from fbx_collection_export import export
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .