[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23158] trunk/blender: 2.5 filebrowser

Andrea Weikert elubie at gmx.net
Sat Sep 12 21:54:39 CEST 2009


Revision: 23158
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23158
Author:   elubie
Date:     2009-09-12 21:54:39 +0200 (Sat, 12 Sep 2009)

Log Message:
-----------
2.5 filebrowser
Appending and Linking 
* Linking Operator, invokes filebrowser for Append/Link
* Separated the append/link function into three parts:
** BLO_library_append_begin finds main for appending
** BLO_library_append_named_part appends one Object,Group, Material, ...
** BLO_library_append_end actually reads and expands the libraries

NOTE 1:
I also changed the returned properties for the filebrowser operators to the following convention:
"path" - the full path to a file or directory, means what is in directory + filename buttons in filebrowser
"directory" - the content of the directory button in filebrowser
"filename" - the content of the filename button in filebrowser
Usually only path should be required, but in some cases it might be more convenient to retrieve the parts separately.

Ton, Brecht: If you have time to take a look, let me know if anything needs to be fixed.

Modified Paths:
--------------
    trunk/blender/projectfiles_vc9/blender/loader/BLO_loader.vcproj
    trunk/blender/release/io/export_ply.py
    trunk/blender/release/ui/space_info.py
    trunk/blender/source/blender/blenkernel/BKE_library.h
    trunk/blender/source/blender/blenkernel/intern/library.c
    trunk/blender/source/blender/blenloader/BLO_readfile.h
    trunk/blender/source/blender/blenloader/intern/readfile.c
    trunk/blender/source/blender/editors/curve/editfont.c
    trunk/blender/source/blender/editors/screen/screendump.c
    trunk/blender/source/blender/editors/sound/sound_ops.c
    trunk/blender/source/blender/editors/space_buttons/buttons_ops.c
    trunk/blender/source/blender/editors/space_file/file_ops.c
    trunk/blender/source/blender/editors/space_file/file_panels.c
    trunk/blender/source/blender/editors/space_file/filelist.c
    trunk/blender/source/blender/editors/space_file/filelist.h
    trunk/blender/source/blender/editors/space_file/filesel.c
    trunk/blender/source/blender/editors/space_file/space_file.c
    trunk/blender/source/blender/editors/space_image/image_ops.c
    trunk/blender/source/blender/editors/space_info/info_ops.c
    trunk/blender/source/blender/editors/space_script/script_edit.c
    trunk/blender/source/blender/editors/space_script/script_ops.c
    trunk/blender/source/blender/editors/space_sequencer/sequencer_add.c
    trunk/blender/source/blender/editors/space_text/text_ops.c
    trunk/blender/source/blender/makesdna/DNA_space_types.h
    trunk/blender/source/blender/makesrna/RNA_define.h
    trunk/blender/source/blender/makesrna/RNA_types.h
    trunk/blender/source/blender/makesrna/intern/rna_define.c
    trunk/blender/source/blender/windowmanager/WM_api.h
    trunk/blender/source/blender/windowmanager/intern/wm_event_system.c
    trunk/blender/source/blender/windowmanager/intern/wm_operators.c

Modified: trunk/blender/projectfiles_vc9/blender/loader/BLO_loader.vcproj
===================================================================
--- trunk/blender/projectfiles_vc9/blender/loader/BLO_loader.vcproj	2009-09-12 19:11:34 UTC (rev 23157)
+++ trunk/blender/projectfiles_vc9/blender/loader/BLO_loader.vcproj	2009-09-12 19:54:39 UTC (rev 23158)
@@ -470,123 +470,6 @@
 	</References>
 	<Files>
 		<Filter
-			Name="Source Files"
-			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-			>
-			<File
-				RelativePath="..\..\..\source\blender\blenloader\intern\readblenentry.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\source\blender\blenloader\intern\readfile.c"
-				>
-				<FileConfiguration
-					Name="Blender Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="3D Plugin Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="3D Plugin Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Blender Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="BlenderPlayer Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="BlenderPlayer Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\..\source\blender\blenloader\intern\undofile.c"
-				>
-			</File>
-			<File
-				RelativePath="..\..\..\source\blender\blenloader\intern\writefile.c"
-				>
-				<FileConfiguration
-					Name="Blender Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="3D Plugin Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="3D Plugin Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Blender Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="BlenderPlayer Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="BlenderPlayer Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-					/>
-				</FileConfiguration>
-			</File>
-		</Filter>
-		<Filter
 			Name="Header Files"
 			Filter="h;hpp;hxx;hm;inl"
 			>
@@ -606,6 +489,123 @@
 				RelativePath="..\..\..\source\blender\blenloader\BLO_undofile.h"
 				>
 			</File>
+			<Filter
+				Name="Source Files"
+				Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+				>
+				<File
+					RelativePath="..\..\..\source\blender\blenloader\intern\readblenentry.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\source\blender\blenloader\intern\readfile.c"
+					>
+					<FileConfiguration
+						Name="Blender Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							AdditionalIncludeDirectories=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="3D Plugin Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							AdditionalIncludeDirectories=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="3D Plugin Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							AdditionalIncludeDirectories=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Blender Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							AdditionalIncludeDirectories=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="BlenderPlayer Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							AdditionalIncludeDirectories=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="BlenderPlayer Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							AdditionalIncludeDirectories=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="..\..\..\source\blender\blenloader\intern\undofile.c"
+					>
+				</File>
+				<File
+					RelativePath="..\..\..\source\blender\blenloader\intern\writefile.c"
+					>
+					<FileConfiguration
+						Name="Blender Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							AdditionalIncludeDirectories=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="3D Plugin Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							AdditionalIncludeDirectories=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="3D Plugin Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							AdditionalIncludeDirectories=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Blender Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							AdditionalIncludeDirectories=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="BlenderPlayer Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							AdditionalIncludeDirectories=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="BlenderPlayer Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							AdditionalIncludeDirectories=""
+						/>
+					</FileConfiguration>
+				</File>
+			</Filter>
 		</Filter>
 	</Files>
 	<Globals>

