[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15150] branches/apricot/source: svn merge -r15143:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/ blender/
Campbell Barton
ideasman42 at gmail.com
Sat Jun 7 19:39:09 CEST 2008
Revision: 15150
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15150
Author: campbellbarton
Date: 2008-06-07 19:39:01 +0200 (Sat, 07 Jun 2008)
Log Message:
-----------
svn merge -r15143:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/blender/
Modified Paths:
--------------
branches/apricot/source/blender/blenlib/intern/bpath.c
branches/apricot/source/blender/python/api2_2x/Blender.c
branches/apricot/source/blender/python/api2_2x/Object.c
branches/apricot/source/blender/python/api2_2x/Particle.c
branches/apricot/source/blender/src/editnode.c
branches/apricot/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
Modified: branches/apricot/source/blender/blenlib/intern/bpath.c
===================================================================
--- branches/apricot/source/blender/blenlib/intern/bpath.c 2008-06-07 15:06:00 UTC (rev 15149)
+++ branches/apricot/source/blender/blenlib/intern/bpath.c 2008-06-07 17:39:01 UTC (rev 15150)
@@ -456,13 +456,10 @@
/* be sure there is low chance of the path being too short */
char filepath_expanded[FILE_MAXDIR*2];
- char *libpath;
int files_missing = 0;
BLI_bpathIterator_init(&bpi);
while (!BLI_bpathIterator_isDone(&bpi)) {
- libpath = BLI_bpathIterator_getLib(&bpi);
-
BLI_bpathIterator_getPathExpanded( &bpi, filepath_expanded );
if (!BLI_exists(filepath_expanded)) {
Modified: branches/apricot/source/blender/python/api2_2x/Blender.c
===================================================================
--- branches/apricot/source/blender/python/api2_2x/Blender.c 2008-06-07 15:06:00 UTC (rev 15149)
+++ branches/apricot/source/blender/python/api2_2x/Blender.c 2008-06-07 17:39:01 UTC (rev 15150)
@@ -936,6 +936,7 @@
PyObject *list = PyList_New(0), *st; /* stupidly big string to be safe */
/* be sure there is low chance of the path being too short */
char filepath_expanded[FILE_MAXDIR*2];
+ char *lib;
int absolute = 0;
static char *kwlist[] = {"absolute", NULL};
@@ -952,7 +953,12 @@
if (absolute) {
BLI_bpathIterator_getPathExpanded( &bpi, filepath_expanded );
} else {
- BLI_bpathIterator_getPath( &bpi, filepath_expanded );
+ lib = BLI_bpathIterator_getLib( &bpi );
+ if ( lib && ( strcmp(lib, G.sce) ) ) { /* relative path to the library is NOT the same as our blendfile path, return an absolute path */
+ BLI_bpathIterator_getPathExpanded( &bpi, filepath_expanded );
+ } else {
+ BLI_bpathIterator_getPath( &bpi, filepath_expanded );
+ }
}
st = PyString_FromString(filepath_expanded);
Modified: branches/apricot/source/blender/python/api2_2x/Object.c
===================================================================
--- branches/apricot/source/blender/python/api2_2x/Object.c 2008-06-07 15:06:00 UTC (rev 15149)
+++ branches/apricot/source/blender/python/api2_2x/Object.c 2008-06-07 17:39:01 UTC (rev 15150)
@@ -1056,10 +1056,12 @@
/* fixme: for(;;) */
current = ParticleSys_CreatePyObject( blparticlesys, ob );
PyList_Append(partsyslist,current);
+ Py_DECREF(current);
while((blparticlesys = blparticlesys->next)){
current = ParticleSys_CreatePyObject( blparticlesys, ob );
PyList_Append(partsyslist,current);
+ Py_DECREF(current);
}
return partsyslist;
Modified: branches/apricot/source/blender/python/api2_2x/Particle.c
===================================================================
--- branches/apricot/source/blender/python/api2_2x/Particle.c 2008-06-07 15:06:00 UTC (rev 15149)
+++ branches/apricot/source/blender/python/api2_2x/Particle.c 2008-06-07 17:39:01 UTC (rev 15150)
@@ -854,7 +854,7 @@
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
"Couldn't append item to PyList" );
}
-
+ Py_DECREF(loc); /* PyList_Append increfs */
path++;
}
@@ -864,6 +864,7 @@
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
"Couldn't append item to PyList" );
}
+ Py_DECREF(seglist); /* PyList_Append increfs */
}
cache=psys->childcache;
@@ -885,7 +886,7 @@
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
"Couldn't append item to PyList" );
}
-
+ Py_DECREF(loc);/* PyList_Append increfs */
path++;
}
@@ -895,6 +896,7 @@
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
"Couldn't append item to PyList" );
}
+ Py_DECREF(seglist); /* PyList_Append increfs */
}
} else {
@@ -933,6 +935,7 @@
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
"Couldn't append item to PyList" );
}
+ Py_DECREF(loc);/* PyList_Append increfs */
}
else {
if ( all ){
@@ -941,6 +944,7 @@
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
"Couldn't append item to PyList" );
}
+ Py_DECREF(Py_None); /* PyList_Append increfs */
}
}
}
@@ -985,6 +989,7 @@
if(psys_get_particle_state(ob,psys,i,&state,0)==0){
if ( all ){
PyList_Append(partlist,Py_None);
+ Py_DECREF(Py_None); /* PyList_Append increfs */
continue;
} else {
continue;
@@ -1001,6 +1006,7 @@
if (id)
PyTuple_SetItem(loc,4,PyInt_FromLong(i));
PyList_Append(partlist,loc);
+ Py_DECREF(loc); /* PyList_Append increfs */
}
}
return partlist;
@@ -1060,9 +1066,11 @@
PyTuple_SetItem(tuple,0,PyFloat_FromDouble((double)size));
PyTuple_SetItem(tuple,1,PyInt_FromLong(i));
PyList_Append(partlist,tuple);
+ Py_DECREF(tuple);
} else {
siz = PyFloat_FromDouble((double)size);
PyList_Append(partlist,siz);
+ Py_DECREF(siz);
}
}
}
@@ -1125,9 +1133,11 @@
PyTuple_SetItem(tuple,0,PyFloat_FromDouble((double)life));
PyTuple_SetItem(tuple,1,PyInt_FromLong(i));
PyList_Append(partlist,tuple);
+ Py_DECREF(tuple);
} else {
lif = PyFloat_FromDouble((double)life);
PyList_Append(partlist,lif);
+ Py_DECREF(lif);
}
}
}
Modified: branches/apricot/source/blender/src/editnode.c
===================================================================
--- branches/apricot/source/blender/src/editnode.c 2008-06-07 15:06:00 UTC (rev 15149)
+++ branches/apricot/source/blender/src/editnode.c 2008-06-07 17:39:01 UTC (rev 15150)
@@ -2382,14 +2382,14 @@
}
else {
- if(G.qual & LR_CTRLKEY) {
- gesture();
- } else {
- if(node_add_link(snode)==0)
- if(node_mouse_groupheader(snode)==0)
- if(node_mouse_select(snode, event)==0)
- node_border_link_delete(snode);
- }
+ if(G.qual & LR_CTRLKEY)
+ if(gesture())
+ break;
+
+ if(node_add_link(snode)==0)
+ if(node_mouse_groupheader(snode)==0)
+ if(node_mouse_select(snode, event)==0)
+ node_border_link_delete(snode);
}
break;
Modified: branches/apricot/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
===================================================================
--- branches/apricot/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp 2008-06-07 15:06:00 UTC (rev 15149)
+++ branches/apricot/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp 2008-06-07 17:39:01 UTC (rev 15150)
@@ -1,350 +1,351 @@
-/**
- * ***** 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. The Blender
- * Foundation also sells licenses for use in proprietary software under
- * the Blender License. See http://www.blender.org/BL/ for information
- * about this.
- *
- * 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.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#define STRINGIFY(A) #A
-
-#include "RAS_OpenGLFilters/RAS_Blur2DFilter.h"
-#include "RAS_OpenGLFilters/RAS_Sharpen2DFilter.h"
-#include "RAS_OpenGLFilters/RAS_Dilation2DFilter.h"
-#include "RAS_OpenGLFilters/RAS_Erosion2DFilter.h"
-#include "RAS_OpenGLFilters/RAS_Laplacian2DFilter.h"
-#include "RAS_OpenGLFilters/RAS_Sobel2DFilter.h"
-#include "RAS_OpenGLFilters/RAS_Prewitt2DFilter.h"
-#include "RAS_OpenGLFilters/RAS_GrayScale2DFilter.h"
-#include "RAS_OpenGLFilters/RAS_Sepia2DFilter.h"
-#include "RAS_OpenGLFilters/RAS_Invert2DFilter.h"
-
-#include "STR_String.h"
-#include "RAS_ICanvas.h"
-#include "RAS_2DFilterManager.h"
-#include <iostream>
-
-#ifdef WIN32
-// OpenGL gl.h needs 'windows.h' on windows platforms
-#include <windows.h>
-#endif //WIN32
-#ifdef __APPLE__
-#define GL_GLEXT_LEGACY 1
-#include <OpenGL/gl.h>
-#else
-#include <GL/gl.h>
-#endif
-
-#include "RAS_OpenGLRasterizer/RAS_GLExtensionManager.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-
-RAS_2DFilterManager::RAS_2DFilterManager():
-texturewidth(-1), textureheight(-1),
-canvaswidth(-1), canvasheight(-1),
-numberoffilters(0),texname(-1)
-{
- isshadersupported = bgl::QueryVersion(2,0);
- if(!isshadersupported)
- {
- std::cout<<"shaders not supported!" << std::endl;
- return;
- }
-
- int passindex;
- for(passindex =0; passindex<MAX_RENDER_PASS; passindex++)
- {
- m_filters[passindex] = 0;
- m_enabled[passindex] = 0;
- }
-
-}
-
-RAS_2DFilterManager::~RAS_2DFilterManager()
-{
-}
-
-unsigned int RAS_2DFilterManager::CreateShaderProgram(char* shadersource)
-{
- GLuint program = 0;
-#if defined(GL_ARB_shader_objects) && defined(WITH_GLEXT)
- GLuint fShader = bgl::blCreateShaderObjectARB(GL_FRAGMENT_SHADER);
- GLint success;
-
- bgl::blShaderSourceARB(fShader, 1, (const char**)&shadersource, NULL);
-
- bgl::blCompileShaderARB(fShader);
-
- bgl::blGetObjectParameterivARB(fShader, GL_COMPILE_STATUS, &success);
- if(!success)
- {
- /*Shader Comile Error*/
- std::cout << "2dFilters - Shader compile error" << std::endl;
- return 0;
- }
-
- program = bgl::blCreateProgramObjectARB();
- bgl::blAttachObjectARB(program, fShader);
-
- bgl::blLinkProgramARB(program);
- bgl::blGetObjectParameterivARB(program, GL_LINK_STATUS, &success);
- if (!success)
- {
- /*Program Link Error*/
- std::cout << "2dFilters - Shader program link error" << std::endl;
- return 0;
- }
-
- bgl::blValidateProgramARB(program);
- bgl::blGetObjectParameterivARB(program, GL_VALIDATE_STATUS, &success);
- if (!success)
- {
- /*Program Validation Error*/
- std::cout << "2dFilters - Shader program validation error" << std::endl;
- return 0;
- }
-#endif
- return program;
-}
-
-unsigned int RAS_2DFilterManager::CreateShaderProgram(int filtermode)
-{
- switch(filtermode)
- {
- case RAS_2DFILTER_BLUR:
- return CreateShaderProgram(BlurFragmentShader);
- case RAS_2DFILTER_SHARPEN:
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list