[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25288] branches/sculpt25: Sculpt Branch:

Brecht Van Lommel brecht at blender.org
Thu Dec 10 15:26:07 CET 2009


Revision: 25288
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25288
Author:   blendix
Date:     2009-12-10 15:26:06 +0100 (Thu, 10 Dec 2009)

Log Message:
-----------
Sculpt Branch:

Revised external multires file saving. Now it is more manual in that you
have to specify where to save it, like an image file, but still saved at
the same time as the .blend. It would ideally be automatic, but this is
difficult to implement, so for now this should at least be more reliable.

Modified Paths:
--------------
    branches/sculpt25/release/scripts/ui/properties_data_modifier.py
    branches/sculpt25/source/blender/blenkernel/BKE_customdata.h
    branches/sculpt25/source/blender/blenkernel/BKE_utildefines.h
    branches/sculpt25/source/blender/blenkernel/intern/customdata.c
    branches/sculpt25/source/blender/blenkernel/intern/multires.c
    branches/sculpt25/source/blender/blenloader/intern/writefile.c
    branches/sculpt25/source/blender/editors/object/object_intern.h
    branches/sculpt25/source/blender/editors/object/object_modifier.c
    branches/sculpt25/source/blender/editors/object/object_ops.c
    branches/sculpt25/source/blender/editors/space_file/file_draw.c
    branches/sculpt25/source/blender/editors/space_file/filelist.c
    branches/sculpt25/source/blender/editors/space_file/filesel.c
    branches/sculpt25/source/blender/makesdna/DNA_space_types.h
    branches/sculpt25/source/blender/makesrna/intern/rna_modifier.c
    branches/sculpt25/source/blender/windowmanager/intern/wm_operators.c

Added Paths:
-----------
    branches/sculpt25/source/blender/blenkernel/BKE_customdata_file.h
    branches/sculpt25/source/blender/blenkernel/intern/customdata_file.c

Removed Paths:
-------------
    branches/sculpt25/source/blender/blenkernel/BKE_btex.h
    branches/sculpt25/source/blender/blenkernel/intern/btex.c

Modified: branches/sculpt25/release/scripts/ui/properties_data_modifier.py
===================================================================
--- branches/sculpt25/release/scripts/ui/properties_data_modifier.py	2009-12-10 13:45:16 UTC (rev 25287)
+++ branches/sculpt25/release/scripts/ui/properties_data_modifier.py	2009-12-10 14:26:06 UTC (rev 25288)
@@ -438,7 +438,6 @@
         col.prop(md, "levels", text="Preview")
         col.prop(md, "sculpt_levels", text="Sculpt")
         col.prop(md, "render_levels", text="Render")
-        col.prop(md, "optimal_display")
 
         if wide_ui:
             col = split.column()
@@ -446,9 +445,20 @@
         col.enabled = ob.mode != 'EDIT'
         col.operator("object.multires_subdivide", text="Subdivide")
         col.operator("object.multires_higher_levels_delete", text="Delete Higher")
+        col.prop(md, "optimal_display")
+
+        layout.separator()
+
+        col = layout.column()
         row = col.row()
-        row.enabled = md.total_levels > 0
-        row.prop(md, "external")
+        if md.external:
+            row.operator("object.multires_pack_external", text="Pack External")
+            row.label()
+            row = col.row()
+            row.prop(md, "filename", text="")
+        else:
+            row.operator("object.multires_save_external", text="Save External...")
+            row.label()
 
     def PARTICLE_INSTANCE(self, layout, ob, md, wide_ui):
         layout.prop(md, "object")

