Call a script from a python script or the python console

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

aws357
Posts: 61
Joined: Wed Sep 21, 2005 4:59 pm

Call a script from a python script or the python console

Postby aws357 » Tue Jul 17, 2012 7:08 pm

I am doing some tedious and repetitive work on a project of mine : import digitized .obj and cleaning them before saving them in .blend.

For the moment I am doing this by hand. But having to do this a couple hundred of time, while doable, would not be enjoyable.

So I am wondering if it is possible to call the import obj script from python itself?

If yes a simple loop would mean a lot less time wasted doing a very mind numbing task.

Thanks for any hint.

aws357
Posts: 61
Joined: Wed Sep 21, 2005 4:59 pm

Postby aws357 » Tue Jul 17, 2012 7:17 pm

Found the answer (funny how actually asking the question on blender.org seems to let my brain find the solution alone...)

bpy.ops.import_scene.obj(filepath="", filter_glob="*.obj;*.mtl", use_ngons=True, use_edges=True, use_smooth_groups=True, use_split_objects=True, use_split_groups=True, use_groups_as_vgroups=False, use_image_search=True, split_mode='ON', global_clamp_size=0, axis_forward='-Z', axis_up='Y')


Return to “Python”

Who is online

Users browsing this forum: No registered users and 1 guest