What I am trying to do is import a .stl model into blender using a script (in python). I have tried using the command below but I can't seem to get it to work. The problem is I don't know the format of the "Filepath", "files", and "directory" part of the command.
bpy.ops.import_mesh.stl(filepath="", filter_glob="*.stl", files=None, directory="")
Can someone please show me how to get this working; that is all I ask.
bpy.ops.import_mesh.stl(filepath="C://Users//Dom//Documents//DomCorp.//mymodel.stl", filter_glob="*.stl", files=None, directory="")
When I write this I get this errror:
TypeError: Converting py args to operator properties: IMPORT_MESH_OT_stl.files expected a each sequence member to be a dict for an RNA collection, not str
Since I am fairly new to programming I don't know what it means so can someone help and explain it and possibly come up with a fix?? :)
I have managed to work this out!! :D
This seems to work:
bpy.ops.import_mesh.stl(filepath="C://Users//Dom//Documents//DomCorp.//mymodel.stl", filter_glob="*.stl", files=[{"name":"mymodel.stl", "name":"mymodel.stl"}], directory="C://Users//Dom//Documents//DomCorp.")