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/object.c')
-rw-r--r--source/blender/blenkernel/intern/object.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 7b36e46d45e..e63d6047cc6 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -112,6 +112,8 @@
#include "BPY_extern.h"
+#include "GPU_material.h"
+
#include "blendef.h"
/* Local function protos */
@@ -268,6 +270,7 @@ void free_object(Object *ob)
}
if(ob->soft) sbFree(ob->soft);
if(ob->fluidsimSettings) fluidsimSettingsFree(ob->fluidsimSettings);
+ if(ob->gpulamp.first) GPU_lamp_free(ob);
}
static void unlink_object__unlinkModifierLinks(void *userData, Object *ob, Object **obpoin)
@@ -694,9 +697,11 @@ float dof_camera(Object *ob)
if (cam->dof_ob) {
/* too simple, better to return the distance on the view axis only
* return VecLenf(ob->obmat[3], cam->dof_ob->obmat[3]); */
+ float mat[4][4], obmat[4][4];
- float mat[4][4];
- Mat4Invert(ob->imat, ob->obmat);
+ Mat4CpyMat4(obmat, ob->obmat);
+ Mat4Ortho(obmat);
+ Mat4Invert(ob->imat, obmat);
Mat4MulMat4(mat, cam->dof_ob->obmat, ob->imat);
return fabs(mat[3][2]);
}
@@ -918,7 +923,7 @@ Object *add_only_object(int type, char *name)
QuatOne(ob->dquat);
#endif
- ob->col[0]= ob->col[1]= ob->col[2]= 0.0;
+ ob->col[0]= ob->col[1]= ob->col[2]= 1.0;
ob->col[3]= 1.0;
ob->loc[0]= ob->loc[1]= ob->loc[2]= 0.0;
@@ -955,7 +960,8 @@ Object *add_only_object(int type, char *name)
ob->anisotropicFriction[0] = 1.0f;
ob->anisotropicFriction[1] = 1.0f;
ob->anisotropicFriction[2] = 1.0f;
- ob->gameflag= OB_PROP;
+ ob->gameflag= OB_PROP|OB_PHYSICS;
+ ob->margin = 0.0;
/* NT fluid sim defaults */
ob->fluidsimFlag = 0;
@@ -1226,6 +1232,7 @@ Object *copy_object(Object *ob)
obn->vnode = NULL;
#endif
+ obn->gpulamp.first = obn->gpulamp.last = NULL;
return obn;
}