Deleted: branches/sculpt25/source/blender/blenkernel/BKE_btex.h
===================================================================
--- branches/sculpt25/source/blender/blenkernel/BKE_btex.h	2009-12-10 13:45:16 UTC (rev 25287)
+++ branches/sculpt25/source/blender/blenkernel/BKE_btex.h	2009-12-10 14:26:06 UTC (rev 25288)
@@ -1,64 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BKE_BTEX_H
-#define BKE_BTEX_H
-
-#define BTEX_TYPE_IMAGE	0
-#define BTEX_TYPE_MESH	1
-
-#define BTEX_LAYER_NAME_MAX	64
-
-typedef struct BTex BTex;
-typedef struct BTexLayer BTexLayer;
-
-/* Create/Free */
-
-BTex *btex_create(int type);
-void btex_free(BTex *btex);
-
-/* File read/write/remove */
-
-int btex_read_open(BTex *btex, char *filename);
-int btex_read_layer(BTex *btex, BTexLayer *blay);
-int btex_read_data(BTex *btex, int size, void *data);
-void btex_read_close(BTex *btex);
-
-int btex_write_open(BTex *btex, char *filename);
-int btex_write_layer(BTex *btex, BTexLayer *blay);
-int btex_write_data(BTex *btex, int size, void *data);
-void btex_write_close(BTex *btex);
-
-void btex_remove(char *filename);
-
-/* Layers */
-
-BTexLayer *btex_layer_find(BTex *btex, int type, char *name);
-BTexLayer *btex_layer_add(BTex *btex, int type, char *name);
-void btex_layer_remove(BTex *btex, BTexLayer *blay);
-
-/* Mesh */
-
-void btex_mesh_set_grids(BTex *btex, int totgrid, int gridsize, int datasize);
-
-#endif /* BKE_BTEX_H */
-

Modified: branches/sculpt25/source/blender/blenkernel/BKE_customdata.h
===================================================================
--- branches/sculpt25/source/blender/blenkernel/BKE_customdata.h	2009-12-10 13:45:16 UTC (rev 25287)
+++ branches/sculpt25/source/blender/blenkernel/BKE_customdata.h	2009-12-10 14:26:06 UTC (rev 25288)
@@ -32,6 +32,7 @@
 #ifndef BKE_CUSTOMDATA_H
 #define BKE_CUSTOMDATA_H
 
+struct ID;
 struct CustomData;
 struct CustomDataLayer;
 typedef unsigned int CustomDataMask;
@@ -282,16 +283,15 @@
 /* External file storage */
 
 void CustomData_external_add(struct CustomData *data,
-	int type, const char *name, int totelem);
+	struct ID *id, int type, int totelem, const char *filename);
 void CustomData_external_remove(struct CustomData *data,
-	int type, int totelem);
-void CustomData_external_remove_object(struct CustomData *data);
+	struct ID *id, int type, int totelem);
 int CustomData_external_test(struct CustomData *data, int type);
 
 void CustomData_external_write(struct CustomData *data,
-	CustomDataMask mask, int totelem, int free);
+	struct ID *id, CustomDataMask mask, int totelem, int free);
 void CustomData_external_read(struct CustomData *data,
-	CustomDataMask mask, int totelem);
+	struct ID *id, CustomDataMask mask, int totelem);
 
 #endif
 

