diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-29 19:02:21 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-29 19:02:21 +0400 |
commit | 7d04e4c53e5cd4888afd4177a9d70a6fc72c8e36 (patch) | |
tree | 9877850d4e9b86a36f787f2f730668617b42a1b4 | |
parent | ec4f6750557218be262cacea53ef4cb0ccaa0671 (diff) | |
parent | feb3dc926a74b51789b100ac9532dc196a4cd9ae (diff) |
svn merge ^/trunk/blender -r47150:47184
85 files changed, 285 insertions, 4949 deletions
diff --git a/SConstruct b/SConstruct index bbf3dff0394..9bc61d7aeb2 100644 --- a/SConstruct +++ b/SConstruct @@ -667,42 +667,6 @@ if env['OURPLATFORM']=='linuxcross': scriptinstall.append(env.Install(dir=dir, source=source)) -#-- plugins -pluglist = [] -plugtargetlist = [] -for tp, tn, tf in os.walk('release/plugins'): - if '.svn' in tn: - tn.remove('.svn') - if '_svn' in tn: - tn.remove('_svn') - df = tp[8:] # remove 'release/' - for f in tf: - pluglist.append(os.path.join(tp, f)) - plugtargetlist.append( os.path.join(env['BF_INSTALLDIR'], VERSION, df, f) ) - - -# header files for plugins -pluglist.append('source/blender/blenpluginapi/documentation.h') -plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'documentation.h')) -pluglist.append('source/blender/blenpluginapi/externdef.h') -plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'externdef.h')) -pluglist.append('source/blender/blenpluginapi/floatpatch.h') -plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'floatpatch.h')) -pluglist.append('source/blender/blenpluginapi/iff.h') -plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'iff.h')) -pluglist.append('source/blender/blenpluginapi/plugin.h') -plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'plugin.h')) -pluglist.append('source/blender/blenpluginapi/util.h') -plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'util.h')) -pluglist.append('source/blender/blenpluginapi/plugin.DEF') -plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'plugin.def')) - -plugininstall = [] -# plugins in blender 2.5 don't work at the moment. -#for targetdir,srcfile in zip(plugtargetlist, pluglist): -# td, tf = os.path.split(targetdir) -# plugininstall.append(env.Install(dir=td, source=srcfile)) - textlist = [] texttargetlist = [] for tp, tn, tf in os.walk('release/text'): @@ -716,11 +680,11 @@ for tp, tn, tf in os.walk('release/text'): textinstall = env.Install(dir=env['BF_INSTALLDIR'], source=textlist) if env['OURPLATFORM']=='darwin': - allinstall = [blenderinstall, plugininstall, textinstall] + allinstall = [blenderinstall, textinstall] elif env['OURPLATFORM']=='linux': - allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall, iconinstall] + allinstall = [blenderinstall, dotblenderinstall, scriptinstall, textinstall, iconinstall] else: - allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall] + allinstall = [blenderinstall, dotblenderinstall, scriptinstall, textinstall] if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'): dllsources = [] diff --git a/build_files/scons/config/win32-vc-config.py b/build_files/scons/config/win32-vc-config.py index 5d52f0e34b6..db30f453228 100644 --- a/build_files/scons/config/win32-vc-config.py +++ b/build_files/scons/config/win32-vc-config.py @@ -165,7 +165,7 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib' #CUDA WITH_BF_CYCLES_CUDA_BINARIES = False #BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler -BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21'] # don't build sm_13 until the compile can fit in 32bit process again :) +BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_13', 'sm_20', 'sm_21', 'sm_30'] #Ray trace optimization WITH_BF_RAYOPTIMIZATION = True diff --git a/build_files/scons/config/win64-vc-config.py b/build_files/scons/config/win64-vc-config.py index 9e36be42329..fe16278dd19 100644 --- a/build_files/scons/config/win64-vc-config.py +++ b/build_files/scons/config/win64-vc-config.py @@ -162,7 +162,7 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib' #CUDA WITH_BF_CYCLES_CUDA_BINARIES = False #BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler -BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_13', 'sm_20', 'sm_21'] +BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_13', 'sm_20', 'sm_21', 'sm_30'] #Ray trace optimization WITH_BF_RAYOPTIMIZATION = True diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index 14d4c2f3ddf..b04e0137e37 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -29,6 +29,7 @@ #include "blender_util.h" #include "util_foreach.h" +#include "util_hash.h" CCL_NAMESPACE_BEGIN @@ -245,17 +246,20 @@ void BlenderSync::sync_object(BL::Object b_parent, int b_index, BL::Object b_ob, /* object sync */ if(object_updated || (object->mesh && object->mesh->need_update)) { object->name = b_ob.name().c_str(); - object->instance_id = b_index; object->pass_id = b_ob.pass_index(); object->tfm = tfm; object->motion.pre = tfm; object->motion.post = tfm; object->use_motion = false; + object->random_id = hash_int_2d(hash_string(object->name.c_str()), b_index); + /* visibility flags for both parent */ object->visibility = object_ray_visibility(b_ob) & PATH_RAY_ALL; - if(b_parent.ptr.data != b_ob.ptr.data) + if(b_parent.ptr.data != b_ob.ptr.data) { object->visibility &= object_ray_visibility(b_parent); + object->random_id ^= hash_int(hash_string(b_parent.name().c_str())); + } /* camera flag is not actually used, instead is tested against render layer flags */ diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp index 68264f36bfb..75cc9115531 100644 --- a/intern/cycles/blender/blender_shader.cpp +++ b/intern/cycles/blender/blender_shader.cpp @@ -117,7 +117,6 @@ static ShaderNode *add_node(BL::BlendData b_data, ShaderGraph *graph, BL::Shader case BL::ShaderNode::type_MATERIAL: break; case BL::ShaderNode::type_MATERIAL_EXT: break; case BL::ShaderNode::type_OUTPUT: break; - case BL::ShaderNode::type_SCRIPT: break; case BL::ShaderNode::type_SQUEEZE: break; case BL::ShaderNode::type_TEXTURE: break; /* handled outside this function */ diff --git a/intern/cycles/render/object.cpp b/intern/cycles/render/object.cpp index e38b2635f90..5c7e48a38eb 100644 --- a/intern/cycles/render/object.cpp +++ b/intern/cycles/render/object.cpp @@ -23,7 +23,6 @@ #include "scene.h" #include "util_foreach.h" -#include "util_hash.h" #include "util_map.h" #include "util_progress.h" @@ -37,7 +36,7 @@ Object::Object() mesh = NULL; tfm = transform_identity(); visibility = ~0; - instance_id = 0; + random_id = 0; pass_id = 0; bounds = BoundBox::empty; motion.pre = transform_identity(); @@ -165,9 +164,7 @@ void ObjectManager::device_update_transforms(Device *device, DeviceScene *dscene float uniform_scale; float surface_area = 0.0f; float pass_id = ob->pass_id; - - uint ob_hash = hash_int_2d(hash_string(ob->name.c_str()), ob->instance_id); - float random_number = (float)ob_hash * (1.0f/(float)0xFFFFFFFF); + float random_number = (float)ob->random_id * (1.0f/(float)0xFFFFFFFF); if(transform_uniform_scale(tfm, uniform_scale)) { map<Mesh*, float>::iterator it = surface_area_map.find(mesh); diff --git a/intern/cycles/render/object.h b/intern/cycles/render/object.h index b8169e3758e..83bf2cf0317 100644 --- a/intern/cycles/render/object.h +++ b/intern/cycles/render/object.h @@ -41,7 +41,7 @@ public: Transform tfm; BoundBox bounds; ustring name; - int instance_id; + int random_id; int pass_id; vector<ParamValue> attributes; uint visibility; diff --git a/release/plugins/Makefile b/release/plugins/Makefile deleted file mode 100644 index 353e559e622..00000000000 --- a/release/plugins/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -# ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 ***** - -all: textures sequences - -textures: - $(MAKE) -C texture - -sequences: - $(MAKE) -C sequence - -clean: - $(MAKE) -C texture clean - $(MAKE) -C sequence clean diff --git a/release/plugins/bmake b/release/plugins/bmake deleted file mode 100644 index e2f9e9cc596..00000000000 --- a/release/plugins/bmake +++ /dev/null @@ -1,141 +0,0 @@ -#!/bin/sh -# -# ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 ***** - -# detect the system - -UNAME=`uname` -EXT="so"; -if ( test "WIN32" = "$TARGET" ) then - CC="gcc"; - CFLAGS="-funsigned-char -O2"; - - LD="ld"; - LDFLAGS="-Bshareable -lm"; -elif ( test $UNAME = "IRIX64" -o $UNAME = "IRIX" ) then - CC="cc"; - CFLAGS="-KPIC -O2 -mips3"; - - LD="ld"; - LDFLAGS="-shared -U"; -elif ( test $UNAME = "FreeBSD" ) then - CC="gcc"; - CFLAGS="-fPIC -funsigned-char -O2"; - - LD="ld"; - LDFLAGS="-Bshareable"; -elif ( test $UNAME = "OpenBSD" ) then - CC="gcc"; - CFLAGS="-fPIC -funsigned-char -O2"; - - LD="ld"; - LDFLAGS="-Bshareable"; -elif ( test $UNAME = "Linux" ) then - CC="gcc"; - CFLAGS="-fPIC -funsigned-char -O2"; - - LD="ld"; - LDFLAGS="-Bshareable"; -elif ( test $UNAME = "SunOS" ) then - CC="cc"; - CFLAGS="-O"; - - LD="ld"; - LDFLAGS="-r"; -elif ( test $UNAME = "Darwin" ) then - CC="cc"; - CFLAGS="-fPIC -funsigned-char -O2 -fno-common"; - LD="cc"; - LDFLAGS="-flat_namespace -bundle -bundle_loader ../../blender.app/Contents/MacOS/blender -lm"; - EXT="so"; -fi - -if ( test "$#" = "1" ) then - if ( test -f $1 ) then - BASE_FILE=`echo $1 | sed -e "1 s/\.c//g"`; - else - BASE_FILE=$1; - fi - - CFILE="$BASE_FILE.c" - OFILE="$BASE_FILE.o" - SOFILE="$BASE_FILE.$EXT" -else - if ( test -f $1$2 ) then - BASE_FILE=`echo $2 | sed -e "1 s/\.c//g"`; - else - BASE_FILE=$2; - fi - - CFILE="$1$BASE_FILE.c" - if (test "$TARGET" = "WIN32" ) then - DLLFILE="$BASE_FILE.dll"; - fi - OFILE="$BASE_FILE.o" - SOFILE="$BASE_FILE.$EXT" -fi - -INCLUDES= -if ( test -f plugin.h ) then - INCLUDES=-I.; -elif ( test -f "include/plugin.h" ) then - INCLUDES=-Iinclude/ -elif ( test -f "../plugin.h" ) then - INCLUDES=-I..; -elif ( test -f "../include/plugin.h" ) then - INCLUDES=-I../include -else - echo "Couldn't find plugin.h"; - exit; -fi - -LIBM=`fgrep "#include <math.h>" $CFILE` -LIBC=`fgrep "#include <std" $CFILE` - -LIBS= - -if ( test -n "$LIBM" ) then - LIBS="$LIBS -lm"; -fi -if ( test -n "$LIBC" ) then - LIBS="$LIBS -lc"; -fi - -echo "$CC $CFLAGS -c $CFILE $INCLUDES" -$CC $CFLAGS -c $CFILE $INCLUDES - -if ( test "$?" != "0") then - echo "Compile error"; - exit; -fi - -echo "$LD $LDFLAGS $OFILE -o $SOFILE $LIBS" -$LD $LDFLAGS $OFILE -o $SOFILE $LIBS - -if ( test "$?" != "0") then - echo "Link error"; - exit; -fi diff --git a/release/plugins/sequence/Makefile b/release/plugins/sequence/Makefile deleted file mode 100644 index 2b12e62d24a..00000000000 --- a/release/plugins/sequence/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -# ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 ***** - -all: plugins - -plugins: - @/bin/sh -c 'for i in *.c; do ../bmake $$i; done;' - -clean: - rm -rf *.o *.so diff --git a/release/plugins/sequence/blur.c b/release/plugins/sequence/blur.c deleted file mode 100644 index d33feb0bb68..00000000000 --- a/release/plugins/sequence/blur.c +++ /dev/null @@ -1,284 +0,0 @@ -/** - * - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 ***** - */ - -#include <stdio.h> -#include "plugin.h" - -/* ******************** GLOBAL VARIABLES ***************** */ - - -char name[24] = "Blur"; - -/* structure for buttons, - * butcode name default min max 0 - */ - -VarStruct varstr[] = { - LABEL, "Input: 1 strip", 0.0, 0.0, 0.0, "", - NUMSLI | FLO, "Blur", 0.5, 0.0, 10.0, "Maximum filtersize", - NUMSLI | FLO, "Gamma", 1.0, 0.4, 2.0, "Gamma correction", - TOG | INT, "Animated", 0.0, 0.0, 1.0, "For (Ipo) animated blur", - NUM | INT, "debug", 0.0, 0.0, 2.0, - "0:off 1: show primary blur buffer 2: show 2nd blur buffer", - -}; - -/* The cast struct is for input in the main doit function - Varstr and Cast must have the same variables in the same order */ - -typedef struct Cast { - int dummy; /* because of the 'label' button */ - float blur; - float gamma; - float use_ipo; - int show; -} Cast; - - -/* cfra: the current frame */ - -float cfra; - -void plugin_seq_doit(Cast *, float, float, int, int, ImBuf *, ImBuf *, ImBuf *, ImBuf *); - -/* ******************** Fixed functions ***************** */ - -int plugin_seq_getversion(void) -{ - return B_PLUGIN_VERSION; -} - -void plugin_but_changed(int but) -{ -} - -void plugin_init(void) -{ -} - -void plugin_getinfo(PluginInfo *info) -{ - info->name = name; - info->nvars = sizeof(varstr) / sizeof(VarStruct); - info->cfra = &cfra; - - info->varstr = varstr; - - info->init = plugin_init; - info->seq_doit = (SeqDoit) plugin_seq_doit; - info->callback = plugin_but_changed; -} - - -void blurbuf(struct ImBuf *ibuf, int nr, Cast *cast) -{ - /* nr = number of blurs */ - /* the ibuf->rect is replaced */ - struct ImBuf *tbuf, *ttbuf; - int i, x4; - - tbuf = dupImBuf(ibuf); - x4 = ibuf->x / 4; - - /* This doesn't seem to work... paprmh */ - if (cast->gamma != 1.0) gamwarp(tbuf, cast->gamma); - - /* reduce */ - for (i = 0; i < nr; i++) { - ttbuf = onehalf(tbuf); - if (ttbuf) { - freeImBuf(tbuf); - tbuf = ttbuf; - } - if (tbuf->x < 4 || tbuf->y < 4) break; - } - - /* enlarge */ - for (i = 0; i < nr; i++) { - ttbuf = double_x(tbuf); - if (ttbuf) { - freeImBuf(tbuf); - tbuf = ttbuf; - } - ttbuf = double_y(tbuf); - if (ttbuf) { - freeImBuf(tbuf); - tbuf = ttbuf; - } - if (tbuf->x > x4) { - scaleImBuf(tbuf, ibuf->x, ibuf->y); - break; - } - } - - /* this doesn't seem to work...paprmh*/ - if (cast->gamma != 1.0) gamwarp(tbuf, 1.0 / cast->gamma); - - if (ibuf->rect) memcpy(ibuf->rect, tbuf->rect, 4 * ibuf->x * ibuf->y); - - if (ibuf->rect_float) - memcpy(ibuf->rect_float, tbuf->rect_float, 4 * ibuf->x * ibuf->y * sizeof(float)); - - freeImBuf(tbuf); - -} - -void doblur(struct ImBuf *mbuf, float fac, Cast *cast) -{ - /* make two filtered images, like a mipmap structure - * fac is filtersize in pixels - */ - struct ImBuf *ibuf, *pbuf; - float ifac, pfac, infac; - int n, b1, b2; - char *irect, *prect, *mrect; - float *irectf, *prectf, *mrectf; - - /* which buffers ? */ - - if (fac > 7.0) fac = 7.0; - if (fac <= 1.0) return; - - pfac = 2.0; - pbuf = dupImBuf(mbuf); - n = 1; - while (pfac < fac) { - blurbuf(pbuf, n, cast); - blurbuf(pbuf, n, cast); - - n++; - pfac += 1.0; - } - - ifac = pfac; - pfac -= 1.0; - - ibuf = dupImBuf(pbuf); - blurbuf(ibuf, n, cast); - blurbuf(ibuf, n, cast); - - fac = (fac - pfac) / (ifac - pfac); - n = mbuf->x * mbuf->y; - - if (cast->show) fac = cast->show - 1; - - if (mbuf->rect_float) { - if (fac >= 1) { - memcpy(mbuf->rect_float, ibuf->rect_float, 4 * n * sizeof(float)); - } - else if (fac <= 0) { - memcpy(mbuf->rect_float, pbuf->rect_float, 4 * n * sizeof(float)); - } - else { /* interpolate */ - infac = 1 - fac; - - irectf = (float *)ibuf->rect_float; - prectf = (float *)pbuf->rect_float; - mrectf = (float *)mbuf->rect_float; - while (n--) { - mrectf[0] = irectf[0] * fac + prectf[0] * infac; - mrectf[1] = irectf[1] * fac + prectf[1] * infac; - mrectf[2] = irectf[2] * fac + prectf[2] * infac; - mrectf[3] = irectf[3] * fac + prectf[3] * infac; - mrectf += 4; - irectf += 4; - prectf += 4; - } - } - } - else if (mbuf->rect) { - b1 = (int)fac * 255.0; - if (b1 > 255) b1 = 255; - b2 = 255 - b1; - - if (b1 == 255) { - memcpy(mbuf->rect, ibuf->rect, 4 * n); - } - else if (b1 == 0) { - memcpy(mbuf->rect, pbuf->rect, 4 * n); - } - else { /* interpolate */ - irect = (char *)ibuf->rect; - prect = (char *)pbuf->rect; - mrect = (char *)mbuf->rect; - while (n--) { - mrect[0] = (irect[0] * b1 + prect[0] * b2) >> 8; - mrect[1] = (irect[1] * b1 + prect[1] * b2) >> 8; - mrect[2] = (irect[2] * b1 + prect[2] * b2) >> 8; - mrect[3] = (irect[3] * b1 + prect[3] * b2) >> 8; - mrect += 4; - irect += 4; - prect += 4; - } - } - } - - freeImBuf(ibuf); - freeImBuf(pbuf); -} - - -void plugin_seq_doit(Cast *cast, float facf0, float facf1, int x, int y, ImBuf *ibuf1, ImBuf *ibuf2, ImBuf *out, ImBuf *use) -{ - float bfacf0, bfacf1; - - if (cast->use_ipo == 0) { - bfacf0 = bfacf1 = cast->blur + 1.0; - } - else { - bfacf0 = (facf0 * 6.0) + 1.0; - bfacf1 = (facf1 * 6.0) + 1.0; - } - - if (out->rect) memcpy(out->rect, ibuf1->rect, 4 * out->x * out->y); - if (out->rect_float) memcpy(out->rect_float, ibuf1->rect_float, 4 * out->x * out->y * sizeof(float)); - -/****************I can't get this field code to work... works ok without...paprmh****************/ - - - /* it blurs interlaced, only tested with even fields */ - -/* de_interlace(out);*/ - /* otherwise scaling goes wrong */ -/* out->flags &= ~IB_fields;*/ - - doblur(out, bfacf0, cast); /*fieldA*/ - -/* if (out->rect)out->rect += out->x * out->y; - if (out->rect_float)out->rect_float += out->x * out->y; - - doblur(out, bfacf1, cast);*/ /*fieldB*/ - -/* if (out->rect)out->rect -= out->x * out->y; - if (out->rect_float)out->rect_float -= out->x * out->y; - out->flags |= IB_fields; - - interlace(out);*/ - -} - diff --git a/release/plugins/sequence/color-correction-hsv.c b/release/plugins/sequence/color-correction-hsv.c deleted file mode 100644 index f77acd2ce93..00000000000 --- a/release/plugins/sequence/color-correction-hsv.c +++ /dev/null @@ -1,299 +0,0 @@ -/* - * Color Correction Plugin (YUV Version) 0.01 - * - * Copyright (c) 2005 Peter Schlaile - * - * 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. - * - */ - -#include <math.h> -#include "plugin.h" -#include <stdio.h> - -char name[] = "Color Correction"; - -VarStruct varstr[] = { - { NUMSLI | FLO, "St Y:", 0.0, -1.0, 1.0, "Setup Y"}, - { NUMSLI | FLO, "Gn Y:", 1.0, 0.0, 10.0, "Gain Y"}, - { NUMSLI | FLO, "Ga Y:", 1.0, 0.0, 10.0, "Gamma Y"}, - - { NUMSLI | FLO, "Lo S:", 1.0, 0.0, 10.0, "Saturation Shadows"}, - { NUMSLI | FLO, "Md S:", 1.0, 0.0, 10.0, "Saturation Midtones"}, - { NUMSLI | FLO, "Hi S:", 1.0, 0.0, 10.0, "Saturation Highlights"}, - - { NUMSLI | FLO, "MA S:", 1.0, 0.0, 10.0, "Master Saturation"}, - - { NUMSLI | FLO, "Lo T:", 0.25, 0.0, 1.0, - "Saturation Shadow Thres"}, - { NUMSLI | FLO, "Hi T:", 0.75, 0.0, 1.0, - "Saturation Highlights Thres"}, - { TOG | INT, "Debug", 0.0, 0.0, 1.0, - "Show curves as overlay"}, -}; - -typedef struct Cast { - float setup_y; - float gain_y; - float gamma_y; - float sat_shadows; - float sat_midtones; - float sat_highlights; - - float master_sat; - float lo_thres; - float hi_thres; - int debug; -} Cast; - -float cfra; - -void plugin_seq_doit(Cast *, float, float, int, int, ImBuf *, ImBuf *, ImBuf *, ImBuf *); - -int plugin_seq_getversion(void) -{ - return B_PLUGIN_VERSION; -} -void plugin_but_changed(int but) {} -void plugin_init() {} - -void plugin_getinfo(PluginInfo *info) -{ - info->name = name; - info->nvars = sizeof(varstr) / sizeof(VarStruct); - info->cfra = &cfra; - - info->varstr = varstr; - - info->init = plugin_init; - info->seq_doit = (SeqDoit) plugin_seq_doit; - info->callback = plugin_but_changed; -} - -static void hsv_to_rgb(double h, double s, double v, - double *r, double *g, double *b) -{ - int i; - double f, w, q, t; - - if (s == 0.0) - s = 0.000001; - - if (h == -1.0) - { - *r = v; - *g = v; - *b = v; - } - else { - if (h == 360.0) - h = 0.0; - h = h / 60.0; - i = (int) h; - f = h - i; - w = v * (1.0 - s); - q = v * (1.0 - (s * f)); - t = v * (1.0 - (s * (1.0 - f))); - - switch (i) - { - case 0: - *r = v; - *g = t; - *b = w; - break; - case 1: - *r = q; - *g = v; - *b = w; - break; - case 2: - *r = w; - *g = v; - *b = t; - break; - case 3: - *r = w; - *g = q; - *b = v; - break; - case 4: - *r = t; - *g = w; - *b = v; - break; - case 5: - *r = v; - *g = w; - *b = q; - break; - } - } -} - -static void rgb_to_hsv(double r, double g, double b, - double *h, double *s, double *v) -{ - double max, min, delta; - - max = r; - if (g > max) - max = g; - if (b > max) - max = b; - - min = r; - if (g < min) - min = g; - if (b < min) - min = b; - - *v = max; - - if (max != 0.0) - *s = (max - min) / max; - else - *s = 0.0; - - if (*s == 0.0) - *h = -1.0; - else { - delta = max - min; - - if (r == max) - *h = (g - b) / delta; - else if (g == max) - *h = 2.0 + (b - r) / delta; - else if (b == max) - *h = 4.0 + (r - g) / delta; - - *h = *h * 60.0; - - if (*h < 0.0) - *h = *h + 360; - } -} - -void plugin_seq_doit(Cast *cast, float facf0, float facf1, int width, - int height, ImBuf *ibuf1, ImBuf *ibuf2, ImBuf *out, ImBuf *use) -{ - char *dest, *src1; - int x, y, c; - double gamma_table[256]; - double uv_table[256]; - float *destf = out->rect_float; - float *src1f; - - if (!ibuf1) return; - - dest = (char *) out->rect; - src1 = (char *) ibuf1->rect; - src1f = ibuf1->rect_float; - - for (y = 0; y < 256; y++) { - float v = 1.0 * y / 255; - v += cast->setup_y; - v *= cast->gain_y; - v = pow(v, cast->gamma_y); - if (v > 1.0) { - v = 1.0; - } - else if (v < 0.0) { - v = 0.0; - } - gamma_table[y] = v * 255; - } - - for (y = 0; y < 256; y++) { - float v = 1.0; - v *= cast->master_sat; - if (y < cast->lo_thres * 255) { - v *= cast->sat_shadows; - } - else if (y > cast->hi_thres * 255) { - v *= cast->sat_highlights; - } - else { - v *= cast->sat_midtones; - } - uv_table[y] = v; - } - - - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) { - double h, s, v, r, g, b; - double fac; - - if (ibuf1->rect_float) rgb_to_hsv(src1f[0], src1f[1], - src1f[2], &h, &s, &v); - else rgb_to_hsv((double) src1[0] / 255.0, - (double) src1[1] / 255.0, - (double) src1[2] / 255.0, - &h, &s, &v); - v = gamma_table[(int) (v * 255.0)] / 255.0; - - fac = uv_table[(int) (255.0 * v)]; - - s *= fac; - if (s >= 1.0) { - s = 1.0; - } - hsv_to_rgb(h, s, v, &r, &g, &b); - - if (out->rect_float) { - destf[0] = r; - destf[1] = g; - destf[2] = b; - destf = destf + 4; - src1f += 4; - } - else { - dest[0] = r * 255.0; - dest[1] = g * 255.0; - dest[2] = b * 255.0; - dest += 4; - } - - src1 += 4; - } - } - - if (cast->debug) { - dest = (char *) out->rect; - for (c = 0; c < 10; c++) { - x = 0; - for (y = 0; y < 256; y++) { - char val = gamma_table[y]; - while (x < y * width / 255) { - *dest++ = val; - *dest++ = val; - *dest++ = val; - dest++; - x++; - } - } - } - for (c = 0; c < 10; c++) { - x = 0; - for (y = 0; y < 256; y++) { - char val = uv_table[y] * 255.0 / 10.0; - while (x < y * width / 255) { - *dest++ = val; - *dest++ = val; - *dest++ = val; - dest++; - x++; - } - } - } - } -} diff --git a/release/plugins/sequence/color-correction-yuv.c b/release/plugins/sequence/color-correction-yuv.c deleted file mode 100644 index c0c5d048b8f..00000000000 --- a/release/plugins/sequence/color-correction-yuv.c +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Color Correction Plugin (YUV Version) 0.01 - * - * Copyright (c) 2005 Peter Schlaile - * - * 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. - * - */ - -#include <math.h> -#include "plugin.h" -#include <stdio.h> - -char name[]= "Color Correction"; - -VarStruct varstr[]= { - { NUMSLI|FLO, "St Y:", 0.0, -1.0, 1.0, "Setup Y"}, - { NUMSLI|FLO, "Gn Y:", 1.0, 0.0, 10.0,"Gain Y"}, - { NUMSLI|FLO, "Ga Y:", 1.0, 0.0, 10.0, "Gamma Y"}, - - { NUMSLI|FLO, "Lo S:", 1.0, 0.0, 10.0,"Saturation Shadows"}, - { NUMSLI|FLO, "Md S:", 1.0, 0.0, 10.0,"Saturation Midtones"}, - { NUMSLI|FLO, "Hi S:", 1.0, 0.0, 10.0,"Saturation Highlights"}, - - { NUMSLI|FLO, "MA S:", 1.0, 0.0, 10.0,"Master Saturation"}, - { NUMSLI|FLO, "Lo T:", 0.25, 0.0, 1.0, - "Saturation Shadow Thres"}, - { NUMSLI|FLO, "Hi T:", 0.75, 0.0, 1.0, - "Saturation Highlights Thres"}, - { TOG|INT, "Debug", 0.0, 0.0, 1.0, - "Show curves as overlay"}, -}; - -typedef struct Cast { - float setup_y; - float gain_y; - float gamma_y; - - float sat_shadows; - float sat_midtones; - float sat_highlights; - - float master_sat; - float lo_thres; - float hi_thres; - int debug; -} Cast; - -float cfra; - -void plugin_seq_doit(Cast *, float, float, int, int, ImBuf *, ImBuf *, ImBuf *, ImBuf *); - -int plugin_seq_getversion(void) { return B_PLUGIN_VERSION;} -void plugin_but_changed(int but) {} -void plugin_init() {} - -void plugin_getinfo(PluginInfo *info) -{ - info->name= name; - info->nvars= sizeof(varstr)/sizeof(VarStruct); - info->cfra= &cfra; - - info->varstr= varstr; - - info->init= plugin_init; - info->seq_doit= (SeqDoit) plugin_seq_doit; - info->callback= plugin_but_changed; -} - -static void rgb_to_yuv(float rgb[3], float yuv[3]) -{ - yuv[0]= 0.299*rgb[0] + 0.587*rgb[1] + 0.114*rgb[2]; - yuv[1]= 0.492*(rgb[2] - yuv[0]); - yuv[2]= 0.877*(rgb[0] - yuv[0]); - - /* Normalize */ - yuv[1] /= 0.436; - yuv[2] /= 0.615; -} - -static void yuv_to_rgb(float yuv[3], float rgb[3]) -{ - yuv[1] *= 0.436; - yuv[2] *= 0.615; - - rgb[0] = yuv[2]/0.877 + yuv[0]; - rgb[2] = yuv[1]/0.492 + yuv[0]; - rgb[1] = (yuv[0] - 0.299*rgb[0] - 0.114*rgb[2]) / 0.587; - if (rgb[0] > 1.0) { - rgb[0] = 1.0; - } - if (rgb[0] < 0.0) { - rgb[0] = 0.0; - } - if (rgb[1] > 1.0) { - rgb[1] = 1.0; - } - if (rgb[1] < 0.0) { - rgb[1] = 0.0; - } - if (rgb[2] > 1.0) { - rgb[2] = 1.0; - } - if (rgb[2] < 0.0) { - rgb[2] = 0.0; - } -} - -void plugin_seq_doit(Cast *cast, float facf0, float facf1, int width, - int height, ImBuf *ibuf1, ImBuf *ibuf2, ImBuf *out, ImBuf *use) { - char *dest, *src1, *src2; - int x, y, c; - float rgb[3]; - float yuv[3]; - float gamma_table[256]; - float uv_table[256]; - float *destf = out->rect_float; - float *src1f; - - if (!ibuf1) return; - - dest= (char *) out->rect; - src1= (char *) ibuf1->rect; - src1f= ibuf1->rect_float; - - for (y = 0; y < 256; y++) { - float v = 1.0 * y / 255; - v += cast->setup_y; - v *= cast->gain_y; - v = pow(v, cast->gamma_y); - if ( v > 1.0) { - v = 1.0; - } else if (v < 0.0) { - v = 0.0; - } - gamma_table[y] = v * 255; - } - - for (y = 0; y < 256; y++) { - float v = 1.0; - v *= cast->master_sat; - if (y < cast->lo_thres * 255) { - v *= cast->sat_shadows; - } else if (y > cast->hi_thres * 255) { - v *= cast->sat_highlights; - } else { - v *= cast->sat_midtones; - } - uv_table[y] = v; - } - - - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) { - float fac; - if (out->rect_float) { - rgb[0]= (float)src1f[0]/255.0; - rgb[1]= (float)src1f[1]/255.0; - rgb[2]= (float)src1f[2]/255.0; - } else { - rgb[0]= (float)src1[0]/255.0; - rgb[1]= (float)src1[1]/255.0; - rgb[2]= (float)src1[2]/255.0; - } - rgb_to_yuv(rgb, yuv); - - yuv[0] = gamma_table[(int) (yuv[0] * 255.0)] / 255.0; - fac = uv_table[(int) (255.0 * yuv[0])]; - - yuv[1] = yuv[1] * fac; - yuv[2] = yuv[2] * fac; - if (yuv[1] > 1.0) { - yuv[1] = 1.0; - } - if (yuv[1] < -1.0) { - yuv[1] = -1.0; - } - if (yuv[2] > 1.0) { - yuv[2] = 1.0; - } - if (yuv[2] < -1.0) { - yuv[2] = -1.0; - } - yuv_to_rgb(yuv, rgb); - - if (out->rect_float) { - *destf++ = rgb[0]; - *destf++ = rgb[1]; - *destf++ = rgb[2]; - destf++; - src1f += 4; - } else { - *dest++ = rgb[0]*255.0; - *dest++ = rgb[1]*255.0; - *dest++ = rgb[2]*255.0; - dest++; - src1 += 4; - } - } - } - - if (cast->debug) { - dest= (char *) out->rect; - for (c = 0; c < 10; c++) { - x = 0; - for (y = 0; y < 256; y++) { - char val = gamma_table[y]; - while (x < y * width / 255) { - *dest++ = val; - *dest++ = val; - *dest++ = val; - dest++; - x++; - } - } - } - for (c = 0; c < 10; c++) { - x = 0; - for (y = 0; y < 256; y++) { - char val = uv_table[y] * 255.0/10.0; - while (x < y * width / 255) { - *dest++ = val; - *dest++ = val; - *dest++ = val; - dest++; - x++; - } - } - } - } -} diff --git a/release/plugins/sequence/dnr.c b/release/plugins/sequence/dnr.c deleted file mode 100644 index d374c40633c..00000000000 --- a/release/plugins/sequence/dnr.c +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Dynamic Noise Reduction (based on the VirtualDub filter by Steven Don) - * - * Copyright (c) 2005 Peter Schlaile - * - * 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. - * - */ - -#include <math.h> -#include "plugin.h" -#include <stdio.h> - -char name[]= "Dynamic Noise Reduction"; - -VarStruct varstr[]= { - { NUMSLI|INT, "Level:", 10.0, 0.0, 15.0, "Level"}, -}; - -typedef struct Cast { - int level; -} Cast; - -float cfra; -void * plugin_private_data; - -struct my_data { - unsigned char lookup_table[65536]; - int last_level; - float last_cfra; - int last_width; - int last_height; - unsigned char * last_frame; -}; - -void plugin_seq_doit(Cast *, float, float, int, int, - ImBuf *, ImBuf *, ImBuf *, ImBuf *); - -int plugin_seq_getversion(void) { return B_PLUGIN_VERSION;} - -static void precalculate(unsigned char * table, int level) -{ - int ap_, bp; - - for (ap_ = 0; ap_ < 256; ap_++) { - for (bp = 0; bp < 256; bp++) { - int ap = ap_; - int diff = ap - bp; - if (diff < 0) { - diff = -diff; - } - if (diff < level) { - if (diff > (level >> 1)) { - ap = (ap + ap + bp)/3; - } else { - ap = bp; - } - } - - *table++ = ap; - } - } -} - -void plugin_but_changed(int but) { } -void plugin_init() { } - -void * plugin_seq_alloc_private_data() -{ - struct my_data * result = (struct my_data*) calloc( - sizeof(struct my_data), 1); - result->last_cfra = -1; - return result; -} - -void plugin_seq_free_private_data(void * data) -{ - struct my_data * d = (struct my_data*) data; - if (d->last_frame) { - free(d->last_frame); - } - free(d); -} - -void plugin_getinfo(PluginInfo *info) -{ - info->name= name; - info->nvars= sizeof(varstr)/sizeof(VarStruct); - info->cfra= &cfra; - - info->varstr= varstr; - - info->init= plugin_init; - info->seq_doit= (SeqDoit) plugin_seq_doit; - info->callback= plugin_but_changed; -} - -static void doit(unsigned char * src_, unsigned char * dst_, - unsigned char * table, int width, int height) -{ - int count = width * height; - unsigned char * src = src_; - unsigned char * dst = dst_; - - while (count--) { - *dst = table[(*src++ << 8) | *dst]; dst++; - *dst = table[(*src++ << 8) | *dst]; dst++; - *dst = table[(*src++ << 8) | *dst]; dst++; - *dst++ = *src++; - } - - memcpy(src_, dst_, width * height * 4); -} - -void plugin_seq_doit(Cast *cast, float facf0, float facf1, int width, - int height, ImBuf *ibuf1, ImBuf *ibuf2, ImBuf *out, ImBuf *use) { - - struct my_data * d = (struct my_data*) plugin_private_data; - - if (!ibuf1) return; - - if (cast->level != d->last_level) { - precalculate(d->lookup_table, cast->level); - d->last_level = cast->level; - } - - if (width != d->last_width || height != d->last_height || - cfra != d->last_cfra + 1) - { - free(d->last_frame); - d->last_frame = (unsigned char*) calloc(width * height, 4); - - d->last_width = width; - d->last_height = height; - } - - memcpy(out->rect, ibuf1->rect, width * height * 4); - - doit((unsigned char*) out->rect, - d->last_frame, d->lookup_table, width, height); - - d->last_cfra = cfra; -} diff --git a/release/plugins/sequence/gamma.c b/release/plugins/sequence/gamma.c deleted file mode 100644 index db04902413d..00000000000 --- a/release/plugins/sequence/gamma.c +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Gamma Correction Plugin (RGB Version) 0.01 - * - * Copyright (c) 2005 Peter Schlaile - * - * 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. - * - */ - -#include <math.h> -#include "plugin.h" -#include "util.h" -#include <stdio.h> - -#define alpha_epsilon 0.0001f -char name[]= "Gamma Correction"; - -VarStruct varstr[]= { - { NUMSLI|FLO, "St M:", 0.0, -1.0, 1.0, "Setup Main"}, - { NUMSLI|FLO, "Gn M:", 1.0, 0.0, 10.0,"Gain Main"}, - { NUMSLI|FLO, "Ga M:", 1.0, 0.0, 10.0, "Gamma Main"}, - - { NUMSLI|FLO, "St R:", 0.0, -1.0, 1.0, "Setup Red"}, - { NUMSLI|FLO, "Gn R:", 1.0, 0.0, 10.0,"Gain Red"}, - { NUMSLI|FLO, "Ga R:", 1.0, 0.0, 10.0, "Gamma Red"}, - - { NUMSLI|FLO, "St G:", 0.0, -1.0, 1.0, "Setup Green"}, - { NUMSLI|FLO, "Gn G:", 1.0, 0.0, 10.0,"Gain Green"}, - { NUMSLI|FLO, "Ga G:", 1.0, 0.0, 10.0, "Gamma Green"}, - - { NUMSLI|FLO, "St B:", 0.0, -1.0, 1.0, "Setup Blue"}, - { NUMSLI|FLO, "Gn B:", 1.0, 0.0, 10.0,"Gain Blue"}, - { NUMSLI|FLO, "Ga B:", 1.0, 0.0, 10.0, "Gamma Blue"}, -}; - -typedef struct Cast { - float setup_m; - float gain_m; - float gamma_m; - - float setup_r; - float gain_r; - float gamma_r; - - float setup_g; - float gain_g; - float gamma_g; - - float setup_b; - float gain_b; - float gamma_b; -} Cast; - -float cfra; - -void plugin_seq_doit(Cast *, float, float, int, int, ImBuf *, ImBuf *, ImBuf *, ImBuf *); - -int plugin_seq_getversion(void) { return B_PLUGIN_VERSION; } -void plugin_but_changed(int but) {} -void plugin_init() {} - -void plugin_getinfo(PluginInfo *info) -{ - info->name= name; - info->nvars= sizeof(varstr)/sizeof(VarStruct); - info->cfra= &cfra; - - info->varstr= varstr; - - info->init= plugin_init; - info->seq_doit= (SeqDoit) plugin_seq_doit; - info->callback= plugin_but_changed; -} - -static void make_gamma_table(float setup, float gain, float gamma, - unsigned char * table) -{ - int y; - - for (y = 0; y < 256; y++) { - float v = 1.0 * y / 255; - v += setup; - v *= gain; - v = pow(v, gamma); - if ( v > 1.0) { - v = 1.0; - } else if (v < 0.0) { - v = 0.0; - } - table[y] = v * 255; - } - -} - - -void plugin_seq_doit(Cast *cast, float facf0, float facf1, int width, - int height, ImBuf *ibuf1, ImBuf *ibuf2, ImBuf *out, ImBuf *use) { - if (!out->rect_float) - { - unsigned char *dest, *src1, *src2; - int x, y, c; - unsigned char gamma_table_m[256]; - unsigned char gamma_table_r[256]; - unsigned char gamma_table_g[256]; - unsigned char gamma_table_b[256]; - - if (!ibuf1) return; - - dest= (unsigned char *) out->rect; - src1= (unsigned char *) ibuf1->rect; - - make_gamma_table(cast->setup_m, cast->gain_m, cast->gamma_m, - gamma_table_m); - make_gamma_table(cast->setup_r, cast->gain_r, cast->gamma_r, - gamma_table_r); - make_gamma_table(cast->setup_g, cast->gain_g, cast->gamma_g, - gamma_table_g); - make_gamma_table(cast->setup_b, cast->gain_b, cast->gamma_b, - gamma_table_b); - - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) { - *dest++ = gamma_table_r[gamma_table_m[*src1++]]; - *dest++ = gamma_table_g[gamma_table_m[*src1++]]; - *dest++ = gamma_table_b[gamma_table_m[*src1++]]; - dest++; src1++; - } - } - } - else - { - float *i=ibuf1->rect_float; - float *o=out->rect_float; - unsigned int size=width*height; - unsigned int k; - float val_r[3]={cast->setup_r,cast->gain_r,cast->gamma_r}; - float val_g[3]={cast->setup_g,cast->gain_g,cast->gamma_g}; - float val_b[3]={cast->setup_b,cast->gain_b,cast->gamma_b}; - float *vals[3]={val_r,val_g,val_b}; - for (k=0;k<size;++k) - { - if (cast->gamma_m!=1.f || cast->setup_m!=0.f || cast->gain_m!=1.f) - { - float alpha=CLAMP(i[3],0.f,1.f); - if (alpha>alpha_epsilon) { - int l; - for (l=0;l<3;++l) - { - float *val=vals[l]; - o[l]=i[l]/alpha; - o[l]=pow((o[l]+cast->setup_m)*cast->gain_m,cast->gamma_m); - if (val[2]!=1.f || val[0]!=0.f || val[1]!=1.f) - { - o[l]=pow((o[l]+val[0])*val[1],val[2]); - } - o[l]*=alpha; - o[l]=CLAMP(o[l],0.f,1.f); - } - } else { - o[0]=o[1]=o[2]=0.0; - } - o[3]=1.0; - } - else - { - int l; - for (l=0;l<3;++l) - o[l]=CLAMP(i[l],0.f,1.f); - o[3]=1.0; - } - i += 4; - o += 4; - } - } -} diff --git a/release/plugins/sequence/scatter.c b/release/plugins/sequence/scatter.c deleted file mode 100644 index a480f194bea..00000000000 --- a/release/plugins/sequence/scatter.c +++ /dev/null @@ -1,263 +0,0 @@ -/** - * - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 ***** - */ - -#include "plugin.h" - -/* ******************** GLOBAL VARIABLES ***************** */ - - -char name[24] = "scatter"; - -/* structure for buttons, - * butcode name default min max 0 - */ - -VarStruct varstr[] = { - LABEL, "Input: 1 strip", 0.0, 0.0, 0.0, "", - NUM | INT, "seed: ", 1.0, 0.0, 10.0, "Offset in random table", - NUMSLI | FLO, "swing: ", 1.0, 0.0, 3.0, "The amplitude, width of the effect", - TOG | INT, "wrap", 0.0, 0.0, 1.0, "Cyclic wrap around the left/right edges", - NUM | INT, "type: ", 1.0, 0.0, 1.0, "Type 1 is random for each frame", -}; - -/* The cast struct is for input in the main doit function - Varstr and Cast must have the same variables in the same order */ - -typedef struct Cast { - int dummy; /* because of the 'label' button */ - int seed; - float swing; - int wrap; - int type; -} Cast; - -/* cfra: the current frame */ - -float cfra; - -void plugin_seq_doit(Cast *, float, float, int, int, ImBuf *, ImBuf *, ImBuf *, ImBuf *); - - -/* ******************** Fixed functions ***************** */ - -int plugin_seq_getversion(void) -{ - return B_PLUGIN_VERSION; -} - -void plugin_but_changed(int but) -{ -} - -void plugin_init() -{ -} - -void plugin_getinfo(PluginInfo *info) -{ - info->name = name; - info->nvars = sizeof(varstr) / sizeof(VarStruct); - info->cfra = &cfra; - - info->varstr = varstr; - - info->init = plugin_init; - info->seq_doit = (SeqDoit) plugin_seq_doit; - info->callback = plugin_but_changed; -} - - -/* ************************************************************ - Scatter - -************************************************************ */ - -static void rectcpy(ImBuf *dbuf, ImBuf *sbuf, - int destx, int desty, - int srcx, int srcy, int width, int height) -{ - uint *drect, *srect; - float *dfrect, *sfrect; - int tmp; - - if (dbuf == 0) return; - - if (destx < 0) { - srcx -= destx; - width += destx; - destx = 0; - } - if (srcx < 0) { - destx -= srcx; - width += destx; - srcx = 0; - } - if (desty < 0) { - srcy -= desty; - height += desty; - desty = 0; - } - if (srcy < 0) { - desty -= srcy; - height += desty; - srcy = 0; - } - - if (width > dbuf->x - destx) width = dbuf->x - destx; - if (height > dbuf->y - desty) height = dbuf->y - desty; - if (sbuf) { - if (width > sbuf->x - srcx) width = sbuf->x - srcx; - if (height > sbuf->y - srcy) height = sbuf->y - srcy; - srect = sbuf->rect; - sfrect = sbuf->rect_float; - } - - if (width <= 0) return; - if (height <= 0) return; - - drect = dbuf->rect; - dfrect = dbuf->rect_float; - - tmp = (desty * dbuf->x + destx); - - if (dbuf->rect_float) dfrect += 4 * tmp; - else drect += tmp; - - destx = dbuf->x; - - if (sbuf) { - tmp = (srcy * sbuf->x + srcx); - if (dbuf->rect_float) sfrect += 4 * tmp; - else srect += tmp; - srcx = sbuf->x; - } - else { - if (dbuf->rect_float) sfrect = dfrect; - else srect = drect; - srcx = destx; - } - - for (; height > 0; height--) { - if (dbuf->rect_float) { - memcpy(dfrect, sfrect, 4 * width * sizeof(float)); - dfrect += destx; - sfrect += srcx; - } - else { - memcpy(drect, srect, width * sizeof(int)); - drect += destx; - srect += srcx; - } - } -} - -static void fill_out(ImBuf *out, float r, float g, float b, float a) -{ - int tot, x; - float *rectf = out->rect_float; - unsigned char *rect = (unsigned char *)out->rect; - - tot = out->x * out->y; - if (out->rect_float) { - for (x = 0; x < tot; x++) { - rectf[0] = r; - rectf[1] = g; - rectf[2] = b; - rectf[3] = a; - rectf += 4; - } - } - else { - for (x = 0; x < tot; x++) { - rect[0] = (int)(r * 255); - rect[1] = (int)(g * 255); - rect[2] = (int)(b * 255); - rect[3] = (int)(a * 255); - rect += 4; - } - } -} - - -void plugin_seq_doit(Cast *cast, float facf0, float facf1, int sx, int sy, ImBuf *ibuf1, ImBuf *ibuf2, ImBuf *out, ImBuf *use) -{ - float f1, f2, t1, t2, t3; - int x, y, lr; - - /* fill imbuf 'out' with black */ - fill_out(out, 0, 0, 0, 0); - - - switch (cast->type) { - case 0: - srand48(cast->seed); - break; - case 1: - srand48(cast->seed + facf0 * 1000); - break; - } - - for (y = 0; y < sy; y++) { - switch (cast->type) { - case 0: - if ((y & 1) == 0) { - f1 = drand48() - 0.5; - f2 = drand48() - 0.5; - f1 = cast->swing * f1; - f2 = cast->swing * f2; - if (cast->wrap) f2 += 1.0; - lr = drand48() > 0.5; - t1 = facf0; - } - else t1 = facf1; - - t2 = 1.0 - t1; - t3 = 3.0 * (f1 * t1 * t1 * t2 + f2 * t1 * t2 * t2); - if (cast->wrap) t3 += t2 * t2 * t2; - x = sx * t3; - if (lr) x = -x; - break; - case 1: - f1 = drand48() - 0.5; - f1 = f1 * cast->swing; - if ((y & 1) == 0) f1 *= facf0; - else f1 *= facf1; - x = f1 * sx; - break; - } - - rectcpy(out, ibuf1, 0, y, x, y, 32767, 1); - if (cast->wrap) { - rectcpy(out, ibuf1, 0, y, x + sx, y, 32767, 1); - rectcpy(out, ibuf1, 0, y, x + sx + sx, y, 32767, 1); - rectcpy(out, ibuf1, 0, y, x - sx, y, 32767, 1); - rectcpy(out, ibuf1, 0, y, x - sx - sx, y, 32767, 1); - } - } -} - diff --git a/release/plugins/texture/Makefile b/release/plugins/texture/Makefile deleted file mode 100644 index 2b12e62d24a..00000000000 --- a/release/plugins/texture/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -# ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 ***** - -all: plugins - -plugins: - @/bin/sh -c 'for i in *.c; do ../bmake $$i; done;' - -clean: - rm -rf *.o *.so diff --git a/release/plugins/texture/clouds2.c b/release/plugins/texture/clouds2.c deleted file mode 100644 index 8561d11dc3b..00000000000 --- a/release/plugins/texture/clouds2.c +++ /dev/null @@ -1,178 +0,0 @@ -/** - * - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 ***** - */ - -#include <math.h> -#include "plugin.h" - -/* ******************** GLOBAL VARIABLES ***************** */ - -/* Texture name */ - -char name[24]= "Clouds2"; - -/* Subtype names must be less than 15 characters */ - -#define NR_TYPES 3 -char stnames[NR_TYPES][16]= {"Intens", "Col", "Bump" }; - -/* Structure for buttons, - * butcode name default min max 0 - */ - -VarStruct varstr[]= { -{ NUM|FLO, "Offset", -0.5, -20.0, 20.0, ""}, -{ NUM|INT, "Depth", 8.0, 1.0, 12.0, ""}, -{ NUM|FLO, "Scale", 2.2, -20.0, 20.0, ""}, -{ NUM|FLO, "Falloff", 1.0, -20.0, 20.0, ""} -}; - -/* The cast struct is for input in the main doit function - Varstr and Cast must have the same variables in the same order, - INCLUDING dummy variables for label fields. */ - -typedef struct Cast { - float offset; - int depth; - float txtscale; - float falloff; -} Cast; - -/* result: - Intensity, R, G, B, Alpha, nor.x, nor.y, nor.z - */ - -float result[8]; - -/* cfra: the current frame */ - -float cfra; - -int plugin_tex_doit(int, Cast*, float*, float*, float*, float*); -void plugin_instance_init(Cast*); - -/* ******************** Fixed functions ***************** */ - -int plugin_tex_getversion(void) -{ - return B_PLUGIN_VERSION; -} - -void plugin_but_changed(int but) -{ -} - -void plugin_init(void) -{ - -} - -/* - * initialize any data for a particular instance of - * the plugin here - */ -void plugin_instance_init(Cast *cast) -{ -} - -/* this function should not be changed: */ - -void plugin_getinfo(PluginInfo *info) -{ - info->name= name; - info->stypes= NR_TYPES; - info->nvars= sizeof(varstr)/sizeof(VarStruct); - - info->snames= stnames[0]; - info->result= result; - info->cfra= &cfra; - info->varstr= varstr; - - info->init= plugin_init; - info->tex_doit= (TexDoit) plugin_tex_doit; - info->callback= plugin_but_changed; - info->instance_init= (void (*)(void *)) plugin_instance_init; -} - -/* ********************* the texture ******************** */ - - -int plugin_tex_doit(int stype, Cast *cast, float *texvec, float *dxt, float *dyt, float *result) -{ - float val = 0.0; - float a = 1.0; - float p[3]; - float tv[3]; - int i; - int res = TEX_INT; - - tv[0]=(texvec[0]+1.0)/2.0; - tv[1]=(texvec[1]+1.0)/2.0; - tv[2]=(texvec[2]+1.0)/2.0; - - p[0] = cast->txtscale * tv[0]; - p[1] = cast->txtscale * tv[1]; - p[2] = cast->txtscale * tv[2]; - - for (i=0; i<cast->depth; i++) { - val += a * hnoise(1.0, p[0], p[1], p[2]); - - p[0] *= 2.0; - p[1] *= 2.0; - p[2] *= 2.0; - a *= 0.5; - } - - /* always return this value */ - result[0] = CLAMP (val+cast->offset, 0.0, 1.0) * pow (fabs(sqrt(tv[0]*tv[0]+tv[1]*tv[1]+tv[2]*tv[2])), cast->falloff); - - if (stype==1) { - /* - * this is r, g, b, a: - */ - result[1]= 0.5*result[0]; - result[2]= 1.0-val; - result[3]= fsqrt(fabs(result[0])); - result[4]= 1.0; - - res |= TEX_RGB; - } - if (stype==2) { - /* - * This value is the displacement of the actual normal in - * the Material calculation. - */ - result[5]+= val; - result[6]+= 1.0-val; - result[7]= 0.0; - - res |= TEX_NOR; - } - - return res; -} - diff --git a/release/plugins/texture/tiles.c b/release/plugins/texture/tiles.c deleted file mode 100644 index 11e1ed8f8af..00000000000 --- a/release/plugins/texture/tiles.c +++ /dev/null @@ -1,177 +0,0 @@ - /** - * - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 ***** - */ - -#include <math.h> -#include "plugin.h" - -/* ******************** GLOBAL VARIABLES ***************** */ - -char name[]= "tiles"; - -/* Subtype names must be less than 15 characters */ - -#define NR_TYPES 2 -char stnames[NR_TYPES][16]= {"Square", "Deformed"}; - -VarStruct varstr[]= { - NUM|FLO, "size", 1.0, 0.0, 1.0, "The size of each tile", - NUM|FLO, "Noise", 1.0, 0.01, 10.0, "" -}; - -/* The cast struct is for input in the main doit function - Varstr and Cast must have the same variables in the same order */ - -typedef struct Cast { - float size; - float noise; -} Cast; - -/* result: - Intensity, R, G, B, Alpha, nor.x, nor.y, nor.z - */ - -float result[8]; - -/* cfra: the current frame */ - -float cfra; - -int plugin_tex_doit(int, Cast *, float *, float *, float *, float *); -void plugin_instance_init(Cast*); - -/* ******************** Fixed functions ***************** */ - -int plugin_tex_getversion(void) -{ - return B_PLUGIN_VERSION; -} - -void plugin_but_changed(int but) -{ -} - -void plugin_init(void) -{ -} - -/* - * initialize any data for a particular instance of - * the plugin here - */ -void plugin_instance_init(Cast *cast) -{ -} - -/* this function should not be changed: */ - -void plugin_getinfo(PluginInfo *info) -{ - info->name= name; - info->stypes= NR_TYPES; - info->nvars= sizeof(varstr)/sizeof(VarStruct); - - info->snames= stnames[0]; - info->result= result; - info->cfra= &cfra; - info->varstr= varstr; - - info->init= plugin_init; - info->tex_doit= (TexDoit) plugin_tex_doit; - info->callback= plugin_but_changed; - info->instance_init= (void (*)(void *)) plugin_instance_init; - -} - -/* ************************************************************ - Tiles - - Demonstration of a simple square wave function sampled - with anti-aliasing. - It is not mipmapped yet... - - ************************************************************ */ - - -/* square wave, antialiased, no mipmap! */ - -float sample_wave(float freq, float coord, float pixsize) -{ - float fac, frac, retval; - int part1, part2; - - if (pixsize > freq) return 0.5; - - pixsize/= freq; - - fac= coord/freq; - part1= ffloor(fac); - frac= fac - part1; - - if (part1 & 1) retval= 0.0; - else retval = 1.0; - - if (pixsize != 0.0) { - - /* is coord+pixsize another value? */ - - part2= ffloor(fac + pixsize); - if (part1==part2) return retval; - - /* antialias */ - if (retval == 1.0) retval= (1.0 - frac) / pixsize; - else retval= 1.0 - (1.0 - frac) / pixsize; - } - return retval; -} - -int plugin_tex_doit(int stype, Cast *cast, float *texvec, float *dxt, float *dyt, float *result) -{ - float xwave, ywave; - - if (stype==1) { - texvec[0]+= hnoise(cast->noise, texvec[0], texvec[1], texvec[2]); - texvec[1]+= hnoise(cast->noise, texvec[1], texvec[2], texvec[0]); - } - - if (dxt && dyt) { - xwave= sample_wave(cast->size, texvec[0], fabs(dxt[0]) + fabs(dyt[0]) ); - ywave= sample_wave(cast->size, texvec[1], fabs(dxt[1]) + fabs(dyt[1]) ); - - if (xwave > ywave) result[0]= xwave-ywave; - else result[0]= ywave-xwave; - } - else { - xwave= sample_wave(cast->size, texvec[0], 0.0 ); - ywave= sample_wave(cast->size, texvec[1], 0.0 ); - - if (xwave > ywave) result[0]= xwave-ywave; - else result[0]= ywave-xwave; - } - - return TEX_INT; -} diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt index 2821254ac3b..a0d840b5de6 100644 --- a/source/blender/CMakeLists.txt +++ b/source/blender/CMakeLists.txt @@ -98,7 +98,6 @@ add_subdirectory(render) add_subdirectory(compositor) add_subdirectory(blenfont) add_subdirectory(blenloader) -add_subdirectory(blenpluginapi) add_subdirectory(ikplugin) add_subdirectory(gpu) add_subdirectory(opencl) diff --git a/source/blender/SConscript b/source/blender/SConscript index 411a04528c5..c2ca6eb5ae5 100644 --- a/source/blender/SConscript +++ b/source/blender/SConscript @@ -7,7 +7,6 @@ SConscript(['avi/SConscript', 'blenkernel/SConscript', 'blenlib/SConscript', 'blenloader/SConscript', - 'blenpluginapi/SConscript', 'gpu/SConscript', 'opencl/SConscript', 'editors/SConscript', diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index fde6d93849d..b8eb23b9760 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -229,7 +229,7 @@ typedef struct bNodeType { #define NODE_CLASS_CONVERTOR 8 #define NODE_CLASS_MATTE 9 #define NODE_CLASS_DISTORT 10 -#define NODE_CLASS_OP_DYNAMIC 11 +#define NODE_CLASS_OP_DYNAMIC 11 /* deprecated */ #define NODE_CLASS_PATTERN 12 #define NODE_CLASS_TEXTURE 13 #define NODE_CLASS_EXECUTION 14 @@ -434,8 +434,6 @@ void node_type_compatibility(struct bNodeType *ntype, short compatibility); #define NODE_FORLOOP 3 #define NODE_WHILELOOP 4 #define NODE_FRAME 5 -#define NODE_GROUP_MENU 10000 -#define NODE_DYNAMIC_MENU 20000 /* look up a socket on a group node by the internal group socket */ struct bNodeSocket *node_group_find_input(struct bNode *gnode, struct bNodeSocket *gsock); diff --git a/source/blender/blenkernel/BKE_plugin_types.h b/source/blender/blenkernel/BKE_plugin_types.h deleted file mode 100644 index f3c5db02427..00000000000 --- a/source/blender/blenkernel/BKE_plugin_types.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 ***** - */ -#ifndef __BKE_PLUGIN_TYPES_H__ -#define __BKE_PLUGIN_TYPES_H__ - -/** \file BKE_plugin_types.h - * \ingroup bke - * \author nzc - */ - -struct ImBuf; - -typedef int (*TexDoitold)(int stype, void *cast, float *texvec, float *dxt, float *dyt); -typedef int (*TexDoit)(int stype, void *cast, float *texvec, float *dxt, float *dyt, float *result); -typedef void (*SeqDoit)(void *, float, float, int, int, - struct ImBuf *, struct ImBuf *, - struct ImBuf *, struct ImBuf *); - -typedef struct VarStruct { - int type; - char name[16]; - float def, min, max; - char tip[80]; -} VarStruct; - -typedef struct _PluginInfo { - char *name; - char *snames; - - int stypes; - int nvars; - VarStruct *varstr; - float *result; - float *cfra; - - void (*init)(void); - void (*callback)(int); - void (*tex_doit)(void *); - SeqDoit seq_doit; - void (*instance_init)(void *); -} PluginInfo; - -#endif - diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index f06e0e2f71a..d6c1a26fdba 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -113,9 +113,8 @@ enum { struct SeqEffectHandle { /* constructors & destructor */ - /* init & init_plugin are _only_ called on first creation */ + /* init is _only_ called on first creation */ void (*init)(struct Sequence *seq); - void (*init_plugin)(struct Sequence *seq, const char *fname); /* number of input strips needed * (called directly after construction) */ diff --git a/source/blender/blenkernel/BKE_texture.h b/source/blender/blenkernel/BKE_texture.h index 339b78ae2d1..78fdd26c9e0 100644 --- a/source/blender/blenkernel/BKE_texture.h +++ b/source/blender/blenkernel/BKE_texture.h @@ -48,7 +48,6 @@ struct Material; struct MTex; struct OceanTex; struct ParticleSettings; -struct PluginTex; struct PointDensity; struct Tex; struct TexMapping; @@ -60,10 +59,6 @@ struct World; void BKE_texture_free(struct Tex *t); -int test_dlerr(const char *name, const char *symbol); -void open_plugin_tex(struct PluginTex *pit); -struct PluginTex *add_plugin_tex(char *str); -void free_plugin_tex(struct PluginTex *pit); void init_colorband(struct ColorBand *coba, int rangetype); struct ColorBand *add_colorband(int rangetype); diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index 18616d7d40f..056a6bf5866 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -204,7 +204,6 @@ set(SRC BKE_packedFile.h BKE_paint.h BKE_particle.h - BKE_plugin_types.h BKE_pointcache.h BKE_property.h BKE_report.h diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 55ae7e4d11a..adf268d4d02 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -903,7 +903,7 @@ static void do_init_render_material(Material *ma, int r_mode, float *amb) ma->mapto |= mtex->mapto; /* always get derivatives for these textures */ - if (ELEM3(mtex->tex->type, TEX_IMAGE, TEX_PLUGIN, TEX_ENVMAP)) ma->texco |= TEXCO_OSA; + if (ELEM(mtex->tex->type, TEX_IMAGE, TEX_ENVMAP)) ma->texco |= TEXCO_OSA; else if (mtex->texflag & (MTEX_COMPAT_BUMP | MTEX_3TAP_BUMP | MTEX_5TAP_BUMP | MTEX_BICUBIC_BUMP)) ma->texco |= TEXCO_OSA; if (ma->texco & (TEXCO_ORCO | TEXCO_REFL | TEXCO_NORM | TEXCO_STRAND | TEXCO_STRESS)) needuv = 1; diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 35e838d94fa..2c29fe6a69c 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -29,13 +29,6 @@ * \ingroup bke */ - -#if 0 /* pynodes commented for now */ -# ifdef WITH_PYTHON -# include <Python.h> -# endif -#endif - #include "MEM_guardedalloc.h" #include <stdlib.h> @@ -135,20 +128,9 @@ void ntreeInitTypes(bNodeTree *ntree) for (node= ntree->nodes.first; node; node= next) { next= node->next; - node->typeinfo= node_get_type(ntree, node->type); - - if (node->type==NODE_DYNAMIC) { - /* needed info if the pynode script fails now: */ - node->storage= ntree; - if (node->id!=NULL) { /* not an empty script node */ - node->custom1 = 0; - node->custom1 = BSET(node->custom1, NODE_DYNAMIC_ADDEXIST); - } -// if (node->typeinfo) -// node->typeinfo->initfunc(node); - } + node->typeinfo = node_get_type(ntree, node->type); - if (node->typeinfo==NULL) { + if (node->typeinfo == NULL) { printf("Error: Node type %s doesn't exist anymore, removed\n", node->name); nodeFreeNode(ntree, node); } @@ -354,26 +336,6 @@ bNode *nodeAddNode(bNodeTree *ntree, struct bNodeTemplate *ntemp) return node; } -void nodeMakeDynamicType(bNode *node) -{ - /* find SH_DYNAMIC_NODE ntype */ - bNodeType *ntype= ntreeGetType(NTREE_SHADER)->node_types.first; - while (ntype) { - if (ntype->type==NODE_DYNAMIC) - break; - ntype= ntype->next; - } - - /* make own type struct to fill */ - if (ntype) { - /*node->typeinfo= MEM_dupallocN(ntype);*/ - bNodeType *newtype= MEM_callocN(sizeof(bNodeType), "dynamic bNodeType"); - *newtype= *ntype; - BLI_strncpy(newtype->name, ntype->name, sizeof(newtype->name)); - node->typeinfo= newtype; - } -} - /* keep socket listorder identical, for copying links */ /* ntree is the target tree */ bNode *nodeCopyNode(struct bNodeTree *ntree, struct bNode *node) @@ -1980,7 +1942,6 @@ static void registerShaderNodes(bNodeTreeType *ttype) register_node_type_sh_math(ttype); register_node_type_sh_vect_math(ttype); register_node_type_sh_squeeze(ttype); - //register_node_type_sh_dynamic(ttype); register_node_type_sh_material_ext(ttype); register_node_type_sh_invert(ttype); register_node_type_sh_seprgb(ttype); @@ -2073,30 +2034,12 @@ static void registerTextureNodes(bNodeTreeType *ttype) register_node_type_tex_proc_distnoise(ttype); } -static void free_dynamic_typeinfo(bNodeType *ntype) -{ - if (ntype->type==NODE_DYNAMIC) { - if (ntype->inputs) { - MEM_freeN(ntype->inputs); - } - if (ntype->outputs) { - MEM_freeN(ntype->outputs); - } - if (ntype->name) { - MEM_freeN((void *)ntype->name); - } - } -} - static void free_typeinfos(ListBase *list) { bNodeType *ntype, *next; for (ntype=list->first; ntype; ntype=next) { next = ntype->next; - - if (ntype->type==NODE_DYNAMIC) - free_dynamic_typeinfo(ntype); - + if (ntype->needs_free) MEM_freeN(ntype); } diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 252ddb78887..4b6c362cd85 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -47,7 +47,6 @@ #include "BKE_fcurve.h" #include "BKE_main.h" -#include "BKE_plugin_types.h" #include "BKE_sequencer.h" #include "BKE_texture.h" #include "BKE_utildefines.h" @@ -58,12 +57,6 @@ #include "RNA_access.h" /* **** XXX **** */ -static void error(const char *UNUSED(error), ...) {} - -#define INT 96 -#define FLO 128 - -/* **** XXX **** */ /* Glow effect */ enum { @@ -122,281 +115,6 @@ static ImBuf *prepare_effect_imbufs( } /* ********************************************************************** - * PLUGINS - * ********************************************************************** */ - -static void open_plugin_seq(PluginSeq *pis, const char *seqname) -{ - int (*version)(void); - void * (*alloc_private)(void); - char *cp; - - /* to be sure: (is tested for) */ - pis->doit = NULL; - pis->pname = NULL; - pis->varstr = NULL; - pis->cfra = NULL; - pis->version = 0; - pis->instance_private_data = NULL; - - /* clear the error list */ - BLI_dynlib_get_error_as_string(NULL); - - /* if (pis->handle) BLI_dynlib_close(pis->handle); */ - /* pis->handle = 0; */ - - /* open the needed object */ - pis->handle = BLI_dynlib_open(pis->name); - if (test_dlerr(pis->name, pis->name)) return; - - if (pis->handle != NULL) { - /* find the address of the version function */ - version = (int (*)(void))BLI_dynlib_find_symbol(pis->handle, "plugin_seq_getversion"); - if (test_dlerr(pis->name, "plugin_seq_getversion")) return; - - if (version != NULL) { - pis->version = version(); - if (pis->version >= 2 && pis->version <= 6) { - int (*info_func)(PluginInfo *); - PluginInfo *info = (PluginInfo *) MEM_mallocN(sizeof(PluginInfo), "plugin_info"); - - info_func = (int (*)(PluginInfo *))BLI_dynlib_find_symbol(pis->handle, "plugin_getinfo"); - - if (info_func == NULL) error("No info func"); - else { - info_func(info); - - pis->pname = info->name; - pis->vars = info->nvars; - pis->cfra = info->cfra; - - pis->varstr = info->varstr; - - pis->doit = (void (*)(void))info->seq_doit; - if (info->init) - info->init(); - } - MEM_freeN(info); - - cp = BLI_dynlib_find_symbol(pis->handle, "seqname"); - if (cp) BLI_strncpy(cp, seqname, SEQ_NAME_MAXSTR); - } - else { - printf("Plugin returned unrecognized version number\n"); - return; - } - } - alloc_private = (void * (*)(void))BLI_dynlib_find_symbol( - pis->handle, "plugin_seq_alloc_private_data"); - if (alloc_private) { - pis->instance_private_data = alloc_private(); - } - - pis->current_private_data = (void **) - BLI_dynlib_find_symbol(pis->handle, "plugin_private_data"); - } -} - -static PluginSeq *add_plugin_seq(const char *str, const char *seqname) -{ - PluginSeq *pis; - VarStruct *varstr; - int a; - - pis = MEM_callocN(sizeof(PluginSeq), "PluginSeq"); - - BLI_strncpy(pis->name, str, FILE_MAX); - open_plugin_seq(pis, seqname); - - if (pis->doit == NULL) { - if (pis->handle == NULL) error("no plugin: %s", str); - else error("in plugin: %s", str); - MEM_freeN(pis); - return NULL; - } - - /* default values */ - varstr = pis->varstr; - for (a = 0; a < pis->vars; a++, varstr++) { - if ( (varstr->type & FLO) == FLO) - pis->data[a] = varstr->def; - else if ( (varstr->type & INT) == INT) - *((int *)(pis->data + a)) = (int) varstr->def; - } - - return pis; -} - -static void free_plugin_seq(PluginSeq *pis) -{ - if (pis == NULL) return; - - /* no BLI_dynlib_close: same plugin can be opened multiple times with 1 handle */ - - if (pis->instance_private_data) { - void (*free_private)(void *); - - free_private = (void (*)(void *))BLI_dynlib_find_symbol( - pis->handle, "plugin_seq_free_private_data"); - if (free_private) { - free_private(pis->instance_private_data); - } - } - - MEM_freeN(pis); -} - -static void init_plugin(Sequence *seq, const char *fname) -{ - seq->plugin = (PluginSeq *)add_plugin_seq(fname, seq->name + 2); -} - -/* - * FIXME: should query plugin! Could be generator, that needs zero inputs... - */ -static int num_inputs_plugin(void) -{ - return 1; -} - -static void load_plugin(Sequence *seq) -{ - if (seq) { - open_plugin_seq(seq->plugin, seq->name + 2); - } -} - -static void copy_plugin(Sequence *dst, Sequence *src) -{ - if (src->plugin) { - dst->plugin = MEM_dupallocN(src->plugin); - open_plugin_seq(dst->plugin, dst->name + 2); - } -} - -static ImBuf *IMB_cast_away_list(ImBuf *i) -{ - if (!i) { - return NULL; - } - return (ImBuf *) (((void **) i) + 2); -} - -static ImBuf *do_plugin_effect( - SeqRenderData context, Sequence *seq, float cfra, - float facf0, float facf1, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, - struct ImBuf *ibuf3) -{ - char *cp; - int float_rendering; - int use_temp_bufs = FALSE; /* Are needed since blur.c (and maybe some other - * old plugins) do very bad stuff - * with imbuf-internals */ - - struct ImBuf *out = prepare_effect_imbufs(context, ibuf1, ibuf2, ibuf3); - int x = context.rectx; - int y = context.recty; - - if (seq->plugin && seq->plugin->doit) { - - if (seq->plugin->cfra) - *(seq->plugin->cfra) = cfra; - - cp = BLI_dynlib_find_symbol( - seq->plugin->handle, "seqname"); - - /* XXX: it's crappy to limit copying buffer by it's lemgth, - * but assuming plugin stuff is using correct buffer size - * it should be fine */ - if (cp) strncpy(cp, seq->name + 2, sizeof(seq->name) - 2); - - if (seq->plugin->current_private_data) { - *seq->plugin->current_private_data = seq->plugin->instance_private_data; - } - - float_rendering = (out->rect_float != NULL); - - if (seq->plugin->version <= 3 && float_rendering) { - use_temp_bufs = TRUE; - - if (ibuf1) { - ibuf1 = IMB_dupImBuf(ibuf1); - IMB_rect_from_float(ibuf1); - imb_freerectfloatImBuf(ibuf1); - ibuf1->flags &= ~IB_rectfloat; - } - if (ibuf2) { - ibuf2 = IMB_dupImBuf(ibuf2); - IMB_rect_from_float(ibuf2); - imb_freerectfloatImBuf(ibuf2); - ibuf2->flags &= ~IB_rectfloat; - } - if (ibuf3) { - ibuf3 = IMB_dupImBuf(ibuf3); - IMB_rect_from_float(ibuf3); - imb_freerectfloatImBuf(ibuf3); - ibuf3->flags &= ~IB_rectfloat; - } - if (!out->rect) imb_addrectImBuf(out); - imb_freerectfloatImBuf(out); - out->flags &= ~IB_rectfloat; - } - - if (seq->plugin->version <= 2) { - if (ibuf1) IMB_convert_rgba_to_abgr(ibuf1); - if (ibuf2) IMB_convert_rgba_to_abgr(ibuf2); - if (ibuf3) IMB_convert_rgba_to_abgr(ibuf3); - } - - if (seq->plugin->version <= 4) { - ((SeqDoit)seq->plugin->doit)( - seq->plugin->data, facf0, facf1, x, y, - IMB_cast_away_list(ibuf1), - IMB_cast_away_list(ibuf2), - IMB_cast_away_list(out), - IMB_cast_away_list(ibuf3)); - } - else { - ((SeqDoit)seq->plugin->doit)( - seq->plugin->data, facf0, facf1, x, y, - ibuf1, ibuf2, out, ibuf3); - } - - if (seq->plugin->version <= 2) { - if (!use_temp_bufs) { - if (ibuf1) IMB_convert_rgba_to_abgr(ibuf1); - if (ibuf2) IMB_convert_rgba_to_abgr(ibuf2); - if (ibuf3) IMB_convert_rgba_to_abgr(ibuf3); - } - IMB_convert_rgba_to_abgr(out); - } - if (seq->plugin->version <= 3 && float_rendering) { - IMB_float_from_rect_simple(out); - } - - if (use_temp_bufs) { - if (ibuf1) IMB_freeImBuf(ibuf1); - if (ibuf2) IMB_freeImBuf(ibuf2); - if (ibuf3) IMB_freeImBuf(ibuf3); - } - } - return out; -} - -static int do_plugin_early_out(struct Sequence *UNUSED(seq), - float UNUSED(facf0), float UNUSED(facf1)) -{ - return 0; -} - -static void free_plugin(struct Sequence *seq) -{ - free_plugin_seq(seq->plugin); - seq->plugin = NULL; -} - -/* ********************************************************************** * ALPHA OVER * ********************************************************************** */ @@ -3158,11 +2876,6 @@ static void load_noop(struct Sequence *UNUSED(seq)) } -static void init_plugin_noop(struct Sequence *UNUSED(seq), const char *UNUSED(fname)) -{ - -} - static void free_noop(struct Sequence *UNUSED(seq)) { @@ -3264,7 +2977,6 @@ static struct SeqEffectHandle get_sequence_effect_impl(int seq_type) int sequence_type = seq_type; rval.init = init_noop; - rval.init_plugin = init_plugin_noop; rval.num_inputs = num_inputs_default; rval.load = load_noop; rval.free = free_noop; @@ -3352,16 +3064,6 @@ static struct SeqEffectHandle get_sequence_effect_impl(int seq_type) rval.copy = copy_solid_color; rval.execute = do_solid_color; break; - case SEQ_PLUGIN: - rval.init_plugin = init_plugin; - rval.num_inputs = num_inputs_plugin; - rval.load = load_plugin; - rval.free = free_plugin; - rval.copy = copy_plugin; - rval.execute = do_plugin_effect; - rval.early_out = do_plugin_early_out; - rval.get_default_fac = get_default_fac_fade; - break; case SEQ_MULTICAM: rval.num_inputs = num_inputs_multicam; rval.early_out = early_out_multicam; diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 63cabf80eae..5318c5514ca 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -929,16 +929,6 @@ const char *give_seqname(Sequence *seq) if (seq->type < SEQ_EFFECT) { return seq->strip->dir; } - else if (seq->type == SEQ_PLUGIN) { - if (!(seq->flag & SEQ_EFFECT_NOT_LOADED) && - seq->plugin && seq->plugin->doit) - { - return seq->plugin->pname; - } - else { - return "Plugin"; - } - } else { return "Effect"; } diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index eefdb31c001..7de5f97588b 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -570,9 +570,6 @@ void BKE_text_unlink(Main *bmain, Text *text) if (update) DAG_id_tag_update(&ob->id, OB_RECALC_DATA); } - - /* pynodes */ - // XXX nodeDynamicUnlinkText(&text->id); /* text space */ for (scr = bmain->screen.first; scr; scr = scr->id.next) { diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 2ec42b47e5c..7081a642b8a 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -56,7 +56,6 @@ #include "IMB_imbuf.h" -#include "BKE_plugin_types.h" #include "BKE_utildefines.h" #include "BKE_global.h" #include "BKE_main.h" @@ -72,137 +71,6 @@ #include "BKE_animsys.h" #include "BKE_colortools.h" - -/* ------------------------------------------------------------------------- */ - -/* All support for plugin textures: */ -int test_dlerr(const char *name, const char *symbol) -{ - char *err; - - err = BLI_dynlib_get_error_as_string(NULL); - if (err) { - printf("var1: %s, var2: %s, var3: %s\n", name, symbol, err); - return 1; - } - - return 0; -} - -/* ------------------------------------------------------------------------- */ - -void open_plugin_tex(PluginTex *pit) -{ - int (*version)(void); - - /* init all the happy variables */ - pit->doit = NULL; - pit->pname = NULL; - pit->stnames = NULL; - pit->varstr = NULL; - pit->result = NULL; - pit->cfra = NULL; - pit->version = 0; - pit->instance_init = NULL; - - /* clear the error list */ - BLI_dynlib_get_error_as_string(NULL); - - /* no BLI_dynlib_close! multiple opened plugins... */ - /* if (pit->handle) BLI_dynlib_close(pit->handle); */ - /* pit->handle= 0; */ - - /* open the needed object */ - pit->handle = BLI_dynlib_open(pit->name); - if (test_dlerr(pit->name, pit->name)) return; - - if (pit->handle != NULL) { - /* find the address of the version function */ - version = (int (*)(void))BLI_dynlib_find_symbol(pit->handle, "plugin_tex_getversion"); - if (test_dlerr(pit->name, "plugin_tex_getversion")) return; - - if (version != NULL) { - pit->version = version(); - if (pit->version >= 2 && pit->version <= 6) { - int (*info_func)(PluginInfo *); - PluginInfo *info = (PluginInfo *) MEM_mallocN(sizeof(PluginInfo), "plugin_info"); - - info_func = (int (*)(PluginInfo *))BLI_dynlib_find_symbol(pit->handle, "plugin_getinfo"); - if (!test_dlerr(pit->name, "plugin_getinfo")) { - info->instance_init = NULL; - - info_func(info); - - pit->doit = (int (*)(void))info->tex_doit; - pit->callback = (void (*)(unsigned short))info->callback; - pit->stypes = info->stypes; - pit->vars = info->nvars; - pit->pname = info->name; - pit->stnames = info->snames; - pit->varstr = info->varstr; - pit->result = info->result; - pit->cfra = info->cfra; - pit->instance_init = info->instance_init; - if (info->init) info->init(); - } - MEM_freeN(info); - } - else { - printf("Plugin returned unrecognized version number\n"); - return; - } - } - } -} - -/* ------------------------------------------------------------------------- */ - -/* very badlevel define to bypass linking with BIF_interface.h */ -#define INT 96 -#define FLO 128 - -PluginTex *add_plugin_tex(char *str) -{ - PluginTex *pit; - VarStruct *varstr; - int a; - - pit = MEM_callocN(sizeof(PluginTex), "plugintex"); - - BLI_strncpy(pit->name, str, sizeof(pit->name)); - open_plugin_tex(pit); - - if (pit->doit == NULL) { - if (pit->handle == NULL) {; } //XXX error("no plugin: %s", str); - else {; } //XXX error("in plugin: %s", str); - MEM_freeN(pit); - return NULL; - } - - varstr = pit->varstr; - for (a = 0; a < pit->vars; a++, varstr++) { - if ( (varstr->type & FLO) == FLO) - pit->data[a] = varstr->def; - else if ( (varstr->type & INT) == INT) - *((int *)(pit->data + a)) = (int) varstr->def; - } - - if (pit->instance_init) - pit->instance_init((void *) pit->data); - - return pit; -} - -/* ------------------------------------------------------------------------- */ - -void free_plugin_tex(PluginTex *pit) -{ - if (pit == NULL) return; - - /* no BLI_dynlib_close: same plugin can be opened multiple times, 1 handle */ - MEM_freeN(pit); -} - /* ****************** Mapping ******************* */ TexMapping *add_tex_mapping(void) @@ -550,8 +418,6 @@ int colorband_element_remove(struct ColorBand *coba, int index) void BKE_texture_free(Tex *tex) { - free_plugin_tex(tex->plugin); - if (tex->coba) MEM_freeN(tex->coba); if (tex->env) BKE_free_envmap(tex->env); if (tex->pd) BKE_free_pointdensity(tex->pd); @@ -573,10 +439,6 @@ void BKE_texture_free(Tex *tex) void default_tex(Tex *tex) { - PluginTex *pit; - VarStruct *varstr; - int a; - tex->type = TEX_CLOUDS; tex->stype = 0; tex->flag = TEX_CHECKER_ODD; @@ -644,15 +506,6 @@ void default_tex(Tex *tex) tex->ot->output = TEX_OCN_DISPLACEMENT; tex->ot->object = NULL; } - pit = tex->plugin; - if (pit) { - varstr = pit->varstr; - if (varstr) { - for (a = 0; a < pit->vars; a++, varstr++) { - pit->data[a] = varstr->def; - } - } - } tex->iuser.fie_ima = 2; tex->iuser.ok = 1; @@ -833,11 +686,6 @@ Tex *BKE_texture_copy(Tex *tex) if (texn->type == TEX_IMAGE) id_us_plus((ID *)texn->ima); else texn->ima = NULL; - if (texn->plugin) { - texn->plugin = MEM_dupallocN(texn->plugin); - open_plugin_tex(texn->plugin); - } - if (texn->coba) texn->coba = MEM_dupallocN(texn->coba); if (texn->env) texn->env = BKE_copy_envmap(texn->env); if (texn->pd) texn->pd = BKE_copy_pointdensity(texn->pd); @@ -865,11 +713,6 @@ Tex *localize_texture(Tex *tex) /* image texture: BKE_texture_free also doesn't decrease */ - if (texn->plugin) { - texn->plugin = MEM_dupallocN(texn->plugin); - open_plugin_tex(texn->plugin); - } - if (texn->coba) texn->coba = MEM_dupallocN(texn->coba); if (texn->env) { texn->env = BKE_copy_envmap(texn->env); @@ -1058,7 +901,7 @@ void autotexname(Tex *tex) { Main *bmain = G.main; char texstr[20][15] = {"None", "Clouds", "Wood", "Marble", "Magic", "Blend", - "Stucci", "Noise", "Image", "Plugin", "EnvMap", "Musgrave", + "Stucci", "Noise", "Image", "EnvMap", "Musgrave", "Voronoi", "DistNoise", "Point Density", "Voxel Data", "Ocean", "", "", ""}; Image *ima; char di[FILE_MAXDIR], fi[FILE_MAXFILE]; @@ -1079,7 +922,6 @@ void autotexname(Tex *tex) } else new_id(&bmain->tex, (ID *)tex, texstr[tex->type]); } - else if (tex->type == TEX_PLUGIN && tex->plugin) new_id(&bmain->tex, (ID *)tex, tex->plugin->pname); else new_id(&bmain->tex, (ID *)tex, texstr[tex->type]); } } @@ -1565,11 +1407,7 @@ void BKE_free_oceantex(struct OceanTex *ot) /* ------------------------------------------------------------------------- */ int BKE_texture_dependsOnTime(const struct Tex *texture) { - if (texture->plugin) { - // assume all plugins depend on time - return 1; - } - else if (texture->ima && + if (texture->ima && ELEM(texture->ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) { return 1; diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h index 3664d7bcd77..74f5e7fc2bd 100644 --- a/source/blender/blenlib/BLI_path_util.h +++ b/source/blender/blenlib/BLI_path_util.h @@ -54,13 +54,11 @@ char *BLI_get_folder_version(const int id, const int ver, const int do_check); #define BLENDER_USER_CONFIG 31 #define BLENDER_USER_DATAFILES 32 #define BLENDER_USER_SCRIPTS 33 -#define BLENDER_USER_PLUGINS 34 -#define BLENDER_USER_AUTOSAVE 35 +#define BLENDER_USER_AUTOSAVE 34 /* system */ #define BLENDER_SYSTEM_DATAFILES 52 #define BLENDER_SYSTEM_SCRIPTS 53 -#define BLENDER_SYSTEM_PLUGINS 54 #define BLENDER_SYSTEM_PYTHON 54 /* for BLI_get_folder_version only */ diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index f90bb4d6152..e6c51ca0786 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -493,11 +493,6 @@ void BLI_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int case ID_TE: { Tex *tex = (Tex *)id; - if (tex->plugin) { - /* FIXME: rewrite_path assumes path length of FILE_MAX, but - * tex->plugin->name is 160. ... is this field even a path? */ - //rewrite_path(tex->plugin->name, visit_cb, bpath_user_data); - } if (tex->type == TEX_VOXELDATA && TEX_VD_IS_SOURCE_PATH(tex->vd->file_format)) { rewrite_path_fixed(tex->vd->source_path, visit_cb, absbase, bpath_user_data); } @@ -538,9 +533,6 @@ void BLI_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int rewrite_path_fixed(seq->strip->dir, visit_cb, absbase, bpath_user_data); } } - else if (seq->plugin) { - rewrite_path_fixed(seq->plugin->name, visit_cb, absbase, bpath_user_data); - } } SEQ_END diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 046dee148b4..5c432ae755a 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -139,7 +139,6 @@ #include "BKE_screen.h" #include "BKE_sequencer.h" #include "BKE_text.h" // for txt_extended_ascii_as_utf8 -#include "BKE_texture.h" // for open_plugin_tex #include "BKE_tracking.h" #include "BKE_utildefines.h" // SWITCH_INT DATA ENDB DNA1 O_BINARY GLOB USER TEST REND #include "BKE_sound.h" @@ -2398,11 +2397,6 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree) link_list(fd, &ntree->nodes); for (node = ntree->nodes.first; node; node = node->next) { - if (node->type == NODE_DYNAMIC) { - node->custom1 = 0; - node->custom1 = BSET(node->custom1, NODE_DYNAMIC_LOADED); - } - node->typeinfo = NULL; link_list(fd, &node->inputs); @@ -3170,17 +3164,7 @@ static void direct_link_texture(FileData *fd, Tex *tex) { tex->adt = newdataadr(fd, tex->adt); direct_link_animdata(fd, tex->adt); - - tex->plugin = newdataadr(fd, tex->plugin); - if (tex->plugin) { - tex->plugin->handle = NULL; - open_plugin_tex(tex->plugin); - /* initialize data for this instance, if an initialization - * function exists. - */ - if (tex->plugin->instance_init) - tex->plugin->instance_init((void *)tex->plugin->data); - } + tex->coba = newdataadr(fd, tex->coba); tex->env = newdataadr(fd, tex->env); if (tex->env) { @@ -4963,7 +4947,6 @@ static void direct_link_scene(FileData *fd, Scene *sce) /* a patch: after introduction of effects with 3 input strips */ if (seq->seq3 == NULL) seq->seq3 = seq->seq2; - seq->plugin = newdataadr(fd, seq->plugin); seq->effectdata = newdataadr(fd, seq->effectdata); if (seq->type & SEQ_EFFECT) diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c index 4a69c37ae1b..620d15993a1 100644 --- a/source/blender/blenloader/intern/versioning_250.c +++ b/source/blender/blenloader/intern/versioning_250.c @@ -88,7 +88,7 @@ #include "BKE_pointcache.h" #include "BKE_screen.h" #include "BKE_sequencer.h" -#include "BKE_texture.h" // for open_plugin_tex +#include "BKE_texture.h" #include "BKE_utildefines.h" // SWITCH_INT DATA ENDB DNA1 O_BINARY GLOB USER TEST REND #include "BKE_sound.h" diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 320278544ae..0b552ce220c 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -716,7 +716,7 @@ static void write_nodetree(WriteData *wd, bNodeTree *ntree) write_node_socket(wd, sock); - if (node->storage && node->type!=NODE_DYNAMIC) { + if (node->storage) { /* could be handlerized at some point, now only 1 exception still */ if (ntree->type==NTREE_SHADER && (node->type==SH_NODE_CURVE_VEC || node->type==SH_NODE_CURVE_RGB)) write_curvemapping(wd, node->storage); @@ -1958,7 +1958,6 @@ static void write_textures(WriteData *wd, ListBase *idbase) if (tex->adt) write_animdata(wd, tex->adt); /* direct data */ - if (tex->type == TEX_PLUGIN && tex->plugin) writestruct(wd, DATA, "PluginTex", 1, tex->plugin); if (tex->coba) writestruct(wd, DATA, "ColorBand", 1, tex->coba); if (tex->type == TEX_ENVMAP && tex->env) writestruct(wd, DATA, "EnvMap", 1, tex->env); if (tex->type == TEX_POINTDENSITY && tex->pd) { @@ -2152,7 +2151,6 @@ static void write_scenes(WriteData *wd, ListBase *scebase) if (seq->strip && seq->strip->done==0) { /* write strip with 'done' at 0 because readfile */ - if (seq->plugin) writestruct(wd, DATA, "PluginSeq", 1, seq->plugin); if (seq->effectdata) { switch (seq->type) { case SEQ_COLOR: diff --git a/source/blender/blenpluginapi/CMakeLists.txt b/source/blender/blenpluginapi/CMakeLists.txt deleted file mode 100644 index 3e40b5bb0e5..00000000000 --- a/source/blender/blenpluginapi/CMakeLists.txt +++ /dev/null @@ -1,58 +0,0 @@ -# ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# The Original Code is Copyright (C) 2006, Blender Foundation -# All rights reserved. -# -# The Original Code is: all of this file. -# -# Contributor(s): Jacques Beaurain. -# -# ***** END GPL LICENSE BLOCK ***** - -set(INC - . - .. - ../blenlib - ../blenloader - ../imbuf - ../makesdna - ../../../intern/guardedalloc -) - -set(INC_SYS - -) - -set(SRC - intern/pluginapi.c - - documentation.h - externdef.h - floatpatch.h - iff.h - plugin.h - util.h -) - -if(WITH_CODEC_QUICKTIME) - list(APPEND INC_SYS - ${QUICKTIME_INCLUDE_DIRS} - ) - add_definitions(-DWITH_QUICKTIME) -endif() - -blender_add_lib(bf_blenpluginapi "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/blenpluginapi/SConscript b/source/blender/blenpluginapi/SConscript deleted file mode 100644 index fe37091bb95..00000000000 --- a/source/blender/blenpluginapi/SConscript +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/python -Import ('env') - -sources = env.Glob('intern/*.c') - -incs = '. .. #/intern/guardedalloc ../blenlib ../imbuf ../makesdna ../blenloader' - -defs = [] - -incs += ' ' + env["BF_PTHREADS_INC"] - -if env['WITH_BF_QUICKTIME']: - defs.append('WITH_QUICKTIME') - incs += ' ' + env['BF_QUICKTIME_INC'] - -if env['OURPLATFORM'] == 'linux': - cflags='-pthread' - incs += ' ../../../extern/binreloc/include' - -if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'): - incs += ' ' + env['BF_PTHREADS_INC'] - -env.BlenderLib ( libname = 'bf_blenpluginapi', sources = sources, includes = Split(incs), defines = defs, libtype=['core'], priority = [170] ) diff --git a/source/blender/blenpluginapi/documentation.h b/source/blender/blenpluginapi/documentation.h deleted file mode 100644 index 8a15109428f..00000000000 --- a/source/blender/blenpluginapi/documentation.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 ***** - */ - -/** - * \file blender/blenpluginapi/documentation.h - * \ingroup blpluginapi - * - * \mainpage plugin API - the access point for texture and sequence - * plugins - * - * \section about About the plugin API - * - * This API wraps functions that are used by texture and sequence - * plugins. They are explicitly wrapped in order to make the - * dependencies to the rest of the system clear. - * - * \section issues Known issues with the plugin API - * - * - It can be difficult at times to get access to the API functions - * linked into the final executable. On gcc, the -fpic and -shared - * flags take care of this. On Irix, -shared is needed, but you also - * need a reference to the function to get the handle. This has - * momentarily been taken care of by pluginapi_force_ref(). - * - * - Plugins need to define three functions that are needed for - * version bookkeeping and information. The plugin loading code - * explicitly checks for these functions. The nanes depend on whether - * it is a texture or sequence plugin. - * - * - The plugin loading occurs in sequence.c and texture.c. The - * following functions are involved: - * - open_plugin_seq() (used in readfile.c, editseq.c, sequence.c) - * - add_plugin_seq() (used in editseq.c, sequence.c) - * - free_plugin_seq() (used in editseq.c, sequence.c) - * - open_plugin_tex() (used in texture.c, readfile.c) - * - add_plugin_tex() (used in texture.c, buttons.c) - * - free_plugin_tex() (used in texture.c, buttons.c) - * - test_dlerr() (used in texture.c, sequence.c) - * Since the plugins are about to phase out, we will not sanitize this - * code. It will be removed as soon as the replacing system is in - * place. - * - * \section dependencies Dependencies - * - * The plugins wraps functions from IMB and BLI. In addition, they - * define some useful variables. - */ diff --git a/source/blender/blenpluginapi/externdef.h b/source/blender/blenpluginapi/externdef.h deleted file mode 100644 index 154b276c851..00000000000 --- a/source/blender/blenpluginapi/externdef.h +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright (c) 1999, Not a Number / NeoGeo b.v. - * - * All rights reserved. - * - * Contact: info@blender.org - * Information: http://www.blender.org - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef __EXTERNDEF_H__ -#define __EXTERNDEF_H__ - -/** \file blender/blenpluginapi/externdef.h - * \ingroup blpluginapi - */ - -#ifdef WIN32 - #ifdef PLUGIN_INTERN - #define LIBEXPORT __declspec(dllexport) - #define LIBIMPORT __declspec(dllexport) - #else - #define LIBEXPORT __declspec(dllexport) - #define LIBIMPORT extern __declspec(dllimport) - #endif -#elif !defined(WIN32) - #define LIBEXPORT extern - #define LIBIMPORT extern -#endif - -#endif /* __EXTERNDEF_H__ */ diff --git a/source/blender/blenpluginapi/floatpatch.h b/source/blender/blenpluginapi/floatpatch.h deleted file mode 100644 index d1c7edcc307..00000000000 --- a/source/blender/blenpluginapi/floatpatch.h +++ /dev/null @@ -1,93 +0,0 @@ -/* Copyright (c) 1999, Not a Number / NeoGeo b.v. - * - * All rights reserved. - * - * Contact: info@blender.org - * Information: http://www.blender.org - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef __FLOATPATCH_H__ -#define __FLOATPATCH_H__ - -/** \file blender/blenpluginapi/floatpatch.h - * \ingroup blpluginapi - */ - -/* floating point libs differ at systems... with these defines it comilies at all! */ - -#ifdef MIPS1 -#else - -#define fabsf(a) fabs((double)(a)) - -#define facos acosf -#define acosf(a) acos((double)(a)) - -#define fasin asinf -#define asinf(a) asin((double)(a)) - -#define fatan atanf -#define atanf(a) atan((double)(a)) - -#define fatan2 atan2f -#define atan2f(a, b) atan2((double)(a), (double)(b)) - -#define fmodf(a, b) fmod((double)(a), (double)(b)) - -#define fcos cosf -#define cosf(a) cos((double)(a)) - -#define fsin sinf -#define sinf(a) sin((double)(a)) - -#define ftan tanf -#define tanf(a) tan((double)(a)) - -#define fexp expf -#define expf(a) exp((double)(a)) - -#define flog logf -#define logf(a) log((double)(a)) - -#define flog10 log10f -#define log10f(a) log10((double)(a)) - -#define fsqrt sqrtf -#define sqrtf(a) sqrt((double)(a)) - -#define fceil ceilf -#define ceilf(a) ceil((double)(a)) - -#define ffloor floorf -#define floorf(a) floor((double)(a)) - -#define fpow powf -#define powf(a, b) pow((double)(a), (double)(b)) - -/* #endif */ - -#endif - -#endif /* __FLOATPATCH_H__ */ - diff --git a/source/blender/blenpluginapi/iff.h b/source/blender/blenpluginapi/iff.h deleted file mode 100644 index 63d60ce7c82..00000000000 --- a/source/blender/blenpluginapi/iff.h +++ /dev/null @@ -1,122 +0,0 @@ -/* Copyright (c) 1999, Not a Number / NeoGeo b.v. - * - * All rights reserved. - * - * Contact: info@blender.org - * Information: http://www.blender.org - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef __IFF_H__ -#define __IFF_H__ - -/** \file blender/blenpluginapi/iff.h - * \ingroup blpluginapi - */ - -#include <sys/types.h> -#include "util.h" -#include "externdef.h" - -struct ImMetaData; - -#define IB_MIPMAP_LEVELS 20 -#define IB_FILENAME_SIZE 1023 - -typedef struct ImBuf { - struct ImBuf *next, *prev; /**< allow lists of ImBufs, for caches or flipbooks */ - short x, y; /**< width and Height of our image buffer */ - unsigned char depth; /**< Active amount of bits/bitplanes */ - unsigned int *rect; /**< pixel values stored here */ - unsigned int *crect; /**< color corrected pixel values stored here */ - int flags; /**< Controls which components should exist. */ - int mall; /**< what is malloced internal, and can be freed */ - int *zbuf; /**< z buffer data, original zbuffer */ - float *zbuf_float; /**< z buffer data, camera coordinates */ - void *userdata; /**< temporary storage, only used by baking at the moment */ - unsigned char *encodedbuffer; /**< Compressed image only used with png currently */ - unsigned int encodedsize; /**< Size of data written to encodedbuffer */ - unsigned int encodedbuffersize; /**< Size of encodedbuffer */ - - float *rect_float; /** < floating point Rect equivalent - * Linear RGB color space - may need gamma correction to - * sRGB when generating 8bit representations */ - int channels; /**< amount of channels in rect_float (0 = 4 channel default) */ - float dither; /**< random dither value, for conversion from float -> byte rect */ - short profile; /** color space/profile preset that the byte rect buffer represents */ - char profile_filename[1024]; /** to be implemented properly, specific filename for custom profiles */ - - /* mipmapping */ - struct ImBuf *mipmap[IB_MIPMAP_LEVELS]; /**< MipMap levels, a series of halved images */ - int miplevels; - - /* externally used flags */ - int index; /* reference index for ImBuf lists */ - int userflags; /* used to set imbuf to dirty and other stuff */ - struct ImMetaData *metadata; - - /* file information */ - int ftype; /* file type we are going to save as */ - char name[IB_FILENAME_SIZE]; /* filename associated with this image */ - - /* memory cache limiter */ - struct MEM_CacheLimiterHandle_s *c_handle; /* handle for cache limiter */ - int refcounter; /* reference counter for multiple users */ -} ImBuf; - -LIBIMPORT struct ImBuf *allocImBuf(short, short, uchar, uint); -LIBIMPORT struct ImBuf *dupImBuf(struct ImBuf *); -LIBIMPORT void freeImBuf(struct ImBuf*); - -LIBIMPORT short saveiff(struct ImBuf *, char *, int); - -LIBIMPORT struct ImBuf *loadifffile(int, int); -LIBIMPORT struct ImBuf *loadiffname(char *, int); -LIBIMPORT struct ImBuf *testiffname(char *, int); - -LIBIMPORT struct ImBuf *onehalf(struct ImBuf *); -LIBIMPORT struct ImBuf *half_x(struct ImBuf *); -LIBIMPORT struct ImBuf *half_y(struct ImBuf *); -LIBIMPORT struct ImBuf *double_x(struct ImBuf *); -LIBIMPORT struct ImBuf *double_y(struct ImBuf *); -LIBIMPORT struct ImBuf *double_fast_x(struct ImBuf *); -LIBIMPORT struct ImBuf *double_fast_y(struct ImBuf *); - -LIBIMPORT int ispic(char *); - -LIBIMPORT struct ImBuf *scaleImBuf(struct ImBuf *, short, short); -LIBIMPORT struct ImBuf *scalefastImBuf(struct ImBuf *, short, short); - -LIBIMPORT void de_interlace(struct ImBuf *ib); -LIBIMPORT void interlace(struct ImBuf *ib); - -LIBIMPORT void IMB_rectcpy(struct ImBuf *dbuf, struct ImBuf *sbuf, - int destx, int desty, int srcx, int srcy, int width, int height); - -LIBIMPORT void IMB_rectfill(struct ImBuf *drect, const float col[4]); -LIBIMPORT void IMB_rectfill_area(struct ImBuf *ibuf, const float col[4], int x1, int y1, int x2, int y2); -LIBIMPORT void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height, const float col[4], int x1, int y1, int x2, int y2); -LIBIMPORT void IMB_rectfill_alpha(struct ImBuf *drect, const float value); - -#endif /* __IFF_H__ */ - diff --git a/source/blender/blenpluginapi/intern/pluginapi.c b/source/blender/blenpluginapi/intern/pluginapi.c deleted file mode 100644 index efdd11352c6..00000000000 --- a/source/blender/blenpluginapi/intern/pluginapi.c +++ /dev/null @@ -1,305 +0,0 @@ -/* - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 ***** - * Wrappers for the plugin api. This api is up for removal. - */ - -/** \file blender/blenpluginapi/intern/pluginapi.c - * \ingroup blenpluginapi - */ - - -/* There are four headers making up the plugin api: - * - floatpatch.h : Wraps math functions for mips platforms, no code - * required. - * - iff.h : Defines, macros and functions for dealing - * with image buffer things. - * - plugin.h : Wraps some plugin handling types, accesses noise - * functions. - * - util.h : Useful defines, memory management. - */ - -#define PLUGIN_INTERN /* This tells the LIBEXPORT macro to compile with - * dll export set on windows */ - -#ifdef WIN32 -#include "blenpluginapi/util.h" -#else -#include "blenpluginapi/util.h" -#endif -#include "iff.h" -#include "plugin.h" -#include "MEM_guardedalloc.h" - -#include "BLO_sys_types.h" // needed for intptr_t - -#include "BLI_blenlib.h" /* util and noise functions */ -#include "BLI_threads.h" /* For threadsfe guardedalloc malloc/calloc/free */ -#include "IMB_imbuf.h" /* image buffer stuff */ -#define GET_INT_FROM_POINTER(i) ((int)(intptr_t)(i)) /* should use BKE_utildefines.h */ - -/* -------------------------------------------------------------------------- */ -/* stuff from util.h */ -/* -------------------------------------------------------------------------- */ - -LIBEXPORT void *mallocN(int len, char *str) -{ - return MEM_mallocN(len, str); -} - -LIBEXPORT void *callocN(int len, char *str) -{ - return MEM_callocN(len, str); -} - -LIBEXPORT short freeN(void *vmemh) -{ - return MEM_freeN(vmemh); -} - -/* these are not needed anymore, mallocN/callocN/freeN is now threadsafe */ -LIBEXPORT void *mallocT(int len, char *str) -{ - return MEM_mallocN(len, str); -} - -LIBEXPORT void *callocT(int len, char *str) -{ - return MEM_callocN(len, str); -} - -LIBEXPORT void freeT(void *vmemh) -{ - MEM_freeN(vmemh); - return; -} - - -/* -------------------------------------------------------------------------- */ -/* stuff from iff.h */ -/* -------------------------------------------------------------------------- */ - -LIBEXPORT struct ImBuf *allocImBuf(short x, - short y, - uchar d, - uint flags) -{ - return IMB_allocImBuf(x, y, d, flags); -} - - -LIBEXPORT struct ImBuf *dupImBuf(struct ImBuf *ib) -{ - return IMB_dupImBuf(ib); -} - -LIBEXPORT void freeImBuf(struct ImBuf* ib) -{ - IMB_freeImBuf(ib); -} - -LIBEXPORT short saveiff(struct ImBuf *ib, - char *c, - int i) -{ - return IMB_saveiff(ib, c, i); -} - -LIBEXPORT struct ImBuf *loadifffile(int a, - int b) -{ - return IMB_loadifffile(a, b, "loadifffile"); -} - -LIBEXPORT struct ImBuf *loadiffname(char *n, - int flags) -{ - return IMB_loadiffname(n, flags); -} - -LIBEXPORT struct ImBuf *testiffname(char *n, - int flags) -{ - return IMB_testiffname(n, flags); -} - -LIBEXPORT struct ImBuf *onehalf(struct ImBuf *ib) -{ - return IMB_onehalf(ib); -} - -LIBEXPORT struct ImBuf *half_x(struct ImBuf *ib) -{ - return IMB_half_x(ib); -} - -LIBEXPORT struct ImBuf *half_y(struct ImBuf *ib) -{ - return IMB_half_y(ib); -} - -LIBEXPORT struct ImBuf *double_x(struct ImBuf *ib) -{ - return IMB_double_x(ib); -} - -LIBEXPORT struct ImBuf *double_y(struct ImBuf *ib) -{ - return IMB_double_y(ib); -} - -LIBEXPORT struct ImBuf *double_fast_x(struct ImBuf *ib) -{ - return IMB_double_fast_x(ib); -} - -LIBEXPORT struct ImBuf *double_fast_y(struct ImBuf *ib) -{ - return IMB_double_fast_y(ib); -} - -LIBEXPORT int ispic(char * name) -{ - return IMB_ispic(name); -} - -/* still the same name */ -/* void (*ditherfunc)(struct ImBuf *, short, short) {} */ - -LIBEXPORT struct ImBuf *scaleImBuf(struct ImBuf *ib, - short nx, - short ny) -{ - return IMB_scaleImBuf(ib, nx, ny); -} - -LIBEXPORT struct ImBuf *scalefastImBuf(struct ImBuf *ib, - short x, - short y) -{ - return IMB_scalefastImBuf(ib, x, y); -} - - /* Extra ones that some NaN (read Ton) plugins use, - * even though they aren't in the header - */ - -LIBEXPORT void interlace(struct ImBuf *ibuf) -{ - IMB_interlace(ibuf); -} - -LIBEXPORT void de_interlace(struct ImBuf *ib) -{ - IMB_de_interlace(ib); -} - -/* -------------------------------------------------------------------------- */ -/* stuff from plugin.h */ -/* -------------------------------------------------------------------------- */ - -/* These three need to be defined in the plugin itself. The plugin - * loader looks for these functions to check whether it can use the - * plugin. For sequences, something similar exists. */ -/* int plugin_tex_getversion(void); */ -/* int plugin_seq_getversion(void); */ -/* void plugin_getinfo(PluginInfo *); */ - -LIBEXPORT float hnoise(float noisesize, - float x, - float y, - float z) -{ - return BLI_hnoise(noisesize, x, y, z); -} - -LIBEXPORT float hnoisep(float noisesize, - float x, - float y, - float z) -{ - return BLI_hnoisep(noisesize, x, y, z); -} - -LIBEXPORT float turbulence(float noisesize, - float x, - float y, - float z, - int depth) -{ - return BLI_turbulence(noisesize, x, y, z, depth); -} - -LIBEXPORT float turbulence1(float noisesize, - float x, - float y, - float z, - int depth) -{ - return BLI_turbulence1(noisesize, x, y, z, depth); -} - -/* -------------------------------------------------------------------------- */ - - /* Stupid hack - force the inclusion of all of the - * above functions in the binary by 'using' each one... - * Otherwise they will not be imported from the archive - * library on Unix. -zr - */ -int pluginapi_force_ref(void); - -int pluginapi_force_ref(void) -{ - return - GET_INT_FROM_POINTER(mallocN) + - GET_INT_FROM_POINTER(callocN) + - GET_INT_FROM_POINTER(freeN) + - GET_INT_FROM_POINTER(mallocT) + - GET_INT_FROM_POINTER(callocT) + - GET_INT_FROM_POINTER(freeT) + - GET_INT_FROM_POINTER(allocImBuf) + - GET_INT_FROM_POINTER(dupImBuf) + - GET_INT_FROM_POINTER(freeImBuf) + - GET_INT_FROM_POINTER(saveiff) + - GET_INT_FROM_POINTER(loadifffile) + - GET_INT_FROM_POINTER(loadiffname) + - GET_INT_FROM_POINTER(testiffname) + - GET_INT_FROM_POINTER(onehalf) + - GET_INT_FROM_POINTER(half_x) + - GET_INT_FROM_POINTER(half_y) + - GET_INT_FROM_POINTER(double_x) + - GET_INT_FROM_POINTER(double_y) + - GET_INT_FROM_POINTER(double_fast_x) + - GET_INT_FROM_POINTER(double_fast_y) + - GET_INT_FROM_POINTER(ispic) + - GET_INT_FROM_POINTER(scaleImBuf) + - GET_INT_FROM_POINTER(scalefastImBuf) + - GET_INT_FROM_POINTER(hnoise) + - GET_INT_FROM_POINTER(hnoisep) + - GET_INT_FROM_POINTER(turbulence) + - GET_INT_FROM_POINTER(turbulence1) + - GET_INT_FROM_POINTER(de_interlace) + - GET_INT_FROM_POINTER(interlace); -} diff --git a/source/blender/blenpluginapi/plugin.DEF b/source/blender/blenpluginapi/plugin.DEF deleted file mode 100644 index ae2692c7cff..00000000000 --- a/source/blender/blenpluginapi/plugin.DEF +++ /dev/null @@ -1,40 +0,0 @@ -LIBRARY -EXPORTS -mallocN -callocN -freeN -mallocT -callocT -freeT -hnoise -hnoisep -turbulence -turbulence1 -allocImBuf -dupImBuf -freeImBuf -converttocmap -saveiff -loadiffmem -loadifffile -loadiffname -testiffname -onehalf -onethird -halflace -half_x -half_y -double_x -double_y -double_fast_x -double_fast_y -ispic -dit2 -dit0 -scaleImBuf -scalefastImBuf -scalefieldImBuf -scalefastfieldImBuf -de_interlace -interlace -gamwarp diff --git a/source/blender/blenpluginapi/plugin.h b/source/blender/blenpluginapi/plugin.h deleted file mode 100644 index d7acb988ccd..00000000000 --- a/source/blender/blenpluginapi/plugin.h +++ /dev/null @@ -1,107 +0,0 @@ -/* Copyright (c) 1999, Not a Number / NeoGeo b.v. - * - * All rights reserved. - * - * Contact: info@blender.org - * Information: http://www.blender.org - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef __PLUGIN_H__ -#define __PLUGIN_H__ - -/** \file blender/blenpluginapi/plugin.h - * \ingroup blpluginapi - */ - -#include "externdef.h" -#include "iff.h" -#include "util.h" -#include "floatpatch.h" - -#define B_PLUGIN_VERSION 6 - -typedef int (*TexDoit)(int, void*, float*, float*, float*, float*); -typedef int (*TexDoitold)(int, void*, float*, float*, float*); -typedef void (*SeqDoit)(void*, float, float, int, int, ImBuf*, ImBuf*, ImBuf*, ImBuf*); - -typedef struct VarStruct { - int type; - char name[16]; - float def, min, max; - char tip[80]; -} VarStruct; - -typedef struct _PluginInfo { - char *name; - char *snames; - - int stypes; - int nvars; - VarStruct *varstr; - float *result; - float *cfra; - - void (*init)(void); - void (*callback)(int); - TexDoit tex_doit; - SeqDoit seq_doit; - - void (*instance_init)(void *); -} PluginInfo; - -LIBEXPORT int plugin_tex_getversion(void); -LIBEXPORT int plugin_seq_getversion(void); -LIBEXPORT void plugin_getinfo(PluginInfo *); - -/* *************** defines for button types ************** */ - -#define CHA 32 -#define INT 96 -#define FLO 128 - -#define TOG (3<<9) -#define NUM (5<<9) -#define LABEL (10<<9) -#define NUMSLI (14<<9) -#define COL (15<<9) - -/* return values (bitfield like) for textures (DNA_texture_types.h) */ -#define TEX_INT 0 -#define TEX_RGB 1 -#define TEX_NOR 2 - -/* *************** API functions ******************** */ - - /* derived from the famous Perlin noise */ -LIBIMPORT float hnoise(float noisesize, float x, float y, float z); - /* the original Perlin noise */ -LIBIMPORT float hnoisep(float noisesize, float x, float y, float z); - - /* soft turbulence */ -LIBIMPORT float turbulence(float noisesize, float x, float y, float z, int depth); - /* hard turbulence */ -LIBIMPORT float turbulence1(float noisesize, float x, float y, float z, int depth); - -#endif /* __PLUGIN_H__ */ - diff --git a/source/blender/blenpluginapi/util.h b/source/blender/blenpluginapi/util.h deleted file mode 100644 index 68f9626ac24..00000000000 --- a/source/blender/blenpluginapi/util.h +++ /dev/null @@ -1,103 +0,0 @@ -/* Copyright (c) 1999, Not a Number / NeoGeo b.v. - * - * All rights reserved. - * - * Contact: info@blender.org - * Information: http://www.blender.org - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/** \file blender/blenpluginapi/util.h - * \ingroup blpluginapi - */ - -#ifndef __UTIL_H__ -#define __UTIL_H__ - -#include <sys/types.h> -#include <stdlib.h> -#include <string.h> -#include "externdef.h" - -#ifndef NULL -#define NULL 0 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef ulong -#define ulong unsigned long -#endif - -#ifndef ushort -#define ushort unsigned short -#endif - -#ifndef uchar -#define uchar unsigned char -#endif - -#ifndef uint -#define uint unsigned int -#endif - -#define MIN2(x,y) ( (x)<(y) ? (x) : (y) ) -#define MIN3(x,y,z) MIN2( MIN2((x),(y)) , (z) ) -#define MIN4(x,y,z,a) MIN2( MIN2((x),(y)) , MIN2((z),(a)) ) - -#define MAX2(x,y) ( (x)>(y) ? (x) : (y) ) -#define MAX3(x,y,z) MAX2( MAX2((x),(y)) , (z) ) -#define MAX4(x,y,z,a) MAX2( MAX2((x),(y)) , MAX2((z),(a)) ) - -#define SWAP(type, a, b) { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; } (void)0 - -#define ABS(x) ((x) < 0 ? -(x) : (x)) -#define FLOOR(x) ((int)(x) - ((x) < 0 && (x) != (int)(x))) -#define CEIL(x) ((int)(x) + ((x) > 0 && (x) != (int)(x))) -#define STEP(a,b) ( (a)>(b) ? (1) : (0) ) -#define CLAMP(val, low, high) ((val>high)?high:((val<low)?low:val)) -#define LERP(t,x0,x1) ((x0) + (t)*((x1)-(x0))) -#define PULSE(a,b,x) (STEP((a),(x)) - STEP((b),(x))) -#define BOXSTEP(a,b,x) CLAMP(((x)-(a))/((b)-(a)),0,1) - -#define PRINT(d, var1) printf(# var1 ":%" # d "\n", var1) -#define PRINT2(d, e, var1, var2) printf(# var1 ":%" # d " " # var2 ":%" # e "\n", var1, var2) -#define PRINT3(d, e, f, var1, var2, var3) printf(# var1 ":%" # d " " # var2 ":%" # e " " # var3 ":%" # f "\n", var1, var2, var3) -#define PRINT4(d, e, f, g, var1, var2, var3, var4) printf(# var1 ":%" # d " " # var2 ":%" # e " " # var3 ":%" # f " " # var4 ":%" # g "\n", var1, var2, var3, var4) - -LIBEXPORT void *mallocN(int len, char *str); -LIBEXPORT void *callocN(int len, char *str); -LIBEXPORT short freeN(void *vmemh); - -LIBEXPORT void *mallocT(int len, char *str); -LIBEXPORT void *callocT(int len, char *str); -LIBEXPORT void freeT(void *vmemh); - -#endif /* __UTIL_H__ */ - diff --git a/source/blender/compositor/intern/COM_WorkScheduler.cpp b/source/blender/compositor/intern/COM_WorkScheduler.cpp index c5a5a585c19..925ff904cc0 100644 --- a/source/blender/compositor/intern/COM_WorkScheduler.cpp +++ b/source/blender/compositor/intern/COM_WorkScheduler.cpp @@ -236,6 +236,7 @@ void WorkScheduler::initialize() cl_int error; error = clGetPlatformIDs(0, 0, &numberOfPlatforms); if (error != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); } + numberOfPlatforms = 0; if (G.f & G_DEBUG) printf("%d number of platforms\n", numberOfPlatforms); cl_platform_id *platforms = new cl_platform_id[numberOfPlatforms]; error = clGetPlatformIDs(numberOfPlatforms, platforms, 0); @@ -257,36 +258,38 @@ void WorkScheduler::initialize() clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, numberOfDevices, cldevices+numberOfDevicesReceived*sizeof (cl_device_id), 0); numberOfDevicesReceived += numberOfDevices; } - context = clCreateContext(NULL, totalNumberOfDevices, cldevices, clContextError, NULL, &error); - if (error != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); } - program = clCreateProgramWithSource(context, 1, &sourcecode, 0, &error); - error = clBuildProgram(program, totalNumberOfDevices, cldevices, 0, 0, 0); - if (error != CL_SUCCESS) { - cl_int error2; - size_t ret_val_size; - printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); - error2 = clGetProgramBuildInfo(program, cldevices[0], CL_PROGRAM_BUILD_LOG, 0, NULL, &ret_val_size); - if (error2 != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); } - char *build_log = new char[ret_val_size+1]; - error2 = clGetProgramBuildInfo(program, cldevices[0], CL_PROGRAM_BUILD_LOG, ret_val_size, build_log, NULL); - if (error2 != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); } - build_log[ret_val_size] = '\0'; - printf("%s", build_log); - delete build_log; - - } - unsigned int indexDevices; - for (indexDevices = 0 ; indexDevices < totalNumberOfDevices ; indexDevices ++) { - cl_device_id device = cldevices[indexDevices]; - OpenCLDevice *clDevice = new OpenCLDevice(context, device, program); - clDevice->initialize(), - gpudevices.push_back(clDevice); - if (G.f & G_DEBUG) { - char resultString[32]; - error = clGetDeviceInfo(device, CL_DEVICE_NAME, 32, resultString, 0); - printf("OPENCL_DEVICE: %s, ", resultString); - error = clGetDeviceInfo(device, CL_DEVICE_VENDOR, 32, resultString, 0); - printf("%s\n", resultString); + if (totalNumberOfDevices > 0) { + context = clCreateContext(NULL, totalNumberOfDevices, cldevices, clContextError, NULL, &error); + if (error != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); } + program = clCreateProgramWithSource(context, 1, &sourcecode, 0, &error); + error = clBuildProgram(program, totalNumberOfDevices, cldevices, 0, 0, 0); + if (error != CL_SUCCESS) { + cl_int error2; + size_t ret_val_size; + printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); + error2 = clGetProgramBuildInfo(program, cldevices[0], CL_PROGRAM_BUILD_LOG, 0, NULL, &ret_val_size); + if (error2 != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); } + char *build_log = new char[ret_val_size+1]; + error2 = clGetProgramBuildInfo(program, cldevices[0], CL_PROGRAM_BUILD_LOG, ret_val_size, build_log, NULL); + if (error2 != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); } + build_log[ret_val_size] = '\0'; + printf("%s", build_log); + delete build_log; + + } + unsigned int indexDevices; + for (indexDevices = 0 ; indexDevices < totalNumberOfDevices ; indexDevices ++) { + cl_device_id device = cldevices[indexDevices]; + OpenCLDevice *clDevice = new OpenCLDevice(context, device, program); + clDevice->initialize(), + gpudevices.push_back(clDevice); + if (G.f & G_DEBUG) { + char resultString[32]; + error = clGetDeviceInfo(device, CL_DEVICE_NAME, 32, resultString, 0); + printf("OPENCL_DEVICE: %s, ", resultString); + error = clGetDeviceInfo(device, CL_DEVICE_VENDOR, 32, resultString, 0); + printf("%s\n", resultString); + } } } delete [] cldevices; diff --git a/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp b/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp index 0daa2b9c08a..db67412f3e7 100644 --- a/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp +++ b/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp @@ -36,9 +36,22 @@ inline void addFilter(float *result, float*input, float value) void ConvolutionEdgeFilterOperation::executePixel(float *color,int x, int y, MemoryBuffer *inputBuffers[], void *data) { float in1[4],in2[4], res1[4], res2[4]; + + int x1 = x - 1; + int x2 = x; + int x3 = x + 1; + int y1 = y - 1; + int y2 = y; + int y3 = y + 1; + CLAMP(x1, 0, getWidth()-1); + CLAMP(x2, 0, getWidth()-1); + CLAMP(x3, 0, getWidth()-1); + CLAMP(y1, 0, getHeight()-1); + CLAMP(y2, 0, getHeight()-1); + CLAMP(y3, 0, getHeight()-1); float value[4]; - this->inputValueOperation->read(value, x, y, inputBuffers, NULL); + this->inputValueOperation->read(value, x2, y2, inputBuffers, NULL); float mval = 1.0f - value[0]; res1[0] = 0.0f; @@ -50,39 +63,39 @@ void ConvolutionEdgeFilterOperation::executePixel(float *color,int x, int y, Mem res2[2] = 0.0f; res2[3] = 0.0f; - this->inputOperation->read(in1, x-1, y-1, inputBuffers, NULL); + this->inputOperation->read(in1, x1, y1, inputBuffers, NULL); addFilter(res1, in1, this->filter[0]); addFilter(res2, in1, this->filter[0]); - this->inputOperation->read(in1, x, y-1, inputBuffers, NULL); + this->inputOperation->read(in1, x2, y1, inputBuffers, NULL); addFilter(res1, in1, this->filter[1]); addFilter(res2, in1, this->filter[3]); - this->inputOperation->read(in1, x+1, y-1, inputBuffers, NULL); + this->inputOperation->read(in1, x3, y1, inputBuffers, NULL); addFilter(res1, in1, this->filter[2]); addFilter(res2, in1, this->filter[6]); - this->inputOperation->read(in1, x-1, y, inputBuffers, NULL); + this->inputOperation->read(in1, x1, y2, inputBuffers, NULL); addFilter(res1, in1, this->filter[3]); addFilter(res2, in1, this->filter[1]); - this->inputOperation->read(in2, x, y, inputBuffers, NULL); + this->inputOperation->read(in2, x2, y2, inputBuffers, NULL); addFilter(res1, in2, this->filter[4]); addFilter(res2, in2, this->filter[4]); - this->inputOperation->read(in1, x+1, y, inputBuffers, NULL); + this->inputOperation->read(in1, x3, y2, inputBuffers, NULL); addFilter(res1, in1, this->filter[5]); addFilter(res2, in1, this->filter[7]); - this->inputOperation->read(in1, x-1, y+1, inputBuffers, NULL); + this->inputOperation->read(in1, x1, y3, inputBuffers, NULL); addFilter(res1, in1, this->filter[6]); addFilter(res2, in1, this->filter[2]); - this->inputOperation->read(in1, x, y+1, inputBuffers, NULL); + this->inputOperation->read(in1, x2, y3, inputBuffers, NULL); addFilter(res1, in1, this->filter[7]); addFilter(res2, in1, this->filter[5]); - this->inputOperation->read(in1, x+1, y+1, inputBuffers, NULL); + this->inputOperation->read(in1, x3, y3, inputBuffers, NULL); addFilter(res1, in1, this->filter[8]); addFilter(res2, in1, this->filter[8]); diff --git a/source/blender/compositor/operations/COM_ConvolutionFilterOperation.cpp b/source/blender/compositor/operations/COM_ConvolutionFilterOperation.cpp index 05cd570feaa..9fec75abafe 100644 --- a/source/blender/compositor/operations/COM_ConvolutionFilterOperation.cpp +++ b/source/blender/compositor/operations/COM_ConvolutionFilterOperation.cpp @@ -22,6 +22,8 @@ #include "COM_ConvolutionFilterOperation.h" +#include "BLI_utildefines.h" + ConvolutionFilterOperation::ConvolutionFilterOperation() : NodeOperation() { this->addInputSocket(COM_DT_COLOR); @@ -73,51 +75,62 @@ void ConvolutionFilterOperation::executePixel(float *color,int x, int y, MemoryB color[3] = 0.0; float in1[4]; float in2[4]; + int x1 = x - 1; + int x2 = x; + int x3 = x + 1; + int y1 = y - 1; + int y2 = y; + int y3 = y + 1; + CLAMP(x1, 0, getWidth()-1); + CLAMP(x2, 0, getWidth()-1); + CLAMP(x3, 0, getWidth()-1); + CLAMP(y1, 0, getHeight()-1); + CLAMP(y2, 0, getHeight()-1); + CLAMP(y3, 0, getHeight()-1); float value[4]; - this->inputValueOperation->read(value, x, y, inputBuffers, NULL); + this->inputValueOperation->read(value, x2, y2, inputBuffers, NULL); float mval = 1.0f - value[0]; - - this->inputOperation->read(in1, x-1, y-1, inputBuffers, NULL); + this->inputOperation->read(in1, x1, y1, inputBuffers, NULL); color[0] += in1[0] * this->filter[0]; color[1] += in1[1] * this->filter[0]; color[2] += in1[2] * this->filter[0]; color[3] += in1[3] * this->filter[0]; - this->inputOperation->read(in1, x, y-1, inputBuffers, NULL); + this->inputOperation->read(in1, x2, y1, inputBuffers, NULL); color[0] += in1[0] * this->filter[1]; color[1] += in1[1] * this->filter[1]; color[2] += in1[2] * this->filter[1]; color[3] += in1[3] * this->filter[1]; - this->inputOperation->read(in1, x+1, y-1, inputBuffers, NULL); + this->inputOperation->read(in1, x3, y1, inputBuffers, NULL); color[0] += in1[0] * this->filter[2]; color[1] += in1[1] * this->filter[2]; color[2] += in1[2] * this->filter[2]; color[3] += in1[3] * this->filter[2]; - this->inputOperation->read(in1, x-1, y, inputBuffers, NULL); + this->inputOperation->read(in1, x1, y2, inputBuffers, NULL); color[0] += in1[0] * this->filter[3]; color[1] += in1[1] * this->filter[3]; color[2] += in1[2] * this->filter[3]; color[3] += in1[3] * this->filter[3]; - this->inputOperation->read(in2, x, y, inputBuffers, NULL); + this->inputOperation->read(in2, x2, y2, inputBuffers, NULL); color[0] += in2[0] * this->filter[4]; color[1] += in2[1] * this->filter[4]; color[2] += in2[2] * this->filter[4]; color[3] += in2[3] * this->filter[4]; - this->inputOperation->read(in1, x+1, y, inputBuffers, NULL); + this->inputOperation->read(in1, x3, y2, inputBuffers, NULL); color[0] += in1[0] * this->filter[5]; color[1] += in1[1] * this->filter[5]; color[2] += in1[2] * this->filter[5]; color[3] += in1[3] * this->filter[5]; - this->inputOperation->read(in1, x-1, y+1, inputBuffers, NULL); + this->inputOperation->read(in1, x1, y3, inputBuffers, NULL); color[0] += in1[0] * this->filter[6]; color[1] += in1[1] * this->filter[6]; color[2] += in1[2] * this->filter[6]; color[3] += in1[3] * this->filter[6]; - this->inputOperation->read(in1, x, y+1, inputBuffers, NULL); + this->inputOperation->read(in1, x2, y3, inputBuffers, NULL); color[0] += in1[0] * this->filter[7]; color[1] += in1[1] * this->filter[7]; color[2] += in1[2] * this->filter[7]; color[3] += in1[3] * this->filter[7]; - this->inputOperation->read(in1, x+1, y+1, inputBuffers, NULL); + this->inputOperation->read(in1, x3, y3, inputBuffers, NULL); color[0] += in1[0] * this->filter[8]; color[1] += in1[1] * this->filter[8]; color[2] += in1[2] * this->filter[8]; @@ -126,6 +139,7 @@ void ConvolutionFilterOperation::executePixel(float *color,int x, int y, MemoryB color[0] = color[0]*value[0] + in2[0] * mval; color[1] = color[1]*value[0] + in2[1] * mval; color[2] = color[2]*value[0] + in2[2] * mval; + color[3] = color[3]*value[0] + in2[3] * mval; } bool ConvolutionFilterOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index 522c387ddcf..dc7bfd6aff2 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -86,7 +86,7 @@ extern struct EnumPropertyItem prop_make_parent_types[]; int ED_object_parent_set(struct ReportList *reports, struct Main *bmain, struct Scene *scene, struct Object *ob, struct Object *par, int partype); void ED_object_parent_clear(struct bContext *C, int type); - +struct Base *ED_object_scene_link(struct ReportList *reports, struct Scene *scene, struct Object *ob); /* generic editmode keys like pet * do_pet diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h index 2d409879ba3..852adc58762 100644 --- a/source/blender/editors/include/UI_resources.h +++ b/source/blender/editors/include/UI_resources.h @@ -154,7 +154,6 @@ enum { TH_SEQ_SCENE, TH_SEQ_AUDIO, TH_SEQ_EFFECT, - TH_SEQ_PLUGIN, TH_SEQ_TRANSITION, TH_SEQ_META, TH_SEQ_PREVIEW, diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index edad33953b9..f4fa88caba0 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -378,8 +378,6 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo cp = ts->audio; break; case TH_SEQ_EFFECT: cp = ts->effect; break; - case TH_SEQ_PLUGIN: - cp = ts->plugin; break; case TH_SEQ_TRANSITION: cp = ts->transition; break; case TH_SEQ_META: @@ -775,7 +773,6 @@ void ui_theme_init_default(void) rgba_char_args_set(btheme->tseq.scene, 78, 152, 62, 255); rgba_char_args_set(btheme->tseq.audio, 46, 143, 143, 255); rgba_char_args_set(btheme->tseq.effect, 169, 84, 124, 255); - rgba_char_args_set(btheme->tseq.plugin, 126, 126, 80, 255); rgba_char_args_set(btheme->tseq.transition, 162, 95, 111, 255); rgba_char_args_set(btheme->tseq.meta, 109, 145, 131, 255); rgba_char_args_set(btheme->tseq.preview_back, 0, 0, 0, 255); @@ -1248,7 +1245,6 @@ void init_userdef_do_versions(void) vDM_ColorBand_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight) : NULL); if (bmain->versionfile <= 191) { - BLI_strncpy(U.plugtexdir, U.textudir, sizeof(U.plugtexdir)); strcpy(U.sounddir, "/"); } @@ -1369,7 +1365,6 @@ void init_userdef_do_versions(void) rgba_char_args_set(btheme->tseq.scene, 78, 152, 62, 255); rgba_char_args_set(btheme->tseq.audio, 46, 143, 143, 255); rgba_char_args_set(btheme->tseq.effect, 169, 84, 124, 255); - rgba_char_args_set(btheme->tseq.plugin, 126, 126, 80, 255); rgba_char_args_set(btheme->tseq.transition, 162, 95, 111, 255); rgba_char_args_set(btheme->tseq.meta, 109, 145, 131, 255); } diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 2b622b21d2c..8657ac3622c 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -1195,33 +1195,45 @@ static void link_to_scene(Main *UNUSED(bmain), unsigned short UNUSED(nr)) } #endif +Base *ED_object_scene_link(ReportList *reports, Scene *scene, Object *ob) +{ + Base *base; + + if (ELEM(NULL, ob, scene)) { + BKE_report(reports, RPT_ERROR, "Couldn't find scene"); + return NULL; + } + + if (BKE_scene_base_find(scene, ob)) { + BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is already in scene \"%s\"", ob->id.name + 2, scene->id.name + 2); + return NULL; + } + + if (scene->id.lib) { + BKE_report(reports, RPT_ERROR, "Can't link objects into a linked scene"); + return NULL; + } + + base = BKE_scene_base_add(scene, ob); + id_us_plus(&ob->id); + + return base; +} + static int make_links_scene_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene_to = BLI_findlink(&CTX_data_main(C)->scene, RNA_enum_get(op->ptr, "scene")); - if (scene_to == NULL) { - BKE_report(op->reports, RPT_ERROR, "Scene not found"); - return OPERATOR_CANCELLED; - } - if (scene_to == CTX_data_scene(C)) { BKE_report(op->reports, RPT_ERROR, "Can't link objects into the same scene"); return OPERATOR_CANCELLED; } - if (scene_to->id.lib) { - BKE_report(op->reports, RPT_ERROR, "Can't link objects into a linked scene"); - return OPERATOR_CANCELLED; - } - CTX_DATA_BEGIN (C, Base *, base, selected_bases) { - if (!BKE_scene_base_find(scene_to, base->object)) { - Base *nbase = MEM_mallocN(sizeof(Base), "newbase"); - *nbase = *base; - BLI_addhead(&(scene_to->base), nbase); - id_us_plus((ID *)base->object); + if (ED_object_scene_link(op->reports, scene_to, base->object) == NULL) { + return OPERATOR_CANCELLED; } } CTX_DATA_END; diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 4c5befda8df..2db808e7a59 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -417,37 +417,6 @@ static void node_browse_tex_cb(bContext *C, void *ntree_v, void *node_v) node->menunr = 0; } #endif -static void node_dynamic_update_cb(bContext *C, void *UNUSED(ntree_v), void *node_v) -{ - Main *bmain = CTX_data_main(C); - Material *ma; - bNode *node = (bNode *)node_v; - ID *id = node->id; - int error = 0; - - if (BTST(node->custom1, NODE_DYNAMIC_ERROR)) error = 1; - - /* Users only have to press the "update" button in one pynode - * and we also update all others sharing the same script */ - for (ma = bmain->mat.first; ma; ma = ma->id.next) { - if (ma->nodetree) { - bNode *nd; - for (nd = ma->nodetree->nodes.first; nd; nd = nd->next) { - if ((nd->type == NODE_DYNAMIC) && (nd->id == id)) { - nd->custom1 = 0; - nd->custom1 = BSET(nd->custom1, NODE_DYNAMIC_REPARSE); - nd->menunr = 0; - if (error) - nd->custom1 = BSET(nd->custom1, NODE_DYNAMIC_ERROR); - } - } - } - } - - // allqueue(REDRAWBUTSSHADING, 0); - // allqueue(REDRAWNODE, 0); - // XXX BIF_preview_changed(ID_MA); -} static void node_buts_texture(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { @@ -1107,34 +1076,6 @@ static void node_common_set_butfunc(bNodeType *ntype) } /* ****************** BUTTON CALLBACKS FOR SHADER NODES ***************** */ - -static void node_browse_text_cb(bContext *C, void *ntree_v, void *node_v) -{ - Main *bmain = CTX_data_main(C); - bNodeTree *ntree = ntree_v; - bNode *node = node_v; - /* ID *oldid; */ /* UNUSED */ - - if (node->menunr < 1) return; - - if (node->id) { - node->id->us--; - } - /* oldid= node->id; */ /* UNUSED */ - node->id = BLI_findlink(&bmain->text, node->menunr - 1); - id_us_plus(node->id); - BLI_strncpy(node->name, node->id->name + 2, sizeof(node->name)); - - node->custom1 = BSET(node->custom1, NODE_DYNAMIC_NEW); - - nodeSetActive(ntree, node); - - // allqueue(REDRAWBUTSSHADING, 0); - // allqueue(REDRAWNODE, 0); - - node->menunr = 0; -} - static void node_shader_buts_material(uiLayout *layout, bContext *C, PointerRNA *ptr) { bNode *node = ptr->data; @@ -1254,45 +1195,6 @@ static void node_shader_buts_glossy(uiLayout *layout, bContext *UNUSED(C), Point uiItemR(layout, ptr, "distribution", 0, "", ICON_NONE); } -static void node_shader_buts_dynamic(uiLayout *layout, bContext *C, PointerRNA *ptr) -{ - Main *bmain = CTX_data_main(C); - uiBlock *block = uiLayoutAbsoluteBlock(layout); - bNode *node = ptr->data; - bNodeTree *ntree = ptr->id.data; - rctf *butr = &node->butr; - uiBut *bt; - // XXX SpaceNode *snode= curarea->spacedata.first; - short dy = (short)butr->ymin; - int xoff = 0; - - /* B_NODE_EXEC is handled in butspace.c do_node_buts */ - if (!node->id) { - const char *strp; - IDnames_to_pupstring(&strp, NULL, "", &(bmain->text), NULL, NULL); - node->menunr = 0; - bt = uiDefButS(block, MENU, B_NODE_EXEC /*+node->nr*/, strp, - butr->xmin, dy, 19, 19, - &node->menunr, 0, 0, 0, 0, "Browses existing choices"); - uiButSetFunc(bt, node_browse_text_cb, ntree, node); - xoff = 19; - if (strp) MEM_freeN((void *)strp); - } - else { - bt = uiDefBut(block, BUT, B_NOP, "Update", - butr->xmin + xoff, butr->ymin + 20, 50, 19, - &node->menunr, 0.0, 19.0, 0, 0, "Refresh this node (and all others that use the same script)"); - uiButSetFunc(bt, node_dynamic_update_cb, ntree, node); - - if (BTST(node->custom1, NODE_DYNAMIC_ERROR)) { - // UI_ThemeColor(TH_REDALERT); - // XXX ui_rasterpos_safe(butr->xmin + xoff, butr->ymin + 5, snode->aspect); - // XXX snode_drawstring(snode, "Error! Check console...", butr->xmax - butr->xmin); - ; - } - } -} - /* only once called */ static void node_shader_set_butfunc(bNodeType *ntype) { @@ -1370,9 +1272,6 @@ static void node_shader_set_butfunc(bNodeType *ntype) case SH_NODE_BSDF_GLASS: ntype->uifunc = node_shader_buts_glossy; break; - case NODE_DYNAMIC: - ntype->uifunc = node_shader_buts_dynamic; - break; } } @@ -2414,7 +2313,7 @@ static void node_composit_buts_keyingscreen(uiLayout *layout, bContext *C, Point static void node_composit_buts_keying(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { - bNode *node= ptr->data; + /* bNode *node= ptr->data; */ /* UNUSED */ uiItemR(layout, ptr, "blur_pre", 0, NULL, ICON_NONE); uiItemR(layout, ptr, "despill_factor", 0, NULL, ICON_NONE); diff --git a/source/blender/editors/space_node/node_header.c b/source/blender/editors/space_node/node_header.c index bb52c1570aa..0d03df2298f 100644 --- a/source/blender/editors/space_node/node_header.c +++ b/source/blender/editors/space_node/node_header.c @@ -157,22 +157,6 @@ static void do_node_add_group(bContext *C, void *UNUSED(arg), int event) do_node_add(C, &ntemp); } -#if 0 /* disabled */ -static void do_node_add_dynamic(bContext *C, void *UNUSED(arg), int event) -{ - Main *bmain = CTX_data_main(C); - Scene *scene = CTX_data_scene(C); - bNodeTemplate ntemp; - - ntemp.type = NODE_DYNAMIC; - - ntemp.main = bmain; - ntemp.scene = scene; - - do_node_add(C, &ntemp); -} -#endif - static int node_tree_has_type(int treetype, int nodetype) { bNodeTreeType *ttype= ntreeGetType(treetype); @@ -228,9 +212,6 @@ static void node_add_menu(bContext *C, uiLayout *layout, void *arg_nodeclass) } } } - else if (nodeclass==NODE_DYNAMIC) { - /* disabled */ - } else { bNodeType *ntype; diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index e29f9647a7b..66919935d48 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -226,11 +226,6 @@ static void node_area_listener(ScrArea *sa, wmNotifier *wmn) ED_area_tag_refresh(sa); } break; - case NC_TEXT: - /* pynodes */ - if (wmn->data==ND_SHADING) - ED_area_tag_refresh(sa); - break; case NC_SPACE: if (wmn->data==ND_SPACE_NODE) ED_area_tag_refresh(sa); diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 0232006829f..79a1e0c7634 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -1426,8 +1426,7 @@ TreeElement *outliner_dropzone_parent(bContext *C, wmEvent *event, TreeElement * /* name and first icon */ if ((fmval[0] > te->xs + UI_UNIT_X) && (fmval[0] < te->xend)) { /* always makes active object */ - if (te->idcode == ID_OB && - !ELEM4(tselem->type, TSE_MODIFIER_BASE, TSE_MODIFIER, TSE_CONSTRAINT_BASE, TSE_CONSTRAINT)) { + if (te->idcode == ID_OB && tselem->type == 0) { return te; } else { @@ -1690,3 +1689,92 @@ void OUTLINER_OT_parent_clear(wmOperatorType *ot) RNA_def_string(ot->srna, "dragged_obj", "Object", MAX_ID_NAME, "Child", "Child Object"); RNA_def_enum(ot->srna, "type", prop_clear_parent_types, 0, "Type", ""); } + +TreeElement *outliner_dropzone_scene(bContext *C, wmEvent *UNUSED(event), TreeElement *te, float *fmval) +{ + SpaceOops *soops = CTX_wm_space_outliner(C); + TreeStoreElem *tselem = TREESTORE(te); + + if ((fmval[1] > te->ys) && (fmval[1] < (te->ys + UI_UNIT_Y))) { + /* name and first icon */ + if ((fmval[0] > te->xs + UI_UNIT_X) && (fmval[0] < te->xend)) { + if (te->idcode == ID_SCE && tselem->type == 0) { + return te; + } + } + } + return NULL; +} + +static int scene_drop_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + Scene *scene = NULL; + Object *ob = NULL; + SpaceOops *soops = CTX_wm_space_outliner(C); + ARegion *ar = CTX_wm_region(C); + Main *bmain = CTX_data_main(C); + TreeElement *te = NULL; + TreeElement *te_found = NULL; + char obname[MAX_ID_NAME]; + float fmval[2]; + + UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]); + + /* Find object hovered over */ + for (te = soops->tree.first; te; te = te->next) { + te_found = outliner_dropzone_scene(C, event, te, fmval); + if (te_found) + break; + } + + if (te_found) { + Base *base; + + RNA_string_set(op->ptr, "scene", te_found->name); + scene = (Scene *)BKE_libblock_find_name(ID_SCE, te_found->name); + + RNA_string_get(op->ptr, "object", obname); + ob = (Object *)BKE_libblock_find_name(ID_OB, obname); + + base = ED_object_scene_link(op->reports, scene, ob); + + if (base == NULL) { + return OPERATOR_CANCELLED; + } + + if (scene == CTX_data_scene(C)) { + /* when linking to an inactive scene don't touch the layer */ + ob->lay = base->lay; + ED_base_object_select(base, BA_SELECT); + } + + DAG_scene_sort(bmain, scene); + DAG_ids_flush_update(bmain, 0); + + WM_main_add_notifier(NC_SCENE | ND_OB_SELECT, scene); + + return OPERATOR_FINISHED; + } + + return OPERATOR_CANCELLED; +} + +void OUTLINER_OT_scene_drop(wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "Drop Object to Scene"; + ot->description = "Drag object to scene in Outliner"; + ot->idname = "OUTLINER_OT_scene_drop"; + + /* api callbacks */ + ot->invoke = scene_drop_invoke; + + ot->poll = ED_operator_outliner_active; + + /* flags */ + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; + + /* properties */ + RNA_def_string(ot->srna, "object", "Object", MAX_ID_NAME, "Object", "Target Object"); + RNA_def_string(ot->srna, "scene", "Scene", MAX_ID_NAME, "Scene", "Target Scene"); +} diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h index f73c031dc7f..5274410214a 100644 --- a/source/blender/editors/space_outliner/outliner_intern.h +++ b/source/blender/editors/space_outliner/outliner_intern.h @@ -190,7 +190,7 @@ void item_rename_cb(struct bContext *C, struct Scene *scene, TreeElement *te, st TreeElement *outliner_dropzone_parent(struct bContext *C, struct wmEvent *event, struct TreeElement *te, float *fmval); int outliner_dropzone_parent_clear(struct bContext *C, struct wmEvent *event, struct TreeElement *te, float *fmval); - +TreeElement *outliner_dropzone_scene(struct bContext *C, struct wmEvent *event, struct TreeElement *te, float *fmval); /* ...................................................... */ void OUTLINER_OT_item_activate(struct wmOperatorType *ot); @@ -220,6 +220,7 @@ void OUTLINER_OT_drivers_delete_selected(struct wmOperatorType *ot); void OUTLINER_OT_parent_drop(struct wmOperatorType *ot); void OUTLINER_OT_parent_clear(struct wmOperatorType *ot); +void OUTLINER_OT_scene_drop(struct wmOperatorType *ot); /* outliner_tools.c ---------------------------------------------- */ diff --git a/source/blender/editors/space_outliner/outliner_ops.c b/source/blender/editors/space_outliner/outliner_ops.c index 12f8f2cb38b..0b3a226cca1 100644 --- a/source/blender/editors/space_outliner/outliner_ops.c +++ b/source/blender/editors/space_outliner/outliner_ops.c @@ -76,6 +76,7 @@ void outliner_operatortypes(void) WM_operatortype_append(OUTLINER_OT_parent_drop); WM_operatortype_append(OUTLINER_OT_parent_clear); + WM_operatortype_append(OUTLINER_OT_scene_drop); } void outliner_keymap(wmKeyConfig *keyconf) diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index 3110ff3e29e..f3f6e3cf49f 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -144,6 +144,35 @@ static void outliner_parent_clear_copy(wmDrag *drag, wmDropBox *drop) RNA_enum_set(drop->ptr, "type", 0); } +static int outliner_scene_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) +{ + ARegion *ar = CTX_wm_region(C); + SpaceOops *soops = CTX_wm_space_outliner(C); + TreeElement *te = NULL; + float fmval[2]; + UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]); + + if (drag->type == WM_DRAG_ID) { + ID *id = (ID *)drag->poin; + if (GS(id->name) == ID_OB) { + /* Ensure item under cursor is valid drop target */ + /* Find object hovered over */ + for (te = soops->tree.first; te; te = te->next) { + if (outliner_dropzone_scene(C, event, te, fmval)) + return 1; + } + } + } + return 0; +} + +static void outliner_scene_drop_copy(wmDrag *drag, wmDropBox *drop) +{ + ID *id = (ID *)drag->poin; + + RNA_string_set(drop->ptr, "object", id->name + 2); +} + /* region dropbox definition */ static void outliner_dropboxes(void) { @@ -151,6 +180,7 @@ static void outliner_dropboxes(void) WM_dropbox_add(lb, "OUTLINER_OT_parent_drop", outliner_parent_drop_poll, outliner_parent_drop_copy); WM_dropbox_add(lb, "OUTLINER_OT_parent_clear", outliner_parent_clear_poll, outliner_parent_clear_copy); + WM_dropbox_add(lb, "OUTLINER_OT_scene_drop", outliner_scene_drop_poll, outliner_scene_drop_copy); } static void outliner_main_area_draw(const bContext *C, ARegion *ar) diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 3861e2670f1..9eb4c62789e 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -740,20 +740,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op) seq->strip = strip = MEM_callocN(sizeof(Strip), "strip"); strip->us = 1; - if (seq->type == SEQ_PLUGIN) { - char path[FILE_MAX]; - RNA_string_get(op->ptr, "filepath", path); - - sh.init_plugin(seq, path); - - if (seq->plugin == NULL) { - BLI_remlink(ed->seqbasep, seq); - seq_free_sequence(scene, seq); - BKE_reportf(op->reports, RPT_ERROR, "Sequencer plugin \"%s\" could not load", path); - return OPERATOR_CANCELLED; - } - } - else if (seq->type == SEQ_COLOR) { + if (seq->type == SEQ_COLOR) { SolidColorVars *colvars = (SolidColorVars *)seq->effectdata; RNA_float_get_array(op->ptr, "color", colvars->col); seq->blend_mode = SEQ_CROSS; /* so alpha adjustment fade to the strip below */ @@ -824,14 +811,7 @@ static int sequencer_add_effect_strip_invoke(bContext *C, wmOperator *op, wmEven sequencer_generic_invoke_xy__internal(C, op, event, prop_flag); - if (is_type_set && type == SEQ_PLUGIN) { - /* only plugins need the file selector */ - WM_event_add_fileselect(C, op); - return OPERATOR_RUNNING_MODAL; - } - else { - return sequencer_add_effect_strip_exec(C, op); - } + return sequencer_add_effect_strip_exec(C, op); } void SEQUENCER_OT_effect_strip_add(struct wmOperatorType *ot) diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 392e7793a0f..236baea01be 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -153,10 +153,6 @@ static void get_seq_color3ubv(Scene *curscene, Sequence *seq, unsigned char col[ col[0] = col[1] = col[2] = 128; } break; - - case SEQ_PLUGIN: - UI_GetThemeColor3ubv(TH_SEQ_PLUGIN, col); - break; case SEQ_SOUND: UI_GetThemeColor3ubv(TH_SEQ_AUDIO, col); @@ -563,22 +559,8 @@ static void draw_seq_text(View2D *v2d, Sequence *seq, float x1, float x2, float seq->len, name, seq->strip->dir, seq->strip->stripdata->name); } else if (seq->type & SEQ_EFFECT) { - int can_float = (seq->type != SEQ_PLUGIN) || (seq->plugin && seq->plugin->version >= 4); - - if (seq->seq3 != seq->seq2 && seq->seq1 != seq->seq3) { - BLI_snprintf(str, sizeof(str), "%d | %s: %d>%d (use %d)%s", - seq->len, name, seq->seq1->machine, seq->seq2->machine, seq->seq3->machine, - can_float ? "" : " No float, upgrade plugin!"); - } - else if (seq->seq1 && seq->seq2) { - BLI_snprintf(str, sizeof(str), "%d | %s: %d>%d%s", - seq->len, name, seq->seq1->machine, seq->seq2->machine, - can_float ? "" : " No float, upgrade plugin!"); - } - else { - BLI_snprintf(str, sizeof(str), "%d | %s", + BLI_snprintf(str, sizeof(str), "%d | %s", seq->len, name); - } } else if (seq->type == SEQ_SOUND) { if (seq->sound) diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 778bddb545a..072cfa00622 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -231,27 +231,6 @@ void seq_rectf(Sequence *seq, rctf *rectf) rectf->ymax = seq->machine + SEQ_STRIP_OFSTOP; } -static void UNUSED_FUNCTION(change_plugin_seq) (Scene * scene, char *str) /* called from fileselect */ -{ - Editing *ed = BKE_sequencer_editing_get(scene, FALSE); - struct SeqEffectHandle sh; - Sequence *last_seq = BKE_sequencer_active_get(scene); - - if (last_seq == NULL || last_seq->type != SEQ_PLUGIN) return; - - sh = get_sequence_effect(last_seq); - sh.free(last_seq); - sh.init_plugin(last_seq, str); - - last_seq->machine = MAX3(last_seq->seq1->machine, - last_seq->seq2->machine, - last_seq->seq3->machine); - - if (seq_test_overlap(ed->seqbasep, last_seq) ) shuffle_seq(ed->seqbasep, last_seq, scene); - -} - - void boundbox_seq(Scene *scene, rctf *rect) { Sequence *seq; diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index c8dbee65f6a..0930edbe46d 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -98,19 +98,14 @@ static int ED_uvedit_ensure_uvs(bContext *C, Scene *scene, Object *obedit) SpaceLink *slink; SpaceImage *sima; - if (ED_uvedit_test(obedit)) { + if (ED_uvedit_test(obedit)) return 1; - } - if (em && em->bm->totface && !CustomData_has_layer(&em->bm->pdata, CD_MTEXPOLY)) { - BM_data_layer_add(em->bm, &em->bm->pdata, CD_MTEXPOLY); - BM_data_layer_add(em->bm, &em->bm->ldata, CD_MLOOPUV); - ED_mesh_uv_loop_reset_ex(C, obedit->data, 0); - } + if (em && em->bm->totface && !CustomData_has_layer(&em->bm->pdata, CD_MTEXPOLY)) + ED_mesh_uv_texture_add(C, obedit->data, NULL, TRUE); - if (!ED_uvedit_test(obedit)) { + if (!ED_uvedit_test(obedit)) return 0; - } ima = CTX_data_edit_image(C); diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h index d79f0a3bf2c..1a68d3c1f09 100644 --- a/source/blender/imbuf/IMB_imbuf.h +++ b/source/blender/imbuf/IMB_imbuf.h @@ -416,8 +416,6 @@ void bilinear_interpolation_color_wrap(struct ImBuf *in, unsigned char *col, flo /** * * \attention defined in readimage.c - * \deprecated Only here for backwards compatibility of the - * \deprecated plugin system. */ struct ImBuf *IMB_loadifffile(int file, int flags, const char *descr); diff --git a/source/blender/imbuf/IMB_imbuf_types.h b/source/blender/imbuf/IMB_imbuf_types.h index 12d71be658e..2cb1dfe149a 100644 --- a/source/blender/imbuf/IMB_imbuf_types.h +++ b/source/blender/imbuf/IMB_imbuf_types.h @@ -55,13 +55,8 @@ struct ImMetaData; * This is the abstraction of an image. ImBuf is the basic type used for all * imbuf operations. * - * REMINDER: if any changes take place, they need to be carried over - * to source/blender/blenpluginapi/iff.h too, OTHERWISE PLUGINS WON'T - * WORK CORRECTLY! - * * Also; add new variables to the end to save pain! * - * Also, that iff.h needs to be in the final release "plugins/include" dir, too! */ typedef struct ImBuf { struct ImBuf *next, *prev; /**< allow lists of ImBufs, for caches or flipbooks */ diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index cd73b692011..b4dc40a81c3 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -101,28 +101,6 @@ typedef struct Strip { StripColorBalance *color_balance; } Strip; - -typedef struct PluginSeq { - char name[1024]; /* 1024 = FILE_MAX */ - void *handle; - - char *pname; - - int vars, version; - - void *varstr; - float *cfra; - - float data[32]; - - void *instance_private_data; - void **current_private_data; - - void (*doit)(void); - - void (*callback)(void); -} PluginSeq; - /* The sequence structure is the basic struct used by any strip. each of the strips uses a different sequence structure.*/ /* WATCH IT: first part identical to ID (for use in ipo's) */ @@ -158,8 +136,6 @@ typedef struct Sequence { float effect_fader; float speed_fader; - PluginSeq *plugin; - /* pointers for effects: */ struct Sequence *seq1, *seq2, *seq3; @@ -339,7 +315,7 @@ typedef struct SpeedControlVars { #define SEQ_GAMCROSS 13 #define SEQ_MUL 14 #define SEQ_OVERDROP 15 -#define SEQ_PLUGIN 24 +// #define SEQ_PLUGIN 24 /* Deprecated */ #define SEQ_WIPE 25 #define SEQ_GLOW 26 #define SEQ_TRANSFORM 27 diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index 7497f5e7449..606c466ac74 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -44,7 +44,6 @@ extern "C" { struct AnimData; struct Ipo; -struct PluginTex; struct ColorBand; struct EnvMap; struct Object; @@ -104,30 +103,6 @@ typedef struct MTex { typedef unsigned short dna_ushort_fix; #endif -typedef struct PluginTex { - char name[1024]; - void *handle; - - char *pname; - char *stnames; - - int stypes; - int vars; - void *varstr; - float *result; - float *cfra; - - float data[32]; - - int (*doit)(void); - void (*instance_init)(void *); - - /* should be void (*)(unsigned short)... patched */ - void (*callback)(dna_ushort_fix); - - int version, pad; -} PluginTex; - typedef struct CBData { float r, g, b, a, pos; int cur; @@ -267,7 +242,6 @@ typedef struct Tex { struct bNodeTree *nodetree; struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */ struct Image *ima; - struct PluginTex *plugin; struct ColorBand *coba; struct EnvMap *env; struct PreviewImage * preview; @@ -324,7 +298,7 @@ typedef struct ColorMapping { #define TEX_STUCCI 6 #define TEX_NOISE 7 #define TEX_IMAGE 8 -#define TEX_PLUGIN 9 +//#define TEX_PLUGIN 9 /* Deprecated */ #define TEX_ENVMAP 10 #define TEX_MUSGRAVE 11 #define TEX_VORONOI 12 diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index b0874eefa4a..be2268aa492 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -237,7 +237,7 @@ typedef struct ThemeSpace { char syntaxv[4], syntaxc[4]; char movie[4], movieclip[4], image[4], scene[4], audio[4]; // for sequence editor - char effect[4], plugin[4], transition[4], meta[4]; + char effect[4], hpad0[4], transition[4], meta[4]; char editmesh_active[4]; char handle_vertex[4]; @@ -334,8 +334,6 @@ typedef struct UserDef { char fontdir[768]; char renderdir[1024]; /* FILE_MAX length */ char textudir[768]; - char plugtexdir[768]; - char plugseqdir[768]; char pythondir[768]; char sounddir[768]; char image_editor[1024]; /* 1024 = FILE_MAX */ diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 842ad4156d8..532f971ad0a 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -394,8 +394,6 @@ extern StructRNA RNA_ParticleSystem; extern StructRNA RNA_ParticleSystemModifier; extern StructRNA RNA_ParticleTarget; extern StructRNA RNA_PivotConstraint; -extern StructRNA RNA_PluginSequence; -extern StructRNA RNA_PluginTexture; extern StructRNA RNA_PointCache; extern StructRNA RNA_PointDensity; extern StructRNA RNA_PointDensityTexture; diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 7ee89028c94..3741d53c378 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -3123,7 +3123,7 @@ int main(int argc, char **argv) return_status = 1; } else { - fprintf(stderr, "Running makesrna"); + fprintf(stderr, "Running makesrna\n"); makesrna_path = argv[0]; return_status = rna_preprocess(argv[1]); } diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 7eb0bdf75df..7daa0d97834 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -1061,7 +1061,7 @@ static char *rna_VertexGroupElement_path(PointerRNA *ptr) for (a = 0, dvert = me->dvert; a < me->totvert; a++, dvert++) for (b = 0; b < dvert->totweight; b++) if (dw == &dvert->dw[b]) - return BLI_sprintfN("verts[%d].groups[%d]", a, b); + return BLI_sprintfN("vertices[%d].groups[%d]", a, b); return NULL; } @@ -1703,6 +1703,12 @@ static void rna_def_mloopuv(BlenderRNA *brna) "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshUVLoopLayer_data_length", NULL, NULL, NULL); + prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); + RNA_def_struct_name_property(srna, prop); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Name", "Name of UV map"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + srna = RNA_def_struct(brna, "MeshUVLoop", NULL); RNA_def_struct_sdna(srna, "MLoopUV"); RNA_def_struct_path_func(srna, "rna_MeshUVLoop_path"); @@ -2152,7 +2158,7 @@ void rna_def_texmat_common(StructRNA *srna, const char *texspace_editable) prop = RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "loc"); - RNA_def_property_ui_text(prop, "Texure Space Location", "Texture space location"); + RNA_def_property_ui_text(prop, "Texture Space Location", "Texture space location"); RNA_def_property_float_funcs(prop, "rna_Mesh_texspace_loc_get", NULL, NULL); RNA_def_property_editable_func(prop, texspace_editable); RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 8cd56983d6c..8604fa0ef31 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -1069,15 +1069,7 @@ static void alloc_node_type_items(EnumPropertyItem *items, int category) item++; } } - - item->value = NODE_DYNAMIC; - item->identifier = "SCRIPT"; - item->icon = 0; - item->name = "Script"; - item->description = ""; - - item++; - + item->value = NODE_GROUP; item->identifier = "GROUP"; item->icon = 0; diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index a3c309625f3..9082bb42be5 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -998,7 +998,6 @@ static void rna_def_sequence(BlenderRNA *brna) {SEQ_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""}, {SEQ_MUL, "MULTIPLY", 0, "Multiply", ""}, {SEQ_OVERDROP, "OVER_DROP", 0, "Over Drop", ""}, - {SEQ_PLUGIN, "PLUGIN", 0, "Plugin", ""}, {SEQ_WIPE, "WIPE", 0, "Wipe", ""}, {SEQ_GLOW, "GLOW", 0, "Glow", ""}, {SEQ_TRANSFORM, "TRANSFORM", 0, "Transform", ""}, @@ -1375,7 +1374,7 @@ static void rna_def_effect_inputs(StructRNA *srna, int count) } /* - if (count == 3) { // not used by any effects ...except maybe plugins? + if (count == 3) { // not used by any effects (perhaps one day plugins?) prop = RNA_def_property(srna, "input_3", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "seq3"); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL); diff --git a/source/blender/makesrna/intern/rna_sequencer_api.c b/source/blender/makesrna/intern/rna_sequencer_api.c index 4d471ae4b41..bdbd153b1e2 100644 --- a/source/blender/makesrna/intern/rna_sequencer_api.c +++ b/source/blender/makesrna/intern/rna_sequencer_api.c @@ -413,7 +413,6 @@ void RNA_api_sequences(BlenderRNA *brna, PropertyRNA *cprop) {SEQ_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""}, {SEQ_MUL, "MULTIPLY", 0, "Multiply", ""}, {SEQ_OVERDROP, "OVER_DROP", 0, "Over Drop", ""}, - // {SEQ_PLUGIN, "PLUGIN", 0, "Plugin", ""}, {SEQ_WIPE, "WIPE", 0, "Wipe", ""}, {SEQ_GLOW, "GLOW", 0, "Glow", ""}, {SEQ_TRANSFORM, "TRANSFORM", 0, "Transform", ""}, diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 646f9846e58..9b709e9ace1 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -68,7 +68,6 @@ EnumPropertyItem texture_type_items[] = { {TEX_MUSGRAVE, "MUSGRAVE", ICON_TEXTURE, "Musgrave", "Procedural - highly flexible fractal noise texture"}, {TEX_NOISE, "NOISE", ICON_TEXTURE, "Noise", "Procedural - random noise, gives a different result every time, for every frame, for every pixel"}, - /*{TEX_PLUGIN, "PLUGIN", ICON_PLUGIN, "Plugin", ""}, *//* Nothing yet */ {TEX_POINTDENSITY, "POINT_DENSITY", ICON_TEXTURE, "Point Density", ""}, {TEX_STUCCI, "STUCCI", ICON_TEXTURE, "Stucci", "Procedural - create a fractal noise texture"}, {TEX_VORONOI, "VORONOI", ICON_TEXTURE, "Voronoi", "Procedural - create cell-like patterns based on Worley noise"}, diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt index d07d00a436d..43c3c652bbc 100644 --- a/source/blender/nodes/CMakeLists.txt +++ b/source/blender/nodes/CMakeLists.txt @@ -124,7 +124,6 @@ set(SRC shader/nodes/node_shader_camera.c shader/nodes/node_shader_common.c shader/nodes/node_shader_curves.c - shader/nodes/node_shader_dynamic.c shader/nodes/node_shader_gamma.c shader/nodes/node_shader_brightness.c shader/nodes/node_shader_geom.c diff --git a/source/blender/nodes/shader/node_shader_util.c b/source/blender/nodes/shader/node_shader_util.c index 5961c2b330b..9aa3c76e0a5 100644 --- a/source/blender/nodes/shader/node_shader_util.c +++ b/source/blender/nodes/shader/node_shader_util.c @@ -88,7 +88,7 @@ void ntreeShaderGetTexcoMode(bNodeTree *ntree, int r_mode, short *texco, int *mo if (node->type==SH_NODE_TEXTURE) { if ((r_mode & R_OSA) && node->id) { Tex *tex= (Tex *)node->id; - if (ELEM3(tex->type, TEX_IMAGE, TEX_PLUGIN, TEX_ENVMAP)) { + if (ELEM(tex->type, TEX_IMAGE, TEX_ENVMAP)) { *texco |= TEXCO_OSA|NEED_UV; } } diff --git a/source/blender/nodes/shader/nodes/node_shader_dynamic.c b/source/blender/nodes/shader/nodes/node_shader_dynamic.c deleted file mode 100644 index b441545441a..00000000000 --- a/source/blender/nodes/shader/nodes/node_shader_dynamic.c +++ /dev/null @@ -1,798 +0,0 @@ -/* - * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) 2007 Blender Foundation. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): Nathan Letwory - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/** \file blender/nodes/shader/nodes/node_shader_dynamic.c - * \ingroup shdnodes - */ - - -/* TODO, support python3.x */ -#undef WITH_PYTHON - -#ifdef WITH_PYTHON -#include <Python.h> -#include <compile.h> -#include <eval.h> -#endif - -#include "DNA_text_types.h" -#include "BKE_text.h" - - -// XXX -#if 0 -#ifdef WITH_PYTHON -#include "api2_2x/Node.h" -#include "api2_2x/gen_utils.h" -#include "BPY_extern.h" -#endif -#endif - -#include "node_shader_util.h" - -// XXX -#if 0 -static void node_dynamic_setup(bNode *node); -static void node_dynamic_exec_cb(void *data, bNode *node, bNodeStack **in, bNodeStack **out); -static void node_dynamic_free_storage_cb(bNode *node); - -#ifdef WITH_PYTHON -static PyObject *init_dynamicdict(void) -{ - PyObject *newscriptdict, *item; - PyGILState_STATE gilstate = PyGILState_Ensure(); - - newscriptdict= PyDict_New(); - - PyDict_SetItemString(newscriptdict, "__builtins__", PyEval_GetBuiltins()); - item= PyString_FromString("__main__"); - PyDict_SetItemString(newscriptdict, "__name__", item); - Py_DECREF(item); - - PyGILState_Release(gilstate); - - return newscriptdict; -} -#endif - -static bNodeType *node_dynamic_find_typeinfo(ListBase *list, ID *id) -{ - bNodeType *ntype = list->first; - - while (ntype) { - if (ntype->type == NODE_DYNAMIC && ntype->id == id) - break; - ntype = ntype->next; - } - - return ntype; /* NULL if doesn't exist */ -} - -static void node_dynamic_free_typeinfo_sockets(bNodeType *tinfo) -{ - bNodeSocketTemplate *sock; - - if (!tinfo) return; - - if (tinfo->inputs) { - sock = tinfo->inputs; - while (sock->type != -1) { - MEM_freeN(sock->name); - sock++; - } - MEM_freeN(tinfo->inputs); - tinfo->inputs = NULL; - } - if (tinfo->outputs) { - sock = tinfo->outputs; - while (sock->type != -1) { - MEM_freeN(sock->name); - sock++; - } - MEM_freeN(tinfo->outputs); - tinfo->outputs = NULL; - } -} - -static void node_dynamic_free_typeinfo(bNodeType *tinfo) -{ - if (!tinfo) return; - - node_dynamic_free_typeinfo_sockets(tinfo); - - if (tinfo->name) { MEM_freeN(tinfo->name); } - - MEM_freeN(tinfo); -} - -static void node_dynamic_free_sockets(bNode *node) -{ - BLI_freelistN(&node->inputs); - BLI_freelistN(&node->outputs); -} - -/* For now we just remove the socket links. It's the safest - * route, since an update in the script may change completely the - * inputs and outputs. Trying to recreate the node links would be - * nicer for pynode authors, though. */ -static void node_dynamic_update_socket_links(bNode *node, bNodeTree *ntree) -{ - if (ntree) { - nodeVerifyType(ntree, node); - } - else { - Material *ma; - - for (ma= G.main->mat.first; ma; ma= ma->id.next) { - if (ma->nodetree) { - bNode *nd; - for (nd= ma->nodetree->nodes.first; nd; nd = nd->next) { - if (nd == node) nodeVerifyType(ma->nodetree, node); - } - } - } - } -} - -static void node_dynamic_free_storage_cb(bNode *node) -{ -#ifdef WITH_PYTHON - NodeScriptDict *nsd; - PyObject *pydict; - BPy_Node *pynode; - - if (!node->storage) return; - nsd = (NodeScriptDict *)(node->storage); - pydict = nsd->dict; - if (pydict) { - Py_DECREF(pydict); - } - pynode = nsd->node; - if (pynode) { - Py_DECREF(pynode); - } -#endif - MEM_freeN(node->storage); - node->storage = NULL; -} - -/* Disable pynode when its script fails */ -static void node_dynamic_disable(bNode *node) -{ - node->custom1 = 0; - node->custom1 = BSET(node->custom1, NODE_DYNAMIC_ERROR); -} - -/* Disable all pynodes using the given text (script) id */ -static void node_dynamic_disable_all_by_id(ID *id) -{ -#ifdef WITH_PYTHON - Material *ma; /* XXX hardcoded for shaders */ - - for (ma= G.main->mat.first; ma; ma= ma->id.next) { - if (ma->nodetree) { - bNode *nd; - bNodeTree *ntree = ma->nodetree; - for (nd= ntree->nodes.first; nd; nd= nd->next) { - if (nd->id == id) { - nd->custom1 = 0; - nd->custom1 = BSET(nd->custom1, NODE_DYNAMIC_ERROR); - } - } - } - } -#endif -} - -static void node_rem_socklist_links(bNodeTree *ntree, ListBase *lb) -{ - bNodeLink *link, *next; - bNodeSocket *sock; - - if (!lb) return; - - for (sock= lb->first; sock; sock= sock->next) { - for (link= ntree->links.first; link; link= next) { - next= link->next; - if (link->fromsock==sock || link->tosock==sock) { - nodeRemLink(ntree, link); - } - } - } -} - -/* XXX hardcoded for shaders */ -static void node_dynamic_rem_all_links(bNodeType *tinfo) -{ - Material *ma; - int in, out; - - in = tinfo->inputs ? 1 : 0; - out = tinfo->outputs ? 1 : 0; - - if (!in && !out) return; - - for (ma= G.main->mat.first; ma; ma= ma->id.next) { - if (ma->nodetree) { - bNode *nd; - bNodeTree *ntree = ma->nodetree; - for (nd= ntree->nodes.first; nd; nd= nd->next) { - if (nd->typeinfo == tinfo) { - if (in) - node_rem_socklist_links(ntree, &nd->inputs); - if (out) - node_rem_socklist_links(ntree, &nd->outputs); - } - } - } - } -} - -/* node_dynamic_reset: clean a pynode, getting rid of all - * data dynamically created for it. */ -static void node_dynamic_reset(bNode *node, int BKE_text_unlink) -{ - bNodeType *tinfo, *tinfo_default; - Material *ma; - - tinfo = node->typeinfo; - tinfo_default = node_dynamic_find_typeinfo(&node_all_shaders, NULL); - - if ((tinfo == tinfo_default) && BKE_text_unlink) { - ID *textID = node->id; - /* already at default (empty) state, which happens if this node's - * script failed to parse at the first stage: definition. We're here - * because its text was removed from Blender. */ - for (ma= G.main->mat.first; ma; ma= ma->id.next) { - if (ma->nodetree) { - bNode *nd; - for (nd= ma->nodetree->nodes.first; nd; nd = nd->next) { - if (nd->id == textID) { - nd->id = NULL; - nd->custom1 = 0; - nd->custom1 = BSET(nd->custom1, NODE_DYNAMIC_NEW); - BLI_strncpy(nd->name, "Dynamic", 8); - return; - } - } - } - } - } - - node_dynamic_rem_all_links(tinfo); - node_dynamic_free_typeinfo_sockets(tinfo); - - /* reset all other XXX shader nodes sharing this typeinfo */ - for (ma= G.main->mat.first; ma; ma= ma->id.next) { - if (ma->nodetree) { - bNode *nd; - for (nd= ma->nodetree->nodes.first; nd; nd = nd->next) { - if (nd->typeinfo == tinfo) { - node_dynamic_free_storage_cb(nd); - node_dynamic_free_sockets(nd); - //node_dynamic_update_socket_links(nd, ma->nodetree); - nd->typeinfo = tinfo_default; - if (BKE_text_unlink) { - nd->id = NULL; - nd->custom1 = 0; - nd->custom1 = BSET(nd->custom1, NODE_DYNAMIC_NEW); - BLI_strncpy(nd->name, "Dynamic", 8); - } - } - } - } - } - - /* XXX hardcoded for shaders: */ - if (tinfo->id) { BLI_remlink(&node_all_shaders, tinfo); } - node_dynamic_free_typeinfo(tinfo); -} - -/* Special case of the above function: for working pynodes - * that were saved on a .blend but fail for some reason when - * the file is opened. We need this because pynodes are initialized - * before G.main. */ -static void node_dynamic_reset_loaded(bNode *node) -{ - bNodeType *tinfo = node->typeinfo; - - node_dynamic_rem_all_links(tinfo); - node_dynamic_free_typeinfo_sockets(tinfo); - node_dynamic_free_storage_cb(node); - /* XXX hardcoded for shaders: */ - if (tinfo->id) { BLI_remlink(&node_all_shaders, tinfo); } - - node_dynamic_free_typeinfo(tinfo); - node->typeinfo = node_dynamic_find_typeinfo(&node_all_shaders, NULL); -} - -int nodeDynamicUnlinkText(ID *txtid) -{ - Material *ma; - bNode *nd; - - /* find one node that uses this text */ - for (ma= G.main->mat.first; ma; ma= ma->id.next) { - if (ma->nodetree) { - for (nd= ma->nodetree->nodes.first; nd; nd = nd->next) { - if ((nd->type == NODE_DYNAMIC) && (nd->id == txtid)) { - node_dynamic_reset(nd, 1); /* found, reset all */ - return 1; - } - } - } - } - return 0; /* no pynodes used this text */ -} - -static void node_dynamic_pyerror_print(bNode *node) -{ -#ifdef WITH_PYTHON - PyGILState_STATE gilstate = PyGILState_Ensure(); - - fprintf(stderr, "\nError in dynamic node script \"%s\":\n", node->name); - if (PyErr_Occurred()) { - PyErr_Print(); - PyErr_Clear(); - PySys_SetObject("last_traceback", NULL); - } - else { fprintf(stderr, "Not a valid dynamic node Python script.\n"); } - - PyGILState_Release(gilstate); -#endif -} - -static void node_dynamic_register_type(bNode *node) -{ - nodeRegisterType(&node_all_shaders, node->typeinfo); - /* nodeRegisterType copied it to a new one, so we - * free the typeinfo itself, but not what it - * points to: */ - MEM_freeN(node->typeinfo); - node->typeinfo = node_dynamic_find_typeinfo(&node_all_shaders, node->id); - MEM_freeN(node->typeinfo->name); - node->typeinfo->name = BLI_strdup(node->name); -} - -#ifdef WITH_PYTHON -/* node_dynamic_get_pynode: - * Find the pynode definition from the script */ -static PyObject *node_dynamic_get_pynode(PyObject *dict) -{ - PyObject *key= NULL; - Py_ssize_t pos = 0; - PyObject *value = NULL; - - /* script writer specified a node? */ - value = PyDict_GetItemString(dict, "__node__"); - - if (value) { - if (PyObject_TypeCheck(value, &PyType_Type)) { - Py_INCREF(value); - return value; - } - else { - PyErr_SetString(PyExc_TypeError, - "expected class object derived from Scripted node"); - return NULL; - } - } - - /* case not, search for it in the script's global dictionary */ - while (PyDict_Next(dict, &pos, &key, &value)) { - /* skip names we know belong to other available objects */ - if (strcmp("Socket", PyString_AsString(key)) == 0) - continue; - else if (strcmp("Scripted", PyString_AsString(key)) == 0) - continue; - /* naive: we grab the first ob of type 'type': */ - else if (PyObject_TypeCheck(value, &PyType_Type)) { - Py_INCREF(value); - return value; - } - } - - PyErr_SetString(PyExc_TypeError, - "no PyNode definition found in the script!"); - return NULL; -} -#endif /* WITH_PYTHON */ - -static int node_dynamic_parse(struct bNode *node) -{ -#ifndef WITH_PYTHON - return -1; -#else - PyObject *dict= NULL; - PyObject *pynode_data= NULL; - PyObject *pynode= NULL; - PyObject *args= NULL; - NodeScriptDict *nsd = NULL; - PyObject *pyresult = NULL; - char *buf = NULL; - int is_valid_script = 0; - PyGILState_STATE gilstate; - - if (!node->id || !node->storage) - return 0; - - /* READY, no need to be here */ - if (BTST(node->custom1, NODE_DYNAMIC_READY)) - return 0; - - /* for threading */ - gilstate = PyGILState_Ensure(); - - nsd = (NodeScriptDict *)node->storage; - - dict = (PyObject *)(nsd->dict); - buf = txt_to_buf((Text *)node->id); - - pyresult = PyRun_String(buf, Py_file_input, dict, dict); - - MEM_freeN(buf); - - if (!pyresult) { - if (BTST(node->custom1, NODE_DYNAMIC_LOADED)) { - node_dynamic_disable(node); - } - else { - node_dynamic_disable_all_by_id(node->id); - } - node_dynamic_pyerror_print(node); - PyGILState_Release(gilstate); - return -1; - } - - Py_DECREF(pyresult); - - pynode_data = node_dynamic_get_pynode(dict); - - if (pynode_data) { - BPy_NodeSocketLists *socklists = Node_CreateSocketLists(node); - - args = Py_BuildValue("(O)", socklists); - - /* init it to get the input and output sockets */ - pynode = PyObject_Call(pynode_data, args, NULL); - - Py_DECREF(pynode_data); - Py_DECREF(socklists); - Py_DECREF(args); - - if (!PyErr_Occurred() && pynode && pytype_is_pynode(pynode)) { - InitNode((BPy_Node *)(pynode), node); - nsd->node = pynode; - node->typeinfo->execfunc = node_dynamic_exec_cb; - is_valid_script = 1; - - /* for NEW, LOADED, REPARSE */ - if (BNTST(node->custom1, NODE_DYNAMIC_ADDEXIST)) { - node->typeinfo->pydict = dict; - node->typeinfo->pynode = pynode; - node->typeinfo->id = node->id; - if (BNTST(node->custom1, NODE_DYNAMIC_LOADED)) - nodeAddSockets(node, node->typeinfo); - if (BNTST(node->custom1, NODE_DYNAMIC_REPARSE)) - node_dynamic_register_type(node); - } - - node->custom1 = 0; - node->custom1 = BSET(node->custom1, NODE_DYNAMIC_READY); - } - } - - PyGILState_Release(gilstate); - - if (!is_valid_script) { /* not a valid pynode script */ - node_dynamic_disable_all_by_id(node->id); - node_dynamic_pyerror_print(node); - return -1; - } - - return 0; -#endif -} - -/* node_dynamic_setup: prepare for execution (state: NODE_DYNAMIC_READY) - * pynodes already linked to a script (node->id != NULL). */ -static void node_dynamic_setup(bNode *node) -{ -#ifdef WITH_PYTHON - NodeScriptDict *nsd = NULL; - bNodeTree *nodetree = NULL; - bNodeType *ntype = NULL; - PyGILState_STATE gilstate; - - /* Possible cases: - * NEW - * ADDEXIST - * LOADED - * REPARSE - * ERROR - * READY - */ - - /* NEW, but not linked to a script: link default (empty) typeinfo */ - if (!node->id) { - node->typeinfo = node_dynamic_find_typeinfo(&node_all_shaders, - NULL); - return; - } - - /* READY, no need to be here */ - if (BTST(node->custom1, NODE_DYNAMIC_READY)) - return; - - gilstate = PyGILState_Ensure(); - - /* ERROR, reset to (empty) defaults */ - if (BCLR(node->custom1, NODE_DYNAMIC_ERROR) == 0) { - node_dynamic_reset(node, 0); - PyGILState_Release(gilstate); - return; - } - - /* User asked to update this pynode, prepare it for reparsing */ - if (BTST(node->custom1, NODE_DYNAMIC_REPARSE)) { - int needs_parsing = 1; - - node->custom1 = BSET(node->custom1, NODE_DYNAMIC_NEW); - - if (BTST(node->custom1, NODE_DYNAMIC_ERROR)) { - node->custom1 = BCLR(node->custom1, NODE_DYNAMIC_REPARSE); - ntype = node_dynamic_find_typeinfo(&node_all_shaders, node->id); - - if (ntype) { - node->typeinfo = ntype; - node->custom1 = BSET(node->custom1, NODE_DYNAMIC_ADDEXIST); - node->custom1 = BCLR(node->custom1, NODE_DYNAMIC_ERROR); - needs_parsing = 0; - } - else { nodeMakeDynamicType(node); } - - } - else { - node_dynamic_rem_all_links(node->typeinfo); - node_dynamic_free_typeinfo_sockets(node->typeinfo); - node_dynamic_update_socket_links(node, NULL); - node_dynamic_free_storage_cb(node); - } - - if (needs_parsing) { - nsd = MEM_callocN(sizeof(NodeScriptDict), "node script dictionary"); - nsd->dict = init_dynamicdict(); - node->storage = nsd; - /* prepared, now reparse: */ - node_dynamic_parse(node); - PyGILState_Release(gilstate); - return; - } - } - else if (BTST(node->custom1, NODE_DYNAMIC_LOADED)) { - /* when loading from a .blend we don't have G.main yet, so we - * quickly abuse node->storage in ntreeInitTypes (node.c) to have - * our nodetree ptr (needed if a pynode script that worked before - * saving the .blend for some reason fails upon loading): */ - nodetree = (bNodeTree *)node->storage; - node->storage = NULL; - } - - if (node->storage) - fprintf(stderr, "\nDEBUG: PYNODES ERROR: non NULL node->storage in node_dynamic_setup()\n"); - - nsd = MEM_callocN(sizeof(NodeScriptDict), "node script dictionary"); - node->storage = nsd; - - /* NEW, LOADED or REPARSE */ - if (BNTST(node->custom1, NODE_DYNAMIC_ADDEXIST)) { - /* check if there's already a bNodeType linked to this script */ - /* (XXX hardcoded for shader nodes for now) */ - ntype = node_dynamic_find_typeinfo(&node_all_shaders, node->id); - - if (ntype) { /* if so, reuse it */ - node->typeinfo = ntype; - /* so this is actually an ADDEXIST type */ - node->custom1 = BSET(node->custom1, NODE_DYNAMIC_ADDEXIST); - } - else { /* create bNodeType for this pynode */ - nodeMakeDynamicType(node); - nsd->dict = init_dynamicdict(); - if ((node_dynamic_parse(node) == -1) && nodetree) { - node_dynamic_reset_loaded(node); - } - PyGILState_Release(gilstate); - return; - } - } - - /* ADDEXIST: new pynode linked to an already registered dynamic type, - * we just reuse existing py dict and pynode */ - nsd->dict = node->typeinfo->pydict; - nsd->node = node->typeinfo->pynode; - - Py_INCREF((PyObject *)(nsd->dict)); - Py_INCREF((PyObject *)(nsd->node)); - - if (BTST(node->custom1, NODE_DYNAMIC_NEW)) { - nodeAddSockets(node, node->typeinfo); - node->custom1 = BCLR(node->custom1, NODE_DYNAMIC_NEW); - } - - node->custom1 = BCLR(node->custom1, NODE_DYNAMIC_ADDEXIST); - node->custom1 = BSET(node->custom1, NODE_DYNAMIC_READY); - - PyGILState_Release(gilstate); -#endif /* WITH_PYTHON */ - return; -} - -/* node_dynamic_init_cb callback: called when a pynode is created. - * The pynode type is passed via node->custom2. It can be: - * 0: for loaded empty nodes - * NODE_DYNAMIC_MENU: for the default Dynamic node type - * > NODE_DYNAMIC_MENU: for the new types defined by scripts - */ -static void node_dynamic_init_cb(bNode *node) -{ - int type = node->custom2; - - node->custom2 = 0; - - if (type >= NODE_DYNAMIC_MENU) { - node->custom1 = 0; - - if (type == NODE_DYNAMIC_MENU) { - node->custom1 = BSET(node->custom1, NODE_DYNAMIC_NEW); - return; - } - - node->custom1 = BSET(node->custom1, NODE_DYNAMIC_ADDEXIST); - node->id = node->typeinfo->id; - } - - node_dynamic_setup(node); -} - -/* node_dynamic_copy_cb: pynode copy callback */ -static void node_dynamic_copy_cb(bNode *orig_node, bNode *new_node) -{ -#ifndef WITH_PYTHON - return; -#else - NodeScriptDict *nsd; - PyGILState_STATE gilstate; - - if (!orig_node->storage) return; - - nsd = (NodeScriptDict *)(orig_node->storage); - new_node->storage = MEM_dupallocN(orig_node->storage); - - gilstate = PyGILState_Ensure(); - - if (nsd->node) - Py_INCREF((PyObject *)(nsd->node)); - if (nsd->dict) - Py_INCREF((PyObject *)(nsd->dict)); - - PyGILState_Release(gilstate); -#endif -} - -/* node_dynamic_exec_cb: the execution callback called per pixel - * during rendering. */ -static void node_dynamic_exec_cb(void *data, bNode *node, bNodeStack **in, bNodeStack **out) -{ -#ifndef WITH_PYTHON - return; -#else - BPy_Node *mynode = NULL; - NodeScriptDict *nsd = NULL; - PyObject *pyresult = NULL; - PyObject *args = NULL; - ShadeInput *shi; - PyGILState_STATE gilstate; - - if (!node->id) - return; - -#if 0 - if (G.scene->r.threads > 1) - return; -#endif - - if (BTST2(node->custom1, NODE_DYNAMIC_NEW, NODE_DYNAMIC_REPARSE)) { - node_dynamic_setup(node); - return; - } - - if (BTST(node->custom1, NODE_DYNAMIC_ERROR)) { - if (node->storage) node_dynamic_setup(node); - return; - } - - if (BTST(node->custom1, NODE_DYNAMIC_READY)) { - nsd = (NodeScriptDict *)node->storage; - mynode = (BPy_Node *)(nsd->node); - - - if (mynode && PyCallable_Check((PyObject *)mynode)) { - - gilstate = PyGILState_Ensure(); - - mynode->node = node; - shi = ((ShaderCallData *)data)->shi; - - Node_SetStack(mynode, in, NODE_INPUTSTACK); - Node_SetStack(mynode, out, NODE_OUTPUTSTACK); - Node_SetShi(mynode, shi); - - args=Py_BuildValue("()"); - pyresult= PyObject_Call((PyObject *)mynode, args, NULL); - Py_DECREF(args); - - if (!pyresult) { - PyGILState_Release(gilstate); - node_dynamic_disable_all_by_id(node->id); - node_dynamic_pyerror_print(node); - node_dynamic_setup(node); - return; - } - Py_DECREF(pyresult); - PyGILState_Release(gilstate); - } - } -#endif -} - -void register_node_type_sh_dynamic(bNodeTreeType *ttype) -{ - static bNodeType ntype; - - node_type_base(ttype, &ntype, NODE_DYNAMIC, "Dynamic", NODE_CLASS_OP_DYNAMIC, NODE_OPTIONS, NULL, NULL); - node_type_compatibility(&ntype, NODE_OLD_SHADING); - node_type_size(&ntype, 150, 60, 300); - node_type_init(&ntype, node_dynamic_init_cb); - node_type_storage(&ntype, "NodeScriptDict", node_dynamic_free_storage_cb, node_dynamic_copy_cb); - node_type_exec(&ntype, node_dynamic_exec_cb); - - nodeRegisterType(ttype, &ntype); -} - -#else - -void register_node_type_sh_dynamic(bNodeTreeType *ttype) -{ - static bNodeType ntype; - - node_type_base(ttype, &ntype, NODE_DYNAMIC, "Dynamic", NODE_CLASS_OP_DYNAMIC, 0); - node_type_compatibility(&ntype, NODE_OLD_SHADING); - - nodeRegisterType(ttype, &ntype); -} - -#endif diff --git a/source/blender/nodes/shader/nodes/node_shader_light_falloff.c b/source/blender/nodes/shader/nodes/node_shader_light_falloff.c index 8ee0f0adef6..18225588059 100644 --- a/source/blender/nodes/shader/nodes/node_shader_light_falloff.c +++ b/source/blender/nodes/shader/nodes/node_shader_light_falloff.c @@ -30,8 +30,8 @@ /* **************** INPUT ********************* */ static bNodeSocketTemplate sh_node_light_falloff_in[]= { - { SOCK_FLOAT, 0, "Strength", 100.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, - { SOCK_FLOAT, 0, "Smooth", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, + { SOCK_FLOAT, 0, "Strength", 100.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1000000.0f}, + { SOCK_FLOAT, 0, "Smooth", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1000.0f}, { -1, 0, "" } }; diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index 16b6eddaa29..5c45be3f03a 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -54,7 +54,6 @@ #include "BKE_colortools.h" #include "BKE_image.h" #include "BKE_node.h" -#include "BKE_plugin_types.h" #include "BKE_animsys.h" #include "BKE_DerivedMesh.h" @@ -103,13 +102,6 @@ static void init_render_texture(Render *re, Tex *tex) BKE_image_user_frame_calc(&tex->iuser, cfra, re?re->flag & R_SEC_FIELD:0); } - if (tex->type==TEX_PLUGIN) { - if (tex->plugin && tex->plugin->doit) { - if (tex->plugin->cfra) { - *(tex->plugin->cfra)= (float)cfra; //BKE_scene_frame_get(re->scene); // XXX old animsys - timing stuff to be fixed - } - } - } else if (tex->type==TEX_ENVMAP) { /* just in case */ tex->imaflag |= TEX_INTERPOL | TEX_MIPMAP; @@ -747,73 +739,6 @@ static int texnoise(Tex *tex, TexResult *texres) /* ------------------------------------------------------------------------- */ -static int plugintex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexResult *texres) -{ - PluginTex *pit; - int rgbnor=0; - float result[8]= {0.0f}; - - texres->tin= 0.0; - - pit= tex->plugin; - if (pit && pit->doit) { - if (texres->nor) { - if (pit->version < 6) { - copy_v3_v3(pit->result+5, texres->nor); - } - else { - copy_v3_v3(result+5, texres->nor); - } - } - if (pit->version < 6) { - if (osatex) rgbnor= ((TexDoitold)pit->doit)(tex->stype, - pit->data, texvec, dxt, dyt); - else rgbnor= ((TexDoitold)pit->doit)(tex->stype, - pit->data, texvec, NULL, NULL); - } - else { - if (osatex) rgbnor= ((TexDoit)pit->doit)(tex->stype, - pit->data, texvec, dxt, dyt, result); - else rgbnor= ((TexDoit)pit->doit)(tex->stype, - pit->data, texvec, NULL, NULL, result); - } - - if (pit->version < 6) { - texres->tin = pit->result[0]; - } - else { - texres->tin = result[0]; /* XXX, assigning garbage value, fixme! */ - } - - if (rgbnor & TEX_NOR) { - if (texres->nor) { - if (pit->version < 6) { - copy_v3_v3(texres->nor, pit->result+5); - } - else { - copy_v3_v3(texres->nor, result+5); - } - } - } - - if (rgbnor & TEX_RGB) { - if (pit->version < 6) { - copy_v4_v4(&texres->tr, pit->result + 1); - } - else { - copy_v4_v4(&texres->tr, result + 1); - } - - BRICONTRGB; - } - - BRICONT; - } - - return rgbnor; -} - - static int cubemap_glob(const float n[3], float x, float y, float z, float *adr1, float *adr2) { float x1, y1, z1, nor[3]; @@ -1210,9 +1135,6 @@ static int multitex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, else retval= imagewrap(tex, tex->ima, NULL, texvec, texres); BKE_image_tag_time(tex->ima); /* tag image as having being used */ break; - case TEX_PLUGIN: - retval= plugintex(tex, texvec, dxt, dyt, osatex, texres); - break; case TEX_ENVMAP: retval= envmaptex(tex, texvec, dxt, dyt, osatex, texres); break; diff --git a/source/blenderplayer/CMakeLists.txt b/source/blenderplayer/CMakeLists.txt index a352c69144f..2ca7019487f 100644 --- a/source/blenderplayer/CMakeLists.txt +++ b/source/blenderplayer/CMakeLists.txt @@ -101,8 +101,7 @@ endif() bf_rna bf_bmesh bf_blenkernel - bf_blenloader - bf_blenpluginapi + bf_blenloader ge_blen_routines bf_editor_datafiles ge_converter diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 0374db538b6..0e1a597386f 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -395,14 +395,6 @@ if(UNIX AND NOT APPLE) ) endif() - # plugins in blender 2.6 don't work at the moment. - # - # install( - # DIRECTORY ${CMAKE_SOURCE_DIR}/release/plugins - # DESTINATION ${TARGETDIR_VER} - # PATTERN ".svn" EXCLUDE - # ) - if(WITH_PYTHON) if(WITH_PYTHON_INSTALL) # on some platforms (like openSUSE) Python is linked @@ -482,14 +474,6 @@ elseif(WIN32) endif() endif() - # plugins in blender 2.6 don't work at the moment. - # - # install( - # DIRECTORY ${CMAKE_SOURCE_DIR}/release/plugins - # DESTINATION ${TARGETDIR_VER} - # PATTERN ".svn" EXCLUDE - # ) - if(WITH_PYTHON) set_lib_path(PYLIB "python/lib") install( @@ -858,7 +842,6 @@ endif() bf_blenlib bf_intern_ghost bf_intern_string - bf_blenpluginapi bf_avi bf_imbuf_cineon bf_imbuf_openexr diff --git a/source/creator/creator.c b/source/creator/creator.c index a21497b82fa..0cdbeb940b8 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -150,8 +150,6 @@ static int print_version(int argc, const char **argv, void *data); /* for the callbacks: */ -extern int pluginapi_force_ref(void); /* from blenpluginapi:pluginapi.c */ - #define BLEND_VERSION_STRING_FMT \ "Blender %d.%02d (sub %d)\n", \ BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION \ @@ -263,7 +261,6 @@ static int print_help(int UNUSED(argc), const char **UNUSED(argv), void *data) BLI_argsPrintArgDoc(ba, "--env-system-config"); BLI_argsPrintArgDoc(ba, "--env-system-datafiles"); BLI_argsPrintArgDoc(ba, "--env-system-scripts"); - BLI_argsPrintArgDoc(ba, "--env-system-plugins"); BLI_argsPrintArgDoc(ba, "--env-system-python"); printf("\n"); BLI_argsPrintArgDoc(ba, "-nojoystick"); @@ -1107,7 +1104,7 @@ static void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle) #endif BLI_argsAdd(ba, 1, "-y", "--enable-autoexec", "\n\tEnable automatic python script execution" PY_ENABLE_AUTO, enable_python, NULL); - BLI_argsAdd(ba, 1, "-Y", "--disable-autoexec", "\n\tDisable automatic python script execution (pydrivers, pyconstraints, pynodes)" PY_DISABLE_AUTO, disable_python, NULL); + BLI_argsAdd(ba, 1, "-Y", "--disable-autoexec", "\n\tDisable automatic python script execution (pydrivers & startup scripts)" PY_DISABLE_AUTO, disable_python, NULL); #undef PY_ENABLE_AUTO #undef PY_DISABLE_AUTO @@ -1138,7 +1135,6 @@ static void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle) /* TODO, add user env vars? */ BLI_argsAdd(ba, 1, NULL, "--env-system-datafiles", "\n\tSet the "STRINGIFY_ARG (BLENDER_SYSTEM_DATAFILES)" environment variable", set_env, NULL); BLI_argsAdd(ba, 1, NULL, "--env-system-scripts", "\n\tSet the "STRINGIFY_ARG (BLENDER_SYSTEM_SCRIPTS)" environment variable", set_env, NULL); - BLI_argsAdd(ba, 1, NULL, "--env-system-plugins", "\n\tSet the "STRINGIFY_ARG (BLENDER_SYSTEM_PLUGINS)" environment variable", set_env, NULL); BLI_argsAdd(ba, 1, NULL, "--env-system-python", "\n\tSet the "STRINGIFY_ARG (BLENDER_SYSTEM_PYTHON)" environment variable", set_env, NULL); /* second pass: custom window stuff */ @@ -1257,11 +1253,6 @@ int main(int argc, const char **argv) RNA_init(); RE_engines_init(); - /* Hack - force inclusion of the plugin api functions, - * see blenpluginapi:pluginapi.c - */ - pluginapi_force_ref(); - init_nodesystem(); initglobals(); /* blender.c */ |