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>2006-10-05 19:24:15 +0400
committerCampbell Barton <ideasman42@gmail.com>2006-10-05 19:24:15 +0400
commit3bd71e9ad50fc002e4dacd0b869dadb9a580f2e5 (patch)
tree1ce7e89598a38b6a4f27f259550f5f5c88275f7f /source/blender/python/api2_2x/Library.c
parentfe50037f7ef1b16823324eed0e44a0918692d91c (diff)
added the option to Blender.Library to 'link' data for malefico
Diffstat (limited to 'source/blender/python/api2_2x/Library.c')
-rw-r--r--source/blender/python/api2_2x/Library.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/source/blender/python/api2_2x/Library.c b/source/blender/python/api2_2x/Library.c
index 8e25820a4b6..ac88fb53268 100644
--- a/source/blender/python/api2_2x/Library.c
+++ b/source/blender/python/api2_2x/Library.c
@@ -37,6 +37,7 @@
#include "DNA_curve_types.h"
#include "DNA_object_types.h"
+#include "DNA_space_types.h" /* for line linked */
#include "BKE_library.h" /* for all_local */
#include "BKE_font.h" /* for text_to_curve */
#include "BKE_utildefines.h"
@@ -309,27 +310,29 @@ PyObject *M_Library_Load( PyObject * self, PyObject * args )
char *base = NULL;
int update = 1;
int blocktype = 0;
+ int linked = 0;
if( !bpy_openlib ) {
return EXPP_ReturnPyObjError( PyExc_IOError,
"no library file: you need to open one, first." );
}
- if( !PyArg_ParseTuple( args, "ss|i", &name, &base, &update ) ) {
+ if( !PyArg_ParseTuple( args, "ss|ii", &name, &base, &update, &linked ) ) {
return EXPP_ReturnPyObjError( PyExc_TypeError,
"expected two strings as arguments." );
}
blocktype = ( int ) BLO_idcode_from_name( base );
- if( !blocktype ) {
+ if( !blocktype )
return EXPP_ReturnPyObjError( PyExc_NameError,
"no such Blender datablock type" );
- }
-
- BLO_script_library_append( bpy_openlib, bpy_openlibname, name,
- blocktype );
-
+
+ if (linked)
+ BLO_script_library_append( bpy_openlib, bpy_openlibname, name, blocktype, FILE_LINK);
+ else
+ BLO_script_library_append( bpy_openlib, bpy_openlibname, name, blocktype, 0);
+
if( update ) {
M_Library_Update( self );
Py_DECREF( Py_None ); /* incref'ed by above function */