Modified: trunk/blender/release/io/export_ply.py
===================================================================
--- trunk/blender/release/io/export_ply.py	2009-09-12 19:11:34 UTC (rev 23157)
+++ trunk/blender/release/io/export_ply.py	2009-09-12 19:54:39 UTC (rev 23158)
@@ -242,7 +242,7 @@
 	# to the class instance from the operator settings before calling.
 	
 	__props__ = [
-		bpy.props.StringProperty(attr="filename", name="File Name", description="File name used for exporting the PLY file", maxlen= 1024, default= ""),
+		bpy.props.StringProperty(attr="path", name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= ""),
 		bpy.props.BoolProperty(attr="use_modifiers", name="Apply Modifiers", description="Apply Modifiers to the exported mesh", default= True),
 		bpy.props.BoolProperty(attr="use_normals", name="Export Normals", description="Export Normals for smooth and hard shaded faces", default= True),
 		bpy.props.BoolProperty(attr="use_uvs", name="Export UVs", description="Exort the active UV layer", default= True),

Modified: trunk/blender/release/ui/space_info.py
===================================================================
--- trunk/blender/release/ui/space_info.py	2009-09-12 19:11:34 UTC (rev 23157)
+++ trunk/blender/release/ui/space_info.py	2009-09-12 19:54:39 UTC (rev 23158)
@@ -60,6 +60,9 @@
 		layout.itemO("screen.userpref_show", text="User Preferences...")
 
 		layout.itemS()
+		layout.operator_context = "INVOKE_AREA"
+		layout.itemO("wm.link_append", text="Append or Link")
+		layout.itemS()
 
 		layout.itemM("INFO_MT_file_import")
 		layout.itemM("INFO_MT_file_export")

Modified: trunk/blender/source/blender/blenkernel/BKE_library.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_library.h	2009-09-12 19:11:34 UTC (rev 23157)
+++ trunk/blender/source/blender/blenkernel/BKE_library.h	2009-09-12 19:54:39 UTC (rev 23158)
@@ -77,6 +77,7 @@
 
 void flag_listbase_ids(ListBase *lb, short flag, short value);
 void flag_all_listbases_ids(short flag, short value);
+void recalc_all_library_objects(struct Main *main);
 
 void set_free_windowmanager_cb(void (*func)(struct bContext *, struct wmWindowManager *) );
 

Modified: trunk/blender/source/blender/blenkernel/intern/library.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/library.c	2009-09-12 19:11:34 UTC (rev 23157)
+++ trunk/blender/source/blender/blenkernel/intern/library.c	2009-09-12 19:54:39 UTC (rev 23158)
@@ -455,6 +455,17 @@
 	while(a--)	flag_listbase_ids(lbarray[a], flag, value);
 }
 
+void recalc_all_library_objects(struct Main *main)
+{
+	/* DISPLISTS? */
+	Object *ob= main->object.first;
+	while(ob) {
+		if(ob->id.lib) {
+			ob->recalc |= OB_RECALC;
+		}
+		ob= ob->id.next;
+	}
+}
 
 /* note: MAX_LIBARRAY define should match this code */
 int set_listbasepointers(Main *main, ListBase **lb)

Modified: trunk/blender/source/blender/blenloader/BLO_readfile.h
===================================================================
--- trunk/blender/source/blender/blenloader/BLO_readfile.h	2009-09-12 19:11:34 UTC (rev 23157)
+++ trunk/blender/source/blender/blenloader/BLO_readfile.h	2009-09-12 19:54:39 UTC (rev 23158)
@@ -36,7 +36,6 @@
 
 struct bScreen;
 struct direntry;
-struct FileList;
 struct LinkNode;
 struct Main;
 struct MemFile;
@@ -45,6 +44,7 @@
 struct SpaceFile;
 struct SpaceImaSel;
 struct UserDef;
+struct bContext;
 
 typedef struct BlendHandle	BlendHandle;
 
@@ -197,12 +197,23 @@
 	
 	/***/
 
-char *BLO_gethome(void);
+#define GROUP_MAX 32
+
 int BLO_has_bfile_extension(char *str);
 
-void BLO_library_append(BlendHandle **libfiledata, struct direntry* filelist, int totfile, 
-						 char *dir, char* file, short flag, int idcode, struct Main *mainvar, struct Scene *scene, struct ReportList *reports);
+/* return ok when a blenderfile, in dir is the filename,
+ * in group the type of libdata
+ */
+int BLO_is_a_library(char *path, char *dir, char *group);
+
+struct Main* BLO_library_append_begin(const struct bContext *C, BlendHandle** bh, char *dir);
+void BLO_library_append_named_part(const struct bContext *C, struct Main *mainl, BlendHandle** bh, char *name, int idcode, short flag);

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list