Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2007-03-27 18:49:37 +0400
committerCampbell Barton <ideasman42@gmail.com>2007-03-27 18:49:37 +0400
commit30fb777971de40db481074e4ac3ab3de6502d8f3 (patch)
tree0b022839bdffee4c69776d8cff2912efdae019ff /source/blender/python
parent66238eab7c618286f4097254e255db44b29d4e61 (diff)
py api
bpy.*libBlickSeq*.new() - name is now an optiona arg. moved some more scripts to bpy.* api.
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/api2_2x/BPyModule.c4
-rw-r--r--source/blender/python/api2_2x/doc/Bpy.py5
2 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/python/api2_2x/BPyModule.c b/source/blender/python/api2_2x/BPyModule.c
index 8ca3f28912c..8c85324bde4 100644
--- a/source/blender/python/api2_2x/BPyModule.c
+++ b/source/blender/python/api2_2x/BPyModule.c
@@ -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" );
}
diff --git a/source/blender/python/api2_2x/doc/Bpy.py b/source/blender/python/api2_2x/doc/Bpy.py
index 8ba9ef20469..8f95a84dbe5 100644
--- a/source/blender/python/api2_2x/doc/Bpy.py
+++ b/source/blender/python/api2_2x/doc/Bpy.py
@@ -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.