Copied: branches/sculpt25/source/blender/blenkernel/BKE_customdata_file.h (from rev 25281, branches/sculpt25/source/blender/blenkernel/BKE_btex.h)
===================================================================
--- branches/sculpt25/source/blender/blenkernel/BKE_customdata_file.h	                        (rev 0)
+++ branches/sculpt25/source/blender/blenkernel/BKE_customdata_file.h	2009-12-10 14:26:06 UTC (rev 25288)
@@ -0,0 +1,59 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef BKE_CUSTOMDATA_FILE_H
+#define BKE_CUSTOMDATA_FILE_H
+
+#define CDF_TYPE_IMAGE	0
+#define CDF_TYPE_MESH	1
+
+#define CDF_LAYER_NAME_MAX	64
+
+typedef struct CDataFile CDataFile;
+typedef struct CDataFileLayer CDataFileLayer;
+
+/* Create/Free */
+
+CDataFile *cdf_create(int type);
+void cdf_free(CDataFile *cdf);
+
+/* File read/write/remove */
+
+int cdf_read_open(CDataFile *cdf, char *filename);
+int cdf_read_layer(CDataFile *cdf, CDataFileLayer *blay);
+int cdf_read_data(CDataFile *cdf, int size, void *data);
+void cdf_read_close(CDataFile *cdf);
+
+int cdf_write_open(CDataFile *cdf, char *filename);
+int cdf_write_layer(CDataFile *cdf, CDataFileLayer *blay);
+int cdf_write_data(CDataFile *cdf, int size, void *data);
+void cdf_write_close(CDataFile *cdf);
+
+void cdf_remove(char *filename);
+
+/* Layers */
+
+CDataFileLayer *cdf_layer_find(CDataFile *cdf, int type, char *name);
+CDataFileLayer *cdf_layer_add(CDataFile *cdf, int type, char *name, size_t datasize);
+
+#endif /* BKE_CUSTOMDATA_FILE_H */
+


Property changes on: branches/sculpt25/source/blender/blenkernel/BKE_customdata_file.h
___________________________________________________________________
Name: svn:mergeinfo
   + 

Modified: branches/sculpt25/source/blender/blenkernel/BKE_utildefines.h
===================================================================
--- branches/sculpt25/source/blender/blenkernel/BKE_utildefines.h	2009-12-10 13:45:16 UTC (rev 25287)
+++ branches/sculpt25/source/blender/blenkernel/BKE_utildefines.h	2009-12-10 14:26:06 UTC (rev 25288)
@@ -168,7 +168,15 @@
 #define ENDB MAKE_ID('E','N','D','B')
 
 
-/* This one rotates the bytes in an int */
+/* This one rotates the bytes in an int64, int (32) and short (16) */
+#define SWITCH_INT64(a) { \
+	char s_i, *p_i; \
+	p_i= (char *)&(a); \
+	s_i=p_i[0]; p_i[0]=p_i[7]; p_i[7]=s_i; \
+	s_i=p_i[1]; p_i[1]=p_i[6]; p_i[6]=s_i; \
+	s_i=p_i[2]; p_i[2]=p_i[5]; p_i[5]=s_i; \
+	s_i=p_i[3]; p_i[3]=p_i[4]; p_i[4]=s_i; }
+
 #define SWITCH_INT(a) { \
 	char s_i, *p_i; \
 	p_i= (char *)&(a); \

Deleted: branches/sculpt25/source/blender/blenkernel/intern/btex.c
===================================================================
--- branches/sculpt25/source/blender/blenkernel/intern/btex.c	2009-12-10 13:45:16 UTC (rev 25287)
+++ branches/sculpt25/source/blender/blenkernel/intern/btex.c	2009-12-10 14:26:06 UTC (rev 25288)
@@ -1,482 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_fileops.h"
-#include "BLI_string.h"
-
-#include "BKE_btex.h"
-#include "BKE_global.h"
-#include "BKE_utildefines.h"
-
-/************************* File Format Definitions ***************************/
-
-#define BTEX_ENDIAN_LITTLE	0
-#define BTEX_ENDIAN_BIG		1
-
-#define BTEX_DATA_FLOAT	0
-
-typedef struct BTexHeader {
-	char ID[4];					/* "BTEX" */
-	char endian;				/* little, big */
-	char version;				/* non-compatible versions */
-	char subversion;			/* compatible sub versions */
-	char pad;					/* padding */
-
-	int structbytes;			/* size of this struct in bytes */
-	int type;					/* image, mesh */
-	int totlayer;				/* number of layers in the file */
-} BTexHeader;
-
-typedef struct BTexImageHeader {
-	int structbytes;			/* size of this struct in bytes */
-	int width;					/* image width */
-	int height;					/* image height */

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list