Previous Thread  Next Thread

chat icon Batch Import/Export

ldo

Posted: Fri Nov 30, 2012 11:22 am
Joined: 07 Nov 2010
Posts: 544
I thought it would be useful to be able to perform bulk operations in Blender’s batch mode. For example, I download a bunch of Collada-format models from the Google/Trimble 3D Warehouse, and I want to loop over them and convert them all to .blend files from the command line, without having to tediously click-click-click for each one.

Unfortunately, Blender’s import/export functions are implemented as operators. But operators represent interactive user actions. This makes them rather useless in batch mode—try to use them that way, and you get “operator poll() failed, context is incorrect” errors.

The solution is to implement separate API calls for these functions that are not operators. For example, the following patch adds a “collada_import” function to the bpy.utils module, that can be successfully invoked from batch mode.

http://projects.blender.org/tracker/?func=detail&atid=127&aid=33157&group_id=9
Reply with quote


CoDEmanX

Posted: Sat Dec 01, 2012 1:06 pm
Joined: 05 Apr 2009
Posts: 894
using operators can be a hassle, much appreciated that you did some low level-abilities! There should be low level functions for basically everything...
_________________
I'm sitting, waiting, wishing, building Blender in superstition...
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group