Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/BME_conversions.c4
-rw-r--r--source/blender/blenkernel/intern/Makefile13
-rw-r--r--source/blender/blenkernel/intern/action.c1
-rw-r--r--source/blender/blenkernel/intern/anim.c2
-rw-r--r--source/blender/blenkernel/intern/armature.c1
-rw-r--r--source/blender/blenkernel/intern/blender.c1
-rw-r--r--source/blender/blenkernel/intern/brush.c68
-rw-r--r--source/blender/blenkernel/intern/colortools.c63
-rw-r--r--source/blender/blenkernel/intern/curve.c13
-rw-r--r--source/blender/blenkernel/intern/displist.c14
-rw-r--r--source/blender/blenkernel/intern/font.c5
-rw-r--r--source/blender/blenkernel/intern/image.c27
-rw-r--r--source/blender/blenkernel/intern/ipo.c1
-rw-r--r--source/blender/blenkernel/intern/lattice.c146
-rw-r--r--source/blender/blenkernel/intern/library.c45
-rw-r--r--source/blender/blenkernel/intern/mesh.c10
-rw-r--r--source/blender/blenkernel/intern/node.c16
-rw-r--r--source/blender/blenkernel/intern/object.c13
-rw-r--r--source/blender/blenkernel/intern/paint.c112
-rw-r--r--source/blender/blenkernel/intern/particle_system.c3
-rw-r--r--source/blender/blenkernel/intern/scene.c10
-rw-r--r--source/blender/blenkernel/intern/seqeffects.c21
-rw-r--r--source/blender/blenkernel/intern/sequencer.c16
-rw-r--r--source/blender/blenkernel/intern/sound.c1
-rw-r--r--source/blender/blenkernel/intern/text.c4
-rw-r--r--source/blender/blenkernel/intern/texture.c4
-rw-r--r--source/blender/blenkernel/intern/world.c1
27 files changed, 274 insertions, 341 deletions
diff --git a/source/blender/blenkernel/intern/BME_conversions.c b/source/blender/blenkernel/intern/BME_conversions.c
index d6a00450e4a..64a6e14bc5d 100644
--- a/source/blender/blenkernel/intern/BME_conversions.c
+++ b/source/blender/blenkernel/intern/BME_conversions.c
@@ -391,9 +391,9 @@ void BME_bmesh_to_editmesh(BME_Mesh *bm, BME_TransData_Head *td, EditMesh *em) {
if(e->flag & SELECT) eed->f |= SELECT;
//XXX if(e->flag & ME_FGON) eed->h= EM_FGON; // 2 different defines!
if(e->flag & ME_HIDE) eed->h |= 1;
- if(em->selectmode==SCE_SELECT_EDGE)
+ if(em->selectmode==SCE_SELECT_EDGE) {
; //XXX EM_select_edge(eed, eed->f & SELECT);
-
+ }
CustomData_em_copy_data(&bm->edata, &em->edata, e->data, &eed->data);
}
}
diff --git a/source/blender/blenkernel/intern/Makefile b/source/blender/blenkernel/intern/Makefile
index 15c022592f9..eb14914c7ba 100644
--- a/source/blender/blenkernel/intern/Makefile
+++ b/source/blender/blenkernel/intern/Makefile
@@ -136,8 +136,21 @@ ifeq ($(WITH_TIFF), true)
CPPFLAGS += -DWITH_TIFF
endif
+ifeq ($(WITH_CINEON), true)
+ CPPFLAGS += -DWITH_CINEON
+endif
+
+ifeq ($(WITH_HDR), true)
+ CPPFLAGS += -DWITH_HDR
+endif
+
ifeq ($(OS), darwin)
ifeq ($(WITH_BF_OPENMP), true)
CPPFLAGS += -DPARALLEL=1
endif
endif
+
+ifeq ($(WITH_LCMS), true)
+ CPPFLAGS += -DWITH_LCMS
+ CPPFLAGS += -I$(BF_LCMS_INC)
+endif
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 228860c9287..41ff3fed8a5 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -37,6 +37,7 @@
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
#include "DNA_scene_types.h"
+#include "DNA_object_types.h"
#include "BKE_animsys.h"
#include "BKE_action.h"
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index c24ec78dc1c..89c637d8192 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -49,7 +49,7 @@
#include "DNA_scene_types.h"
#include "DNA_vfont_types.h"
-#include "BKE_anim.h"
+//(INCLUDE_LINT)#include "BKE_anim.h"
#include "BKE_curve.h"
#include "BKE_DerivedMesh.h"
#include "BKE_depsgraph.h"
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index b9b171780c7..b86be371d66 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -45,6 +45,7 @@
#include "DNA_meshdata_types.h"
#include "DNA_nla_types.h"
#include "DNA_scene_types.h"
+#include "DNA_object_types.h"
#include "BKE_animsys.h"
#include "BKE_armature.h"
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index 1a1f3a724ca..7c8cea12549 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -52,6 +52,7 @@
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_sequence_types.h"
+#include "DNA_sound_types.h"
#include "BLI_blenlib.h"
#include "BLI_dynstr.h"
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index b9d7ea177d4..905515914b4 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -35,6 +35,7 @@
#include "DNA_brush_types.h"
#include "DNA_color_types.h"
#include "DNA_scene_types.h"
+#include "DNA_object_types.h"
#include "DNA_windowmanager_types.h"
#include "WM_types.h"
@@ -67,6 +68,8 @@ static void brush_set_defaults(Brush *brush)
brush->blend = 0;
brush->flag = 0;
+ brush->ob_mode = (OB_MODE_SCULPT|OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT);
+
/* BRUSH SCULPT TOOL SETTINGS */
brush->size= 35; /* radius of the brush in pixels */
brush->alpha= 0.5f; /* brush strength/intensity probably variable should be renamed? */
@@ -120,6 +123,9 @@ Brush *add_brush(const char *name)
brush= alloc_libblock(&G.main->brush, ID_BR, name);
+ /* enable fake user by default */
+ brush->id.flag |= LIB_FAKEUSER;
+
brush_set_defaults(brush);
brush->sculpt_tool = SCULPT_TOOL_DRAW; /* sculpting defaults to the draw tool for new brushes */
@@ -127,10 +133,6 @@ Brush *add_brush(const char *name)
/* the default alpha falloff curve */
brush_curve_preset(brush, CURVE_PRESET_SMOOTH);
- /* enable fake user by default */
- brush->id.flag |= LIB_FAKEUSER;
- brush_toggled_fake_user(brush);
-
return brush;
}
@@ -151,7 +153,7 @@ Brush *copy_brush(Brush *brush)
/* enable fake user by default */
if (!(brushn->id.flag & LIB_FAKEUSER)) {
brushn->id.flag |= LIB_FAKEUSER;
- brush_toggled_fake_user(brushn);
+ brushn->id.us++;
}
return brushn;
@@ -205,7 +207,7 @@ void make_local_brush(Brush *brush)
/* enable fake user by default */
if (!(brush->id.flag & LIB_FAKEUSER)) {
brush->id.flag |= LIB_FAKEUSER;
- brush_toggled_fake_user(brush);
+ brush->id.us++;
}
}
else if(local && lib) {
@@ -393,54 +395,6 @@ void brush_reset_sculpt(Brush *br)
}
/* Library Operations */
-
-int brush_set_nr(Brush **current_brush, int nr, const char *name)
-{
- ID *idtest, *id;
-
- id= (ID*)(*current_brush);
- idtest= (ID*)BLI_findlink(&G.main->brush, nr-1);
-
- if(idtest==0) { /* new brush */
- if(id) idtest= (ID *)copy_brush((Brush *)id);
- else idtest= (ID *)add_brush(name);
- idtest->us--;
- }
- if(idtest!=id) {
- brush_delete(current_brush);
- *current_brush= (Brush *)idtest;
- id_us_plus(idtest);
-
- return 1;
- }
-
- return 0;
-}
-
-int brush_delete(Brush **current_brush)
-{
- if (*current_brush) {
- (*current_brush)->id.us--;
- *current_brush= NULL;
-
- return 1;
- }
-
- return 0;
-}
-
-void brush_toggled_fake_user(Brush *brush)
-{
- ID *id= (ID*)brush;
- if(id) {
- if(id->flag & LIB_FAKEUSER) {
- id_us_plus(id);
- } else {
- id->us--;
- }
- }
-}
-
void brush_curve_preset(Brush *b, /*CurveMappingPreset*/int preset)
{
CurveMap *cm = NULL;
@@ -524,12 +478,6 @@ int brush_clone_image_delete(Brush *brush)
return 0;
}
-void brush_check_exists(Brush **brush, const char *name)
-{
- if(*brush==NULL)
- brush_set_nr(brush, 1, name);
-}
-
/* Brush Sampling */
void brush_sample_tex(Brush *brush, float *xy, float *rgba)
{
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c
index 11801557c99..90ffa39c88f 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -782,36 +782,55 @@ void curvemapping_evaluate_premulRGBF(CurveMapping *cumap, float *vecout, const
vecout[2]= curvemap_evaluateF(cumap->cm+2, fac);
}
+
+#ifdef WITH_LCMS
+/* basic error handler, if we dont do this blender will exit */
+static int ErrorReportingFunction(int ErrorCode, const char *ErrorText)
+{
+ fprintf(stderr, "%s:%d\n", ErrorText, ErrorCode);
+ return 1;
+}
+#endif
+
void colorcorrection_do_ibuf(ImBuf *ibuf, const char *profile)
{
+#ifdef WITH_LCMS
if (ibuf->crect == NULL)
{
-#ifdef WITH_LCMS
- cmsHPROFILE imageProfile, proofingProfile;
- cmsHTRANSFORM hTransform;
+ cmsHPROFILE proofingProfile;
- ibuf->crect = MEM_mallocN(ibuf->x*ibuf->y*sizeof(int), "imbuf crect");
-
- imageProfile = cmsCreate_sRGBProfile();
- proofingProfile = cmsOpenProfileFromFile(profile, "r");
+ /* TODO, move to initialization area of code */
+ //cmsSetLogErrorHandler(ErrorReportingFunction);
+ cmsSetErrorHandler(ErrorReportingFunction);
+ /* will return NULL if the file isn't fount */
+ proofingProfile = cmsOpenProfileFromFile(profile, "r");
+
cmsErrorAction(LCMS_ERROR_SHOW);
-
- hTransform = cmsCreateProofingTransform(imageProfile, TYPE_RGBA_8, imageProfile, TYPE_RGBA_8,
- proofingProfile,
- INTENT_ABSOLUTE_COLORIMETRIC,
- INTENT_ABSOLUTE_COLORIMETRIC,
- cmsFLAGS_SOFTPROOFING);
-
- cmsDoTransform(hTransform, ibuf->rect, ibuf->crect, ibuf->x * ibuf->y);
-
- cmsDeleteTransform(hTransform);
- cmsCloseProfile(imageProfile);
- cmsCloseProfile(proofingProfile);
-#else
- ibuf->crect = ibuf->rect;
-#endif
+
+ if(proofingProfile) {
+ cmsHPROFILE imageProfile;
+ cmsHTRANSFORM hTransform;
+
+ ibuf->crect = MEM_mallocN(ibuf->x*ibuf->y*sizeof(int), "imbuf crect");
+
+ imageProfile = cmsCreate_sRGBProfile();
+
+
+ hTransform = cmsCreateProofingTransform(imageProfile, TYPE_RGBA_8, imageProfile, TYPE_RGBA_8,
+ proofingProfile,
+ INTENT_ABSOLUTE_COLORIMETRIC,
+ INTENT_ABSOLUTE_COLORIMETRIC,
+ cmsFLAGS_SOFTPROOFING);
+
+ cmsDoTransform(hTransform, ibuf->rect, ibuf->crect, ibuf->x * ibuf->y);
+
+ cmsDeleteTransform(hTransform);
+ cmsCloseProfile(imageProfile);
+ cmsCloseProfile(proofingProfile);
+ }
}
+#endif
}
/* only used for image editor curves */
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 1a30e85c5c4..841bd635acf 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -45,6 +45,7 @@
#include "DNA_key_types.h"
#include "DNA_scene_types.h"
#include "DNA_vfont_types.h"
+#include "DNA_object_types.h"
#include "BKE_animsys.h"
#include "BKE_anim.h"
@@ -126,7 +127,7 @@ Curve *add_curve(char *name, int type)
cu= alloc_libblock(&G.main->curve, ID_CU, name);
cu->size[0]= cu->size[1]= cu->size[2]= 1.0;
- cu->flag= CU_FRONT|CU_BACK|CU_PATH_RADIUS;
+ cu->flag= CU_FRONT|CU_BACK|CU_DEFORM_BOUNDS_OFF|CU_PATH_RADIUS;
cu->pathlen= 100;
cu->resolu= cu->resolv= 12;
cu->width= 1.0;
@@ -1221,6 +1222,8 @@ void makebevelcurve(Scene *scene, Object *ob, ListBase *disp, int forRender)
// XXX if( ob == obedit && ob->type == OB_FONT ) return;
if(cu->bevobj) {
+ if (cu->bevobj->type!=OB_CURVE) return;
+
bevcu= cu->bevobj->data;
if(bevcu->ext1==0.0 && bevcu->ext2==0.0) {
ListBase bevdisp= {NULL, NULL};
@@ -3105,13 +3108,11 @@ ListBase *BKE_curve_nurbs(Curve *cu)
/* basic vertex data functions */
-int curve_bounds(Curve *cu, float min[3], float max[3])
+int minmax_curve(Curve *cu, float min[3], float max[3])
{
ListBase *nurb_lb= BKE_curve_nurbs(cu);
Nurb *nu;
- INIT_MINMAX(min, max);
-
for(nu= nurb_lb->first; nu; nu= nu->next)
minmaxNurb(nu, min, max);
@@ -3157,8 +3158,8 @@ int curve_center_median(Curve *cu, float cent[3])
int curve_center_bounds(Curve *cu, float cent[3])
{
float min[3], max[3];
-
- if(curve_bounds(cu, min, max)) {
+ INIT_MINMAX(min, max);
+ if(minmax_curve(cu, min, max)) {
mid_v3_v3v3(cent, min, max);
return 1;
}
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index 1cb28fe56d8..a44c5ace298 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -39,6 +39,7 @@
#include "DNA_curve_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_scene_types.h"
+#include "DNA_object_types.h"
#include "DNA_material_types.h"
#include "BLI_blenlib.h"
@@ -153,7 +154,7 @@ void copy_displist(ListBase *lbn, ListBase *lb)
}
}
-void addnormalsDispList(Object *ob, ListBase *lb)
+void addnormalsDispList(ListBase *lb)
{
DispList *dl = NULL;
float *vdata, *ndata, nor[3];
@@ -1128,7 +1129,7 @@ float calc_taper(Scene *scene, Object *taperobj, int cur, int tot)
Curve *cu;
DispList *dl;
- if(taperobj==NULL) return 1.0;
+ if(taperobj==NULL || taperobj->type!=OB_CURVE) return 1.0;
cu= taperobj->data;
dl= cu->disp.first;
@@ -1681,15 +1682,6 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
float (*deformedVerts)[3];
int numVerts;
- /* Bevel and taper objects should always be curves */
- if (cu->bevobj && cu->bevobj->type != OB_CURVE) {
- cu->bevobj = NULL;
- }
-
- if (cu->taperobj && cu->taperobj->type != OB_CURVE) {
- cu->taperobj = NULL;
- }
-
nubase= BKE_curve_nurbs(cu);
BLI_freelistN(&(cu->bev));
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index 46f67adeb4b..39b74be3d40 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -46,6 +46,7 @@
#include "DNA_curve_types.h"
#include "DNA_vfont_types.h"
#include "DNA_scene_types.h"
+#include "DNA_object_types.h"
#include "BKE_utildefines.h"
@@ -122,8 +123,8 @@ wcsleninu8(wchar_t *src)
return len;
}
-int
-static utf8slen(char *src)
+static int
+utf8slen(char *src)
{
int size = 0, index = 0;
unsigned char c;
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 77607ae25b6..d2612e90945 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -660,8 +660,10 @@ int BKE_imtype_to_ftype(int imtype)
return TGA;
else if(imtype== R_IRIS)
return IMAGIC;
+#ifdef WITH_HDR
else if (imtype==R_RADHDR)
return RADHDR;
+#endif
else if (imtype==R_PNG)
return PNG;
#ifdef WITH_DDS
@@ -670,14 +672,18 @@ int BKE_imtype_to_ftype(int imtype)
#endif
else if (imtype==R_BMP)
return BMP;
+#ifdef WITH_TIFF
else if (imtype==R_TIFF)
return TIF;
+#endif
else if (imtype==R_OPENEXR || imtype==R_MULTILAYER)
return OPENEXR;
+#ifdef WITH_CINEON
else if (imtype==R_CINEON)
return CINEON;
else if (imtype==R_DPX)
return DPX;
+#endif
else if (imtype==R_TARGA)
return TGA;
else if(imtype==R_RAWTGA)
@@ -696,8 +702,10 @@ int BKE_ftype_to_imtype(int ftype)
return TGA;
else if(ftype == IMAGIC)
return R_IRIS;
+#ifdef WITH_HDR
else if (ftype & RADHDR)
return R_RADHDR;
+#endif
else if (ftype & PNG)
return R_PNG;
#ifdef WITH_DDS
@@ -706,14 +714,18 @@ int BKE_ftype_to_imtype(int ftype)
#endif
else if (ftype & BMP)
return R_BMP;
+#ifdef WITH_TIFF
else if (ftype & TIF)
return R_TIFF;
+#endif
else if (ftype & OPENEXR)
return R_OPENEXR;
+#ifdef WITH_CINEON
else if (ftype & CINEON)
return R_CINEON;
else if (ftype & DPX)
return R_DPX;
+#endif
else if (ftype & TGA)
return R_TARGA;
else if(ftype & RAWTGA)
@@ -756,10 +768,12 @@ void BKE_add_image_extension(char *string, int imtype)
if(!BLI_testextensie(string, ".rgb"))
extension= ".rgb";
}
+#ifdef WITH_HDR
else if(imtype==R_RADHDR) {
if(!BLI_testextensie(string, ".hdr"))
extension= ".hdr";
}
+#endif
else if (ELEM5(imtype, R_PNG, R_FFMPEG, R_H264, R_THEORA, R_XVID)) {
if(!BLI_testextensie(string, ".png"))
extension= ".png";
@@ -790,6 +804,7 @@ void BKE_add_image_extension(char *string, int imtype)
extension= ".exr";
}
#endif
+#ifdef WITH_CINEON
else if(imtype==R_CINEON){
if (!BLI_testextensie(string, ".cin"))
extension= ".cin";
@@ -798,6 +813,7 @@ void BKE_add_image_extension(char *string, int imtype)
if (!BLI_testextensie(string, ".dpx"))
extension= ".dpx";
}
+#endif
else if(imtype==R_TARGA) {
if(!BLI_testextensie(string, ".tga"))
extension= ".tga";
@@ -1180,12 +1196,17 @@ int BKE_write_ibuf(Scene *scene, ImBuf *ibuf, char *name, int imtype, int subimt
{
int ok;
- if(imtype==0);
- else if(imtype== R_IRIS)
+ if(imtype==0) {
+ /* pass */
+ }
+ else if(imtype== R_IRIS) {
ibuf->ftype= IMAGIC;
+ }
+#ifdef WITH_HDR
else if ((imtype==R_RADHDR)) {
ibuf->ftype= RADHDR;
}
+#endif
else if (ELEM5(imtype, R_PNG, R_FFMPEG, R_H264, R_THEORA, R_XVID)) {
ibuf->ftype= PNG;
@@ -1221,12 +1242,14 @@ int BKE_write_ibuf(Scene *scene, ImBuf *ibuf, char *name, int imtype, int subimt
}
#endif
+#ifdef WITH_CINEON
else if (imtype==R_CINEON) {
ibuf->ftype = CINEON;
}
else if (imtype==R_DPX) {
ibuf->ftype = DPX;
}
+#endif
else if (imtype==R_TARGA) {
ibuf->ftype= TGA;
}
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index 64c9bf4bd07..a24f37bf73a 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -54,6 +54,7 @@
#include "DNA_sequence_types.h"
#include "DNA_scene_types.h"
#include "DNA_world_types.h"
+#include "DNA_object_types.h"
#include "BLI_math.h" /* windows needs for M_PI */
#include "BLI_blenlib.h"
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index 5824afd9ded..1eb7b5d2021 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -44,6 +44,7 @@
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_scene_types.h"
+#include "DNA_object_types.h"
#include "DNA_lattice_types.h"
#include "DNA_curve_types.h"
#include "DNA_key_types.h"
@@ -174,7 +175,7 @@ void resizelattice(Lattice *lt, int uNew, int vNew, int wNew, Object *ltOb)
bp= lt->def;
for (i=0; i<lt->pntsu*lt->pntsv*lt->pntsw; i++,bp++) {
- VECCOPY(bp->vec, vertexCos[i]);
+ copy_v3_v3(bp->vec, vertexCos[i]);
}
MEM_freeN(vertexCos);
@@ -473,7 +474,9 @@ static void init_curve_deform(Object *par, Object *ob, CurveDeform *cd, int dloc
invert_m4_m4(par->imat, par->obmat);
mul_v3_m4v3(cd->dloc, par->imat, ob->obmat[3]);
}
- else cd->dloc[0]=cd->dloc[1]=cd->dloc[2]= 0.0f;
+ else {
+ cd->dloc[0]=cd->dloc[1]=cd->dloc[2]= 0.0f;
+ }
cd->no_rot_axis= 0;
}
@@ -506,15 +509,15 @@ static int where_on_path_deform(Object *ob, float ctime, float *vec, float *dir,
if(ctime < 0.0) {
sub_v3_v3v3(dvec, path->data[1].vec, path->data[0].vec);
mul_v3_fl(dvec, ctime*(float)path->len);
- VECADD(vec, vec, dvec);
- if(quat) QUATCOPY(quat, path->data[0].quat);
+ add_v3_v3(vec, dvec);
+ if(quat) copy_qt_qt(quat, path->data[0].quat);
if(radius) *radius= path->data[0].radius;
}
else if(ctime > 1.0) {
sub_v3_v3v3(dvec, path->data[path->len-1].vec, path->data[path->len-2].vec);
mul_v3_fl(dvec, (ctime-1.0)*(float)path->len);
- VECADD(vec, vec, dvec);
- if(quat) QUATCOPY(quat, path->data[path->len-1].quat);
+ add_v3_v3(vec, dvec);
+ if(quat) copy_qt_qt(quat, path->data[path->len-1].quat);
if(radius) *radius= path->data[path->len-1].radius;
/* weight - not used but could be added */
}
@@ -607,7 +610,7 @@ static int calc_curve_deform(Scene *scene, Object *par, float *co, short axis, C
/* this is not exactly the same as 2.4x, since the axis is having rotation removed rather then
* changing the axis before calculating the tilt but serves much the same purpose */
float dir_flat[3]={0,0,0}, q[4];
- VECCOPY(dir_flat, dir);
+ copy_v3_v3(dir_flat, dir);
dir_flat[cd->no_rot_axis-1]= 0.0f;
normalize_v3(dir);
@@ -685,11 +688,11 @@ static int calc_curve_deform(Scene *scene, Object *par, float *co, short axis, C
mul_qt_v3(quat, cent);
/* translation */
- VECADD(co, cent, loc);
+ add_v3_v3v3(co, cent, loc);
if(quatp)
- QUATCOPY(quatp, quat);
-
+ copy_qt_qt(quatp, quat);
+
return 1;
}
return 0;
@@ -710,7 +713,18 @@ void curve_deform_verts(Scene *scene, Object *cuOb, Object *target, DerivedMesh
cu->flag |= (CU_PATH|CU_FOLLOW); // needed for path & bevlist
init_curve_deform(cuOb, target, &cd, (cu->flag & CU_STRETCH)==0);
-
+
+ /* dummy bounds, keep if CU_DEFORM_BOUNDS_OFF is set */
+ if(defaxis < 3) {
+ cd.dmin[0]= cd.dmin[1]= cd.dmin[2]= 0.0f;
+ cd.dmax[0]= cd.dmax[1]= cd.dmax[2]= 1.0f;
+ }
+ else {
+ /* negative, these bounds give a good rest position */
+ cd.dmin[0]= cd.dmin[1]= cd.dmin[2]= -1.0f;
+ cd.dmax[0]= cd.dmax[1]= cd.dmax[2]= 0.0f;
+ }
+
/* check whether to use vertex groups (only possible if target is a Mesh)
* we want either a Mesh with no derived data, or derived data with
* deformverts
@@ -725,62 +739,84 @@ void curve_deform_verts(Scene *scene, Object *cuOb, Object *target, DerivedMesh
use_vgroups = 0;
if(vgroup && vgroup[0] && use_vgroups) {
- bDeformGroup *curdef;
Mesh *me= target->data;
- int index;
-
- /* find the group (weak loop-in-loop) */
- for(index = 0, curdef = target->defbase.first; curdef;
- curdef = curdef->next, index++)
- if (!strcmp(curdef->name, vgroup))
- break;
+ int index= defgroup_name_index(target, vgroup);
- if(curdef && (me->dvert || dm)) {
+ if(index != -1 && (me->dvert || dm)) {
MDeformVert *dvert = me->dvert;
float vec[3];
- int j;
-
- INIT_MINMAX(cd.dmin, cd.dmax);
-
- for(a = 0; a < numVerts; a++, dvert++) {
- if(dm) dvert = dm->getVertData(dm, a, CD_MDEFORMVERT);
+ float weight;
+
- for(j = 0; j < dvert->totweight; j++) {
- if(dvert->dw[j].def_nr == index) {
+ if(cu->flag & CU_DEFORM_BOUNDS_OFF) {
+ /* dummy bounds */
+ cd.dmin[0]= cd.dmin[1]= cd.dmin[2]= 0.0f;
+ cd.dmax[0]= cd.dmax[1]= cd.dmax[2]= 1.0f;
+
+ dvert = me->dvert;
+ for(a = 0; a < numVerts; a++, dvert++) {
+ if(dm) dvert = dm->getVertData(dm, a, CD_MDEFORMVERT);
+ weight= defvert_find_weight(dvert, index);
+
+ if(weight > 0.0f) {
mul_m4_v3(cd.curvespace, vertexCos[a]);
- DO_MINMAX(vertexCos[a], cd.dmin, cd.dmax);
- break;
+ copy_v3_v3(vec, vertexCos[a]);
+ calc_curve_deform(scene, cuOb, vec, defaxis, &cd, NULL);
+ interp_v3_v3v3(vertexCos[a], vertexCos[a], vec, weight);
+ mul_m4_v3(cd.objectspace, vertexCos[a]);
}
}
}
-
- dvert = me->dvert;
- for(a = 0; a < numVerts; a++, dvert++) {
- if(dm) dvert = dm->getVertData(dm, a, CD_MDEFORMVERT);
-
- for(j = 0; j < dvert->totweight; j++) {
- if(dvert->dw[j].def_nr == index) {
- VECCOPY(vec, vertexCos[a]);
+ else {
+ /* set mesh min/max bounds */
+ INIT_MINMAX(cd.dmin, cd.dmax);
+
+ for(a = 0; a < numVerts; a++, dvert++) {
+ if(dm) dvert = dm->getVertData(dm, a, CD_MDEFORMVERT);
+
+ if(defvert_find_weight(dvert, index) > 0.0f) {
+ mul_m4_v3(cd.curvespace, vertexCos[a]);
+ DO_MINMAX(vertexCos[a], cd.dmin, cd.dmax);
+ }
+ }
+
+ dvert = me->dvert;
+ for(a = 0; a < numVerts; a++, dvert++) {
+ if(dm) dvert = dm->getVertData(dm, a, CD_MDEFORMVERT);
+
+ weight= defvert_find_weight(dvert, index);
+
+ if(weight > 0.0f) {
+ copy_v3_v3(vec, vertexCos[a]);
calc_curve_deform(scene, cuOb, vec, defaxis, &cd, NULL);
- interp_v3_v3v3(vertexCos[a], vertexCos[a], vec,
- dvert->dw[j].weight);
+ interp_v3_v3v3(vertexCos[a], vertexCos[a], vec, weight);
mul_m4_v3(cd.objectspace, vertexCos[a]);
- break;
}
}
}
}
- } else {
- INIT_MINMAX(cd.dmin, cd.dmax);
-
- for(a = 0; a < numVerts; a++) {
- mul_m4_v3(cd.curvespace, vertexCos[a]);
- DO_MINMAX(vertexCos[a], cd.dmin, cd.dmax);
+ }
+ else {
+ if(cu->flag & CU_DEFORM_BOUNDS_OFF) {
+ for(a = 0; a < numVerts; a++) {
+ mul_m4_v3(cd.curvespace, vertexCos[a]);
+ calc_curve_deform(scene, cuOb, vertexCos[a], defaxis, &cd, NULL);
+ mul_m4_v3(cd.objectspace, vertexCos[a]);
+ }
}
-
- for(a = 0; a < numVerts; a++) {
- calc_curve_deform(scene, cuOb, vertexCos[a], defaxis, &cd, NULL);
- mul_m4_v3(cd.objectspace, vertexCos[a]);
+ else {
+ /* set mesh min max bounds */
+ INIT_MINMAX(cd.dmin, cd.dmax);
+
+ for(a = 0; a < numVerts; a++) {
+ mul_m4_v3(cd.curvespace, vertexCos[a]);
+ DO_MINMAX(vertexCos[a], cd.dmin, cd.dmax);
+ }
+
+ for(a = 0; a < numVerts; a++) {
+ calc_curve_deform(scene, cuOb, vertexCos[a], defaxis, &cd, NULL);
+ mul_m4_v3(cd.objectspace, vertexCos[a]);
+ }
}
}
cu->flag = flag;
@@ -802,8 +838,8 @@ void curve_deform_vector(Scene *scene, Object *cuOb, Object *target, float *orco
init_curve_deform(cuOb, target, &cd, 0); /* 0 no dloc */
cd.no_rot_axis= no_rot_axis; /* option to only rotate for XY, for example */
- VECCOPY(cd.dmin, orco);
- VECCOPY(cd.dmax, orco);
+ copy_v3_v3(cd.dmin, orco);
+ copy_v3_v3(cd.dmax, orco);
mul_m4_v3(cd.curvespace, vec);
@@ -972,7 +1008,7 @@ float (*lattice_getVertexCos(struct Object *ob, int *numVerts_r))[3]
vertexCos = MEM_mallocN(sizeof(*vertexCos)*numVerts,"lt_vcos");
for (i=0; i<numVerts; i++) {
- VECCOPY(vertexCos[i], lt->def[i].vec);
+ copy_v3_v3(vertexCos[i], lt->def[i].vec);
}
return vertexCos;
@@ -984,7 +1020,7 @@ void lattice_applyVertexCos(struct Object *ob, float (*vertexCos)[3])
int i, numVerts = lt->pntsu*lt->pntsv*lt->pntsw;
for (i=0; i<numVerts; i++) {
- VECCOPY(lt->def[i].vec, vertexCos[i]);
+ copy_v3_v3(lt->def[i].vec, vertexCos[i]);
}
}
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 967cd5f4520..a545adcaf8e 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -43,27 +43,29 @@
#include "MEM_guardedalloc.h"
/* all types are needed here, in order to do memory operations */
-#include "DNA_scene_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_meta_types.h"
-#include "DNA_material_types.h"
-#include "DNA_wave_types.h"
-#include "DNA_lamp_types.h"
+#include "DNA_anim_types.h"
+#include "DNA_armature_types.h"
+#include "DNA_brush_types.h"
#include "DNA_camera_types.h"
+#include "DNA_group_types.h"
#include "DNA_ipo_types.h"
#include "DNA_key_types.h"
-#include "DNA_world_types.h"
+#include "DNA_lamp_types.h"
+#include "DNA_lattice_types.h"
+#include "DNA_material_types.h"
+#include "DNA_mesh_types.h"
+#include "DNA_meta_types.h"
+#include "DNA_nla_types.h"
+#include "DNA_node_types.h"
+#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
-#include "DNA_vfont_types.h"
-#include "DNA_text_types.h"
#include "DNA_sound_types.h"
-#include "DNA_group_types.h"
-#include "DNA_armature_types.h"
-#include "DNA_node_types.h"
-#include "DNA_nla_types.h"
+#include "DNA_text_types.h"
+#include "DNA_vfont_types.h"
#include "DNA_windowmanager_types.h"
-#include "DNA_anim_types.h"
+#include "DNA_world_types.h"
+#include "DNA_gpencil_types.h"
+
#include "BLI_blenlib.h"
#include "BLI_dynstr.h"
@@ -175,8 +177,6 @@ int id_make_local(ID *id, int test)
return 1;
case ID_IM:
return 0; /* not implemented */
- case ID_WV:
- return 0; /* deprecated */
case ID_LT:
if(!test) {
make_local_lattice((Lattice*)id);
@@ -267,8 +267,6 @@ int id_copy(ID *id, ID **newid, int test)
case ID_IM:
if(!test) *newid= (ID*)copy_image((Image*)id);
return 1;
- case ID_WV:
- return 0; /* deprecated */
case ID_LT:
if(!test) *newid= (ID*)copy_lattice((Lattice*)id);
return 1;
@@ -379,8 +377,6 @@ ListBase *which_libbase(Main *mainlib, short type)
return &(mainlib->tex);
case ID_IM:
return &(mainlib->image);
- case ID_WV:
- return &(mainlib->wave);
case ID_LT:
return &(mainlib->latt);
case ID_LA:
@@ -482,7 +478,6 @@ int set_listbasepointers(Main *main, ListBase **lb)
lb[a++]= &(main->curve);
lb[a++]= &(main->mball);
- lb[a++]= &(main->wave);
lb[a++]= &(main->latt);
lb[a++]= &(main->lamp);
lb[a++]= &(main->camera);
@@ -550,9 +545,6 @@ static ID *alloc_libblock_notest(short type)
case ID_IM:
id= MEM_callocN(sizeof(Image), "image");
break;
- case ID_WV:
- id= MEM_callocN(sizeof(Wave), "wave");
- break;
case ID_LT:
id= MEM_callocN(sizeof(Lattice), "latt");
break;
@@ -757,9 +749,6 @@ void free_libblock(ListBase *lb, void *idv)
case ID_IM:
free_image((Image *)id);
break;
- case ID_WV:
- /* free_wave(id); */
- break;
case ID_LT:
free_lattice((Lattice *)id);
break;
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index ab7b0694836..7129ecb1d55 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -330,7 +330,8 @@ void boundbox_mesh(Mesh *me, float *loc, float *size)
if (!loc) loc= mloc;
if (!size) size= msize;
- if(!mesh_bounds(me, min, max)) {
+ INIT_MINMAX(min, max);
+ if(!minmax_mesh(me, min, max)) {
min[0] = min[1] = min[2] = -1.0f;
max[0] = max[1] = max[2] = 1.0f;
}
@@ -1484,11 +1485,10 @@ void mesh_pmv_off(Object *ob, Mesh *me)
}
/* basic vertex data functions */
-int mesh_bounds(Mesh *me, float min[3], float max[3])
+int minmax_mesh(Mesh *me, float min[3], float max[3])
{
int i= me->totvert;
MVert *mvert;
- INIT_MINMAX(min, max);
for(mvert= me->mvert; i--; mvert++) {
DO_MINMAX(mvert->co, min, max);
}
@@ -1512,8 +1512,8 @@ int mesh_center_median(Mesh *me, float cent[3])
int mesh_center_bounds(Mesh *me, float cent[3])
{
float min[3], max[3];
-
- if(mesh_bounds(me, min, max)) {
+ INIT_MINMAX(min, max);
+ if(minmax_mesh(me, min, max)) {
mid_v3_v3v3(cent, min, max);
return 1;
}
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index ff1887b0883..36c23216585 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -1064,6 +1064,7 @@ bNodeTree *ntreeAddTree(int type)
* - internal_select is only 1 when used for duplicating selected nodes (i.e. Shift-D duplicate operator)
* - this gets called when executing compositing updates (for threaded previews)
* - when the nodetree datablock needs to be copied (i.e. when users get copied)
+ * - for scene duplication use ntreeSwapID() after so we dont have stale pointers.
*/
bNodeTree *ntreeCopyTree(bNodeTree *ntree, int internal_select)
{
@@ -1142,6 +1143,18 @@ bNodeTree *ntreeCopyTree(bNodeTree *ntree, int internal_select)
return newtree;
}
+/* use when duplicating scenes */
+void ntreeSwitchID(bNodeTree *ntree, ID *id_from, ID *id_to)
+{
+ bNode *node;
+ /* for scene duplication only */
+ for(node= ntree->nodes.first; node; node= node->next) {
+ if(node->id==id_from) {
+ node->id= id_to;
+ }
+ }
+}
+
/* *************** preview *********** */
/* if node->preview, then we assume the rect to exist */
@@ -2651,8 +2664,9 @@ void ntreeLocalMerge(bNodeTree *localtree, bNodeTree *ntree)
for(lsock= lnode->outputs.first; lsock; lsock= lsock->next) {
if(outsocket_exists(lnode->new_node, lsock->new_sock)) {
lsock->new_sock->ns.data= lsock->ns.data;
+ compbuf_set_node(lsock->new_sock->ns.data, lnode->new_node);
lsock->ns.data= NULL;
- lsock->new_sock= NULL;
+ lsock->new_sock= NULL;
}
}
}
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 39e02ee584d..c08a3408505 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -283,7 +283,7 @@ void free_object(Object *ob)
ob->path= 0;
if(ob->adt) BKE_free_animdata((ID *)ob);
if(ob->poselib) ob->poselib->id.us--;
- if(ob->gpd) ob->gpd->id.us--;
+ if(ob->gpd) ((ID *)ob->gpd)->us--;
if(ob->defbase.first)
BLI_freelistN(&ob->defbase);
if(ob->pose)
@@ -1627,10 +1627,7 @@ float bsystem_time(struct Scene *scene, Object *ob, float cfra, float ofs)
void object_scale_to_mat3(Object *ob, float mat[][3])
{
float vec[3];
-
- vec[0]= ob->size[0]+ob->dsize[0];
- vec[1]= ob->size[1]+ob->dsize[1];
- vec[2]= ob->size[2]+ob->dsize[2];
+ add_v3_v3v3(vec, ob->size, ob->dsize);
size_to_mat3( mat,vec);
}
@@ -1688,7 +1685,7 @@ void object_mat3_to_rot(Object *ob, float mat[][3], int use_compat)
void object_apply_mat4(Object *ob, float mat[][4])
{
float mat3[3][3];
- VECCOPY(ob->loc, mat[3]);
+ copy_v3_v3(ob->loc, mat[3]);
mat4_to_size(ob->size, mat);
copy_m3_m4(mat3, mat);
object_mat3_to_rot(ob, mat3, 0);
@@ -1796,7 +1793,7 @@ static void ob_parcurve(Scene *scene, Object *ob, Object *par, float mat[][4])
copy_m4_m4(mat, rmat);
}
- VECCOPY(mat[3], vec);
+ copy_v3_v3(mat[3], vec);
}
}
@@ -1823,7 +1820,7 @@ static void ob_parbone(Object *ob, Object *par, float mat[][4])
copy_m4_m4(mat, pchan->pose_mat);
/* but for backwards compatibility, the child has to move to the tail */
- VECCOPY(vec, mat[1]);
+ copy_v3_v3(vec, mat[1]);
mul_v3_fl(vec, pchan->bone->length);
add_v3_v3(mat[3], vec);
}
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index fcbe8d65d64..3343df6b8a7 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -30,6 +30,7 @@
#include "DNA_object_types.h"
#include "DNA_mesh_types.h"
#include "DNA_scene_types.h"
+#include "DNA_brush_types.h"
#include "BKE_brush.h"
#include "BKE_library.h"
@@ -70,91 +71,13 @@ Paint *paint_get_active(Scene *sce)
Brush *paint_brush(Paint *p)
{
- return p && p->brushes ? p->brushes[p->active_brush_index] : NULL;
+ return p ? p->brush : NULL;
}
void paint_brush_set(Paint *p, Brush *br)
{
- if(p && !br) {
- /* Setting to NULL removes the current slot */
- paint_brush_slot_remove(p);
- }
- else if(p) {
- int found = 0;
-
- if(p->brushes) {
- int i;
-
- /* See if there's already a slot with the brush */
- for(i = 0; i < p->brush_count; ++i) {
- if(p->brushes[i] == br) {
- p->active_brush_index = i;
- found = 1;
- break;
- }
- }
-
- }
-
- if(!found) {
- paint_brush_slot_add(p);
- id_us_plus(&br->id);
- }
-
- /* Make sure the current slot is the new brush */
- p->brushes[p->active_brush_index] = br;
- }
-}
-
-static void paint_brush_slots_alloc(Paint *p, const int count)
-{
- p->brush_count = count;
- if(count == 0)
- p->brushes = NULL;
- else
- p->brushes = MEM_callocN(sizeof(Brush*) * count, "Brush slots");
-}
-
-void paint_brush_slot_add(Paint *p)
-{
- if(p) {
- Brush **orig = p->brushes;
- int orig_count = p->brushes ? p->brush_count : 0;
-
- /* Increase size of brush slot array */
- paint_brush_slots_alloc(p, orig_count + 1);
- if(orig) {
- memcpy(p->brushes, orig, sizeof(Brush*) * orig_count);
- MEM_freeN(orig);
- }
-
- p->active_brush_index = orig_count;
- }
-}
-
-void paint_brush_slot_remove(Paint *p)
-{
- if(p && p->brushes) {
- Brush **orig = p->brushes;
- int src, dst;
-
- /* Decrease size of brush slot array */
- paint_brush_slots_alloc(p, p->brush_count - 1);
- if(p->brushes) {
- for(src = 0, dst = 0; dst < p->brush_count; ++src) {
- if(src != p->active_brush_index) {
- p->brushes[dst] = orig[src];
- ++dst;
- }
- }
- }
- MEM_freeN(orig);
-
- if(p->active_brush_index >= p->brush_count)
- p->active_brush_index = p->brush_count - 1;
- if(p->active_brush_index < 0)
- p->active_brush_index = 0;
- }
+ if(p)
+ p->brush= br;
}
int paint_facesel_test(Object *ob)
@@ -168,7 +91,8 @@ void paint_init(Paint *p, const char col[3])
/* If there's no brush, create one */
brush = paint_brush(p);
- brush_check_exists(&brush, "Brush");
+ if(brush == NULL)
+ brush= add_brush("Brush");
paint_brush_set(p, brush);
memcpy(p->paint_cursor_col, col, 3);
@@ -179,28 +103,10 @@ void paint_init(Paint *p, const char col[3])
void free_paint(Paint *paint)
{
- if(paint->brushes)
- MEM_freeN(paint->brushes);
+ /* nothing */
}
-void copy_paint(Paint *orig, Paint *new)
+void copy_paint(Paint *src, Paint *tar)
{
- if(orig->brushes) {
- int i;
- new->brushes = MEM_dupallocN(orig->brushes);
- for(i = 0; i < orig->brush_count; ++i)
- id_us_plus((ID *)new->brushes[i]);
- }
-}
-
-int paint_has_brush(Paint *p, Brush *brush)
-{
- int i;
-
- for (i= 0; i < p->brush_count; i++) {
- if (strcmp(brush->id.name+2, p->brushes[i]->id.name+2) == 0)
- return 1;
- }
-
- return 0;
+ tar->brush= src->brush;
}
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 366d2e37d78..9b9c3ff16b6 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -62,7 +62,6 @@
#include "BLI_listbase.h"
#include "BLI_threads.h"
-#include "BKE_anim.h"
#include "BKE_animsys.h"
#include "BKE_boids.h"
#include "BKE_cdderivedmesh.h"
@@ -182,7 +181,7 @@ static void realloc_particles(ParticleSimulationData *sim, int new_totpart)
else
totpart=new_totpart;
- if(totpart && totpart != psys->totpart) {
+ if(totpart != psys->totpart) {
if(psys->edit && psys->free_edit) {
psys->free_edit(psys->edit);
psys->edit = NULL;
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 22f19835f5a..37ea93401f9 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -42,6 +42,7 @@
#include "DNA_anim_types.h"
#include "DNA_group_types.h"
+#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_sequence_types.h"
@@ -173,9 +174,12 @@ Scene *copy_scene(Main *bmain, Scene *sce, int type)
BLI_duplicatelist(&(scen->transform_spaces), &(sce->transform_spaces));
BLI_duplicatelist(&(scen->r.layers), &(sce->r.layers));
BKE_keyingsets_copy(&(scen->keyingsets), &(sce->keyingsets));
-
- scen->nodetree= ntreeCopyTree(sce->nodetree, 0);
-
+
+ if(sce->nodetree) {
+ scen->nodetree= ntreeCopyTree(sce->nodetree, 0);
+ ntreeSwitchID(scen->nodetree, &sce->id, &scen->id);
+ }
+
obase= sce->base.first;
base= scen->base.first;
while(base) {
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c
index c117f51c072..1e1ace0f758 100644
--- a/source/blender/blenkernel/intern/seqeffects.c
+++ b/source/blender/blenkernel/intern/seqeffects.c
@@ -2968,22 +2968,11 @@ void sequence_effect_speed_rebuild_map(Scene *scene, Sequence * seq, int force)
fallback_fac = 1.0;
- /* if there is no IPO, try to make retiming easy by stretching the
+ /* if there is no fcurve, try to make retiming easy by stretching the
strip */
- // XXX old animation system - seq
if (!fcu && seq->seq1->enddisp != seq->seq1->start && seq->seq1->len != 0) {
fallback_fac = (float) seq->seq1->len /
(float) (seq->seq1->enddisp - seq->seq1->start);
- /* FIXME: this strip stretching gets screwed by stripdata
- handling one layer up.
-
- So it currently works by enlarging, never by shrinking!
-
- (IPOs still work, if used correctly)
- */
- if (fallback_fac > 1.0) {
- fallback_fac = 1.0;
- }
}
if ((v->flags & SEQ_SPEED_INTEGRATE) != 0) {
@@ -3006,8 +2995,8 @@ void sequence_effect_speed_rebuild_map(Scene *scene, Sequence * seq, int force)
cursor += facf;
- if (cursor >= v->length) {
- v->frameMap[cfra] = v->length - 1;
+ if (cursor >= seq->seq1->len) {
+ v->frameMap[cfra] = seq->seq1->len - 1;
} else {
v->frameMap[cfra] = cursor;
v->lastValidFrame = cfra;
@@ -3033,8 +3022,8 @@ void sequence_effect_speed_rebuild_map(Scene *scene, Sequence * seq, int force)
facf = (float) cfra * fallback_fac;
}
facf *= v->globalSpeed;
- if (facf >= v->length) {
- facf = v->length - 1;
+ if (facf >= seq->seq1->len) {
+ facf = seq->seq1->len - 1;
} else {
v->lastValidFrame = cfra;
}
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index aab4e1226b2..866f907ef9e 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -39,6 +39,7 @@
#include "DNA_scene_types.h"
#include "DNA_anim_types.h"
#include "DNA_object_types.h"
+#include "DNA_sound_types.h"
#include "BKE_animsys.h"
#include "BKE_global.h"
@@ -898,7 +899,6 @@ static float give_stripelem_index(Sequence *seq, float cfra)
{
float nr;
- if(seq->startdisp >cfra || seq->enddisp <= cfra) return -1;
if(seq->len == 0) return -1;
if(seq->flag&SEQ_REVERSE_FRAMES) {
/*reverse frame in this sequence */
@@ -1460,8 +1460,7 @@ int input_have_to_preprocess(
mul = seq->mul;
- if(seq->blend_mode == SEQ_BLEND_REPLACE &&
- !(seq->type & SEQ_EFFECT)) {
+ if(seq->blend_mode == SEQ_BLEND_REPLACE) {
mul *= seq->blend_opacity / 100.0;
}
@@ -1992,7 +1991,7 @@ static ImBuf * seq_render_strip(Scene *scene, Sequence * seq, float cfra,
} else if(seq->type == SEQ_IMAGE) {
StripElem * s_elem = give_stripelem(seq, cfra);
- if(ibuf == 0) {
+ if(ibuf == 0 && s_elem) {
BLI_join_dirfile(name, seq->strip->dir, s_elem->name);
BLI_path_abs(name, G.sce);
@@ -2003,7 +2002,8 @@ static ImBuf * seq_render_strip(Scene *scene, Sequence * seq, float cfra,
ibuf = copy_from_ibuf_still(seq,nr,seqrectx,seqrecty);
}
- if (ibuf == 0 && (ibuf=IMB_loadiffname(name, IB_rect))) {
+ if (ibuf == 0 && s_elem &&
+ (ibuf = IMB_loadiffname(name, IB_rect))) {
/* we don't need both (speed reasons)! */
if (ibuf->rect_float && ibuf->rect)
imb_freerectImBuf(ibuf);
@@ -3540,12 +3540,6 @@ static Sequence *seq_dupli(struct Scene *scene, Sequence *seq, int dupe_flag)
// XXX: add F-Curve duplication stuff?
- seqn->strip->tstripdata = 0;
- seqn->strip->tstripdata_startstill = 0;
- seqn->strip->tstripdata_endstill = 0;
- seqn->strip->ibuf_startstill = 0;
- seqn->strip->ibuf_endstill = 0;
-
if (seq->strip->crop) {
seqn->strip->crop = MEM_dupallocN(seq->strip->crop);
}
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index ca39355976b..8fd97a80110 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -16,6 +16,7 @@
#include "DNA_sequence_types.h"
#include "DNA_packedFile_types.h"
#include "DNA_screen_types.h"
+#include "DNA_sound_types.h"
#include "AUD_C-API.h"
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index 5a6ebb187cf..c8f5eb9b187 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -43,6 +43,8 @@
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_text_types.h"
+#include "DNA_userdef_types.h"
+#include "DNA_object_types.h"
#include "BKE_depsgraph.h"
#include "BKE_global.h"
@@ -479,7 +481,7 @@ void unlink_text(Main *bmain, Text *text)
for(scene=bmain->scene.first; scene; scene=scene->id.next)
if(scene->r.dometext == text)
scene->r.dometext = NULL;
-
+
for(ob=bmain->object.first; ob; ob=ob->id.next) {
/* game controllers */
for(cont=ob->controllers.first; cont; cont=cont->next) {
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index d05d8ccbc08..fe5abbd0868 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -169,8 +169,8 @@ PluginTex *add_plugin_tex(char *str)
open_plugin_tex(pit);
if(pit->doit==0) {
- if(pit->handle==0); //XXX error("no plugin: %s", str);
- else ; //XXX error("in plugin: %s", str);
+ if(pit->handle==0) {;} //XXX error("no plugin: %s", str);
+ else {;} //XXX error("in plugin: %s", str);
MEM_freeN(pit);
return NULL;
}
diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c
index 6fb1c5ff70c..1d1b5ec16f7 100644
--- a/source/blender/blenkernel/intern/world.c
+++ b/source/blender/blenkernel/intern/world.c
@@ -36,6 +36,7 @@
#include "DNA_world_types.h"
#include "DNA_scene_types.h"
+#include "DNA_texture_types.h"
#include "BKE_library.h"
#include "BKE_animsys.h"