py api
bpy.*libBlickSeq*.new() - name is now an optiona arg. moved some more scripts to bpy.* api.
This commit is contained in:
@@ -457,7 +457,7 @@ PyObject *LibBlockSeq_new(BPy_LibBlockSeq *self, PyObject * args, PyObject *kwd)
|
||||
/* New Data */
|
||||
if (self->type == ID_IM) {
|
||||
/* Image, accepts width and height*/
|
||||
if( !PyArg_ParseTuple( args, "s|ii", &name, &img_width, &img_height ) )
|
||||
if( !PyArg_ParseTuple( args, "|sii", &name, &img_width, &img_height ) )
|
||||
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
||||
"one string and two ints expected as arguments" );
|
||||
CLAMP(img_width, 4, 5000);
|
||||
@@ -497,7 +497,7 @@ PyObject *LibBlockSeq_new(BPy_LibBlockSeq *self, PyObject * args, PyObject *kwd)
|
||||
|
||||
} else {
|
||||
/* Other types only need the name */
|
||||
if( !PyArg_ParseTuple( args, "s", &name ) )
|
||||
if( !PyArg_ParseTuple( args, "|s", &name ) )
|
||||
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
||||
"new(name) - name must be a string argument" );
|
||||
}
|
||||
|
||||
@@ -132,7 +132,6 @@ Example::
|
||||
@type actions: L{libBlockSeq}
|
||||
@var libraries: L{librarySeq<LibData>} submodule
|
||||
@type libraries: L{librarySeq<LibData>}
|
||||
|
||||
"""
|
||||
|
||||
|
||||
@@ -218,6 +217,10 @@ class libBlockSeq:
|
||||
|
||||
Most datatypes accept a name for their argument except for L{sounds}, L{fonts}, L{ipos} and L{curves} that need an additional argument.
|
||||
|
||||
The name argument is optional if not given a default name will be assigned.
|
||||
|
||||
The name given may be modified by blender to make it unique.
|
||||
|
||||
Loading From File
|
||||
=================
|
||||
For L{images}, L{texts}, L{sounds}, L{fonts} types you can use the filename keyword to make a new datablock from a file.
|
||||
|
||||
Reference in New Issue
Block a user