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:
authorTon Roosendaal <ton@blender.org>2005-12-04 20:22:36 +0300
committerTon Roosendaal <ton@blender.org>2005-12-04 20:22:36 +0300
commit1efe0a72329fbb170df805eb917fcbc49f0138ad (patch)
tree47b1d99b46bc4c96d5c9fbe8a79a266e449edbe0
parent1b7089a306566681969ac52fe27468f4d329143a (diff)
parent409f60d605c36c9f79a18f69fdacad268adc0c98 (diff)
Sunday sync of Orange with bf-blender
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c9
-rw-r--r--source/blender/blenkernel/intern/blender.c2
-rw-r--r--source/blender/imbuf/intern/dynlibtiff.c10
-rwxr-xr-xsource/blender/imbuf/intern/gen_dynlibtiff.py19
-rw-r--r--source/blender/imbuf/intern/tiff.c19
-rw-r--r--source/blender/imbuf/readme.txt5
-rw-r--r--source/blender/python/api2_2x/Bone.h2
-rw-r--r--source/blender/python/api2_2x/doc/API_related.py4
-rw-r--r--source/blender/python/api2_2x/doc/Curve.py62
-rw-r--r--source/blender/src/fluidsim.c13
-rw-r--r--source/blender/src/renderwin.c6
11 files changed, 109 insertions, 42 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 2b7ea1e880a..04c4d180927 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -1511,7 +1511,14 @@ static void mesh_calc_modifiers(Object *ob, float (*inputVertexCos)[3], DerivedM
*/
if (deform_r) *deform_r = getMeshDerivedMesh(me, ob, deformedVerts);
} else {
- deformedVerts = inputVertexCos;
+ if(!fluidsimMeshUsed) {
+ // default behaviour for meshes
+ deformedVerts = inputVertexCos;
+ } else {
+ // the fluid sim mesh might have more vertices than the original
+ // one, so inputVertexCos shouldnt be used
+ deformedVerts = mesh_getVertexCos(me, &numVerts);
+ }
}
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index 16ed62d9222..ed9da72c702 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -196,8 +196,8 @@ void initglobals(void)
{
memset(&G, 0, sizeof(Global));
+ memset(&theEditMesh, 0, sizeof(theEditMesh));
G.editMesh = &theEditMesh;
- memset(G.editMesh, 0, sizeof(G.editMesh));
U.savetime= 1;
diff --git a/source/blender/imbuf/intern/dynlibtiff.c b/source/blender/imbuf/intern/dynlibtiff.c
index 7472764b7df..cdcb995bcff 100644
--- a/source/blender/imbuf/intern/dynlibtiff.c
+++ b/source/blender/imbuf/intern/dynlibtiff.c
@@ -76,8 +76,9 @@ void libtiff_loadlibtiff(void)
char *filename;
libtiff = NULL;
-#ifndef __APPLE__ /* no standard location of libtiff in MacOS X */
- /* declare env var if you want to use that */
+ filename = getenv("BF_TIFF_LIB");
+ if (filename) libtiff = PIL_dynlib_open(filename);
+ if (libtiff != NULL) return;
/* Try to find libtiff in a couple of standard places */
libtiff = PIL_dynlib_open("libtiff.so");
@@ -93,12 +94,7 @@ void libtiff_loadlibtiff(void)
if (libtiff != NULL) return;
/* For solaris */
libtiff = PIL_dynlib_open("/usr/openwin/lib/libtiff.so");
- if (libtiff != NULL) return;
-
-#endif
- filename = getenv("BF_TIFF_LIB");
- if (filename) libtiff = PIL_dynlib_open(filename);
}
void *libtiff_findsymbol(char *name)
diff --git a/source/blender/imbuf/intern/gen_dynlibtiff.py b/source/blender/imbuf/intern/gen_dynlibtiff.py
index 70bda45f214..1ee0275854a 100755
--- a/source/blender/imbuf/intern/gen_dynlibtiff.py
+++ b/source/blender/imbuf/intern/gen_dynlibtiff.py
@@ -104,20 +104,24 @@ C_EXTRA = \
* LOCAL DEFINITIONS *
*********************/
PILdynlib *libtiff = NULL;
-void libtiff_loadlibtiff();
+void libtiff_loadlibtiff(void);
void* libtiff_findsymbol(char*);
-int libtiff_load_symbols();
+int libtiff_load_symbols(void);
/**************************
* LIBRARY INITIALIZATION *
**************************/
-void libtiff_loadlibtiff()
+void libtiff_loadlibtiff(void)
{
char *filename;
libtiff = NULL;
+ filename = getenv("BF_TIFF_LIB");
+ if (filename) libtiff = PIL_dynlib_open(filename);
+ if (libtiff != NULL) return;
+
/* Try to find libtiff in a couple of standard places */
libtiff = PIL_dynlib_open("libtiff.so");
if (libtiff != NULL) return;
@@ -132,10 +136,7 @@ void libtiff_loadlibtiff()
if (libtiff != NULL) return;
/* For solaris */
libtiff = PIL_dynlib_open("/usr/openwin/lib/libtiff.so");
- if (libtiff != NULL) return;
- filename = getenv("BF_TIFF_LIB");
- if (filename) libtiff = PIL_dynlib_open(filename);
}
void *libtiff_findsymbol(char *name)
@@ -153,7 +154,7 @@ void *libtiff_findsymbol(char *name)
return symbol;
}
-void libtiff_init()
+void libtiff_init(void)
{
if (libtiff != NULL) {
printf("libtiff_init: Attempted to load libtiff twice!\\n");
@@ -163,7 +164,7 @@ void libtiff_init()
G.have_libtiff = ((libtiff != NULL) && (libtiff_load_symbols()));
}
-void libtiff_exit()
+void libtiff_exit(void)
{
if (libtiff != NULL) {
PIL_dynlib_close(libtiff);
@@ -220,7 +221,7 @@ def outputDynCFile(outfile, header_file_name):
outfile.write(COMMENT)
outfile.write('#include "%s"\n' % header_file_name)
outfile.write(C_EXTRA)
- outfile.write('int libtiff_load_symbols()\n')
+ outfile.write('int libtiff_load_symbols(void)\n')
outfile.write('{\n')
for function in tiff_functions:
outfile.write(function.getLoadSymbol())
diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c
index 9f5ecf18dd9..5b86a2c2dfa 100644
--- a/source/blender/imbuf/intern/tiff.c
+++ b/source/blender/imbuf/intern/tiff.c
@@ -49,6 +49,8 @@
#include "imbuf.h"
#include "imbuf_patch.h"
+#include "BKE_global.h"
+
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
@@ -69,6 +71,10 @@ tsize_t imb_tiff_WriteProc(thandle_t handle, tdata_t data, tsize_t n);
toff_t imb_tiff_SeekProc(thandle_t handle, toff_t ofs, int whence);
int imb_tiff_CloseProc(thandle_t handle);
toff_t imb_tiff_SizeProc(thandle_t handle);
+int imb_tiff_DummyMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize);
+void imb_tiff_DummyUnmapProc(thandle_t fd, tdata_t base, toff_t size);
+
+
/* Structure for in-memory TIFF file. */
struct ImbTIFFMemFile {
unsigned char *mem; /* Location of first byte of TIFF file. */
@@ -84,6 +90,14 @@ struct ImbTIFFMemFile {
*****************************/
+void imb_tiff_DummyUnmapProc(thandle_t fd, tdata_t base, toff_t size)
+{
+}
+
+int imb_tiff_DummyMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize)
+{
+ return (0);
+}
/**
* Reads data from an in-memory TIFF file.
@@ -308,8 +322,7 @@ struct ImBuf *imb_loadtiff(unsigned char *mem, int size, int flags)
"r", (thandle_t)(&memFile),
imb_tiff_ReadProc, imb_tiff_WriteProc,
imb_tiff_SeekProc, imb_tiff_CloseProc,
- imb_tiff_SizeProc, (TIFFMapFileProc)NULL,
- (TIFFUnmapFileProc)NULL);
+ imb_tiff_SizeProc, imb_tiff_DummyMapProc, imb_tiff_DummyUnmapProc);
if (image == NULL) {
printf("imb_loadtiff: could not open TIFF IO layer.\n");
return NULL;
@@ -382,6 +395,8 @@ struct ImBuf *imb_loadtiff(unsigned char *mem, int size, int flags)
/* close the client layer interface to the in-memory file */
libtiff_TIFFClose(image);
+ if (G.order == B_ENDIAN) IMB_convert_rgba_to_abgr(ibuf->x*ibuf->y, ibuf->rect);
+
/* return successfully */
return (ibuf);
}
diff --git a/source/blender/imbuf/readme.txt b/source/blender/imbuf/readme.txt
index 8f04eec9131..181d5485310 100644
--- a/source/blender/imbuf/readme.txt
+++ b/source/blender/imbuf/readme.txt
@@ -30,7 +30,10 @@ source/blender/src/toets.c
source/blender/src/writeimage.c
Step 5:
-edit blender/source/blender/imbuf/intern/util.c
+edit the following files:
+blender/source/blender/imbuf/intern/util.c
+blender/source/blender/src/filesel.c
+blender/source/blender/src/screendump.c
and add your extension so that your format gets recognized in the thumbnails.
Step 6:
diff --git a/source/blender/python/api2_2x/Bone.h b/source/blender/python/api2_2x/Bone.h
index bcc0685a9df..e534ad65d9a 100644
--- a/source/blender/python/api2_2x/Bone.h
+++ b/source/blender/python/api2_2x/Bone.h
@@ -141,4 +141,4 @@ int updateBoneData( BPy_Bone * self, Bone * parent );
#endif
-*/ \ No newline at end of file
+*/
diff --git a/source/blender/python/api2_2x/doc/API_related.py b/source/blender/python/api2_2x/doc/API_related.py
index ee575463543..9050ed0f715 100644
--- a/source/blender/python/api2_2x/doc/API_related.py
+++ b/source/blender/python/api2_2x/doc/API_related.py
@@ -228,9 +228,9 @@ Introduction:
evt = Blender.event
return_it = False
- if evt == DRAW.LEFTMOUSE:
+ if evt == Draw.LEFTMOUSE:
print "Swallowing the left mouse button press"
- elif evt == DRAW.AKEY:
+ elif evt == Draw.AKEY:
print "Swallowing an 'a' character"
else:
print "Let the 3D View itself process this event:", evt
diff --git a/source/blender/python/api2_2x/doc/Curve.py b/source/blender/python/api2_2x/doc/Curve.py
index 91396a2eccf..0662d22957d 100644
--- a/source/blender/python/api2_2x/doc/Curve.py
+++ b/source/blender/python/api2_2x/doc/Curve.py
@@ -12,7 +12,9 @@ A Blender Curve can consist of multiple curves. Try converting a Text object to
type Bezier or Nurb. The underlying curves can be accessed with
the [] operator. Operator [] returns an object of type CurNurb.
-The Curve module also supports the Python iterator interface. This means you can access the curves in a Curve or the control points in a CurNurb using a python for statement.
+The Curve module also supports the Python iterator interface. This means you
+can access the curves in a Curve and the control points in a CurNurb using a
+Python B{for} statement.
Add a Curve to a Scene Example::
@@ -61,20 +63,34 @@ class Curve:
This object gives access to Curve-specific data in Blender.
@ivar name: The Curve Data name.
+ @type name: string
@ivar pathlen: The Curve Data path length.
+ @type pathlen: int
@ivar totcol: The Curve Data maximal number of linked materials.
- @ivar flag: The Curve Data flag value; see function getFlag for the semantics.
+ @type totcol: int
+ @ivar flag: The Curve Data flag value; see L{getFlag()} for the semantics.
@ivar bevresol: The Curve Data bevel resolution.
+ @type bevresol: float
@ivar resolu: The Curve Data U-resolution.
+ @type resolu: float
@ivar resolv: The Curve Data V-resolution.
+ @type resolv: float
@ivar width: The Curve Data width.
+ @type width: float
@ivar ext1: The Curve Data extent 1(for bevels).
+ @type ext1: float
@ivar ext2: The Curve Data extent2 (for bevels).
+ @type ext2: float
@ivar loc: The Curve Data location(from the center).
+ @type loc: list of 3 floats
@ivar rot: The Curve Data rotation(from the center).
+ @type rot: list of 3 floats
@ivar size: The Curve Data size(from the center).
+ @type size: list of 3 floats
@ivar bevob: The Curve Bevel Object
- @cvar key: The L{Key.Key} object associated with this Curve, if any.
+ @type bevob: Blender L{Object<Object.Object>} or PyNone
+ @ivar key: The Key object associated with this Curve, if any.
+ @type key: Blender L{Key<Key.Key>}
"""
def getName():
@@ -228,13 +244,22 @@ class Curve:
def getControlPoint(numcurve,numpoint):
"""
- Get the curve's control point value. The numpoint arg is an index into the list of points and starts with 0.
+ Get the curve's control point value (B{deprecated}). The numpoint arg
+ is an index into the list of points and starts with 0. B{Note}: new
+ scripts should use the [] operator on Curves and CurNurbs. Example::
+ curve = Blender.Curve.Get('Curve')
+ p0 = curve[0][0] # get first point from first nurb
+ # -- OR --
+ nurb = curve[0] # get first nurb
+ p0 = nurb[0] # get nurb's first point
+
@type numcurve: int
@type numpoint: int
@rtype: list of floats
@return: depends upon the curve's type.
- type Bezier : a list of nine floats. Values are x, y, z for handle-1, vertex and handle-2
- type Nurb : a list of 4 floats. Values are x, y, z, w.
+
"""
def setControlPoint( numcurve, numpoint, controlpoint):
@@ -252,14 +277,15 @@ class Curve:
def appendPoint( numcurve, new_control_point ):
"""
- add a new control point to the indicated curve.
+ Add a new control point to the indicated curve (B{deprecated}).
+ New scripts should use L{CurNurb.append()}.
@rtype: PyNone
@type numcurve: int
- @type new_control_point: list xyzw or BezTriple
+ @type new_control_point: list of floats or BezTriple
@param numcurve: index for spline in Curve, starting from 0
@param new_control_point: depends on curve's type.
- type Bezier: a BezTriple
- - type Nurb: a list of four floats for the xyzw values
+ - type Nurb: a list of four or five floats for the xyzwt values
@raise AttributeError: throws exception if numcurve is out of range.
"""
@@ -359,7 +385,6 @@ class Curve:
"""
Updates display list for a Curve.
Used after making changes to control points.
-
You B{must} use this if you want to see your changes!
@rtype: PyNone
@return: PyNone
@@ -367,9 +392,11 @@ class Curve:
def isNurb( curve_num ):
"""
- method used to determine whether a CurNurb is of type Bezier or of type Nurb.
+ Tells type of a CurNurb (B{deprecated}).
+ New scripts should use L{CurNurb.isNurb()}.
+
@rtype: integer
- @return: Zero if curve is type Bezier, One if curve is of type Nurb.
+ @return: Zero if curve is type Bezier, one if curve is of type Nurb.
@type curve_num: integer
@param curve_num: zero-based index into list of curves in this Curve.
@raise AttributeError: throws exception if curve_num is out of range.
@@ -377,7 +404,8 @@ class Curve:
def isCyclic( curve_num ):
"""
- Boolean method checks whether the curve is cyclic (closed) or not.
+ Tells whether or not a CurNurb is cyclic (closed) (B{deprecated}).
+ New scripts should use L{CurNurb.isCyclic()}.
@rtype: boolean
@return: True if is cyclic, False if not
@@ -394,7 +422,8 @@ class Curve:
def getNumPoints( curve_num ):
"""
- Get the number of control points in the curve.
+ Get the number of control points in the curve (B{deprecated}).
+ New scripts should use the len operator (I{len(curve)}).
@type curve_num: integer
@param curve_num: zero-based index into list of curves in this Curve
@rtype: integer
@@ -402,9 +431,9 @@ class Curve:
def getKey():
"""
- Return the L{Key.Key} object containing the keyframes for this
+ Return the L{Key<Key.Key>} object containing the keyframes for this
curve, if any.
- @rtype: L{Key.Key} object or None
+ @rtype: L{Key<Key.Key>} object or None
"""
@@ -419,8 +448,11 @@ class CurNurb:
The CurNurb also supports the sequence protocol which means you can access the control points of a CurNurb using the [] operator.
@ivar flagU: The CurNurb knot flag U. See L{setFlagU} for description.
+ @type flagU: int
@ivar flagV: The CurNurb knot flag V. See L{setFlagU} for description.
+ @type flagV: int
@ivar type: The type of the curve (Poly: 0, Bezier: 1, NURBS: 4)
+ @type type: int
"""
def __setitem__( n, point ):
@@ -521,7 +553,7 @@ class CurNurb:
def getType():
"""
- Get the type of the curve
+ Get the type of the curve.
@rtype: integer
@return: 0 - Poly, 1 - Bezier, 4 - NURBS
"""
diff --git a/source/blender/src/fluidsim.c b/source/blender/src/fluidsim.c
index 15dbb2c899a..b73329175b5 100644
--- a/source/blender/src/fluidsim.c
+++ b/source/blender/src/fluidsim.c
@@ -343,9 +343,13 @@ void fluidsimBake(struct Object *ob)
strcpy(targetFile, targetDir);
strcat(targetFile, suffixConfig);
+ // make sure all directories exist
+ // as the bobjs use the same dir, this only needs to be checked
+ // for the cfg output
+ RE_make_existing_file(targetFile);
+
// check selected directory
// simply try to open cfg file for writing to test validity of settings
- ADD_CREATEDFILE(targetFile);
fileCfg = fopen(targetFile, "w");
if(fileCfg) { dirExist = 1; fclose(fileCfg); }
@@ -362,7 +366,7 @@ void fluidsimBake(struct Object *ob)
}
}
// todo... strip .blend ?
- snprintf(newSurfdataPath,FILE_MAXFILE+FILE_MAXDIR,"//%s_%s_", blendFile, fsDomain->id.name);
+ snprintf(newSurfdataPath,FILE_MAXFILE+FILE_MAXDIR,"//fluidsimdata/%s_%s_", blendFile, fsDomain->id.name);
snprintf(debugStrBuffer,256,"fluidsimBake::error - warning resetting output dir to '%s'\n", newSurfdataPath);
elbeemDebugOut(debugStrBuffer);
@@ -391,6 +395,10 @@ void fluidsimBake(struct Object *ob)
// start writing
strcpy(targetFile, targetDir);
strcat(targetFile, suffixConfig);
+ // make sure these directories exist as well
+ if(outStringsChanged) {
+ RE_make_existing_file(targetFile);
+ }
fileCfg = fopen(targetFile, "w");
if(!fileCfg) {
snprintf(debugStrBuffer,256,"fluidsimBake::error - Unable to open file for writing '%s'\n", targetFile);
@@ -399,6 +407,7 @@ void fluidsimBake(struct Object *ob)
pupmenu("Fluidsim Bake Error%t|Unable to output files... Aborted%x0");
return;
}
+ ADD_CREATEDFILE(targetFile);
fprintf(fileCfg, "# Blender ElBeem File , Source %s , Frame %d, to %s \n\n\n", G.sce, -1, targetFile );
// file open -> valid settings -> store
diff --git a/source/blender/src/renderwin.c b/source/blender/src/renderwin.c
index 5483d8e27cf..637c018587d 100644
--- a/source/blender/src/renderwin.c
+++ b/source/blender/src/renderwin.c
@@ -620,7 +620,10 @@ void calc_renderwin_rectangle(int posmask, int renderpos_r[2], int rendersize_r[
rendersize_r[1]*= G.scene->r.yparts;
}
- for (y=-1; y<=1; y++) {
+ rendersize_r[0]= CLAMPIS(rendersize_r[0], 0, scr_w);
+ rendersize_r[1]= CLAMPIS(rendersize_r[1], 0, scr_h-RW_HEADERY);
+
+ for (y=-1; y<=1; y++) {
for (x=-1; x<=1; x++) {
if (posmask & (1<<((y+1)*3 + (x+1)))) {
ndc_x+= x;
@@ -638,6 +641,7 @@ void calc_renderwin_rectangle(int posmask, int renderpos_r[2], int rendersize_r[
renderpos_r[0]= (scr_w-rendersize_r[0])*(ndc_x*0.5 + 0.5);
#ifdef __APPLE__
/* 44 pixels is topbar and window header... awaiting better fixes in ghost :) */
+ rendersize_r[1]= CLAMPIS(rendersize_r[1], 0, scr_h-44-RW_HEADERY);
renderpos_r[1]= -44-RW_HEADERY+(scr_h-rendersize_r[1])*(ndc_y*0.5 + 0.5);
#else
renderpos_r[1]= (scr_h-rendersize_r[1])*(ndc_y*0.5 + 0.5);