disabled Object.Duplicate() in background mode bacause it needs the 3d view, added a note in the docs.

This commit is contained in:
2007-03-14 02:11:42 +00:00
parent 4badc5da7a
commit d3ae4b9944
2 changed files with 8 additions and 0 deletions

View File

@@ -987,6 +987,12 @@ static PyObject *M_Object_Duplicate( PyObject * self_unused,
static char *kwlist[] = {"mesh", "surface", "curve",
"text", "metaball", "armature", "lamp", "material", "texture", "ipo", NULL};
/* duplicating in background causes segfaults */
if( G.background == 1 )
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
"cannot duplicate objects in background mode" );
if (!PyArg_ParseTupleAndKeywords(args, kwd, "|iiiiiiiiii", kwlist,
&mesh_dupe, &surface_dupe, &curve_dupe, &text_dupe, &metaball_dupe,
&armature_dupe, &lamp_dupe, &material_dupe, &texture_dupe, &ipo_dupe))