Compare commits
98 Commits
blender2.4
...
sim_physic
Author | SHA1 | Date | |
---|---|---|---|
7da0d1a71e | |||
d5e9eb7d76 | |||
3b2ec94977 | |||
44cebb39b8 | |||
ffbd75e571 | |||
e1122a1b67 | |||
fc7a561de1 | |||
cf9886b0d0 | |||
8a0a557294 | |||
41b2a2a530 | |||
2b05a83729 | |||
ce637a0046 | |||
8fa180a9b1 | |||
561a9b3d4c | |||
1ed26fffb8 | |||
6cfbb0017a | |||
0572f1a5f6 | |||
834fda50d9 | |||
be1d06a2c5 | |||
7124d321d8 | |||
5f55aa43d0 | |||
c2f037da07 | |||
92f5c719ae | |||
aef61a7000 | |||
9e1da805e1 | |||
1b9eabeef6 | |||
bdf6711b70 | |||
6df8cf842a | |||
28da9ad12e | |||
14a0718a8a | |||
e5b51109e9 | |||
e6a903c06e | |||
8d5c14b20d | |||
a2da0911a6 | |||
bf747a30af | |||
3b2f996c25 | |||
a972107b03 | |||
f5f0c8fb37 | |||
389588bb4f | |||
5cdbbe3a92 | |||
15579884b1 | |||
5fb8debada | |||
258784ae4b | |||
deea0fa2e7 | |||
ba829e5c36 | |||
ffe81354f8 | |||
5fabc7781b | |||
ee1a143947 | |||
3a347c1caf | |||
8a6c82684f | |||
c62c61a413 | |||
876368d859 | |||
febcbdcfcd | |||
652e4b5225 | |||
6f656f6482 | |||
094fda8cd9 | |||
b12d9bfa9c | |||
97a7b05068 | |||
d335c2dfcf | |||
07f072457d | |||
9d2fc97827 | |||
49aa7edb77 | |||
b3000c5529 | |||
51d51991e5 | |||
d6808c2b4b | |||
c0ddd5fd49 | |||
a6bd4480ee | |||
2211b46084 | |||
21075b1a17 | |||
837211077c | |||
8c3e960dd4 | |||
25ece3ba2f | |||
67a9d4154d | |||
e114d194ae | |||
76658ef1a8 | |||
2745517ecd | |||
25236b56a6 | |||
8622cbca35 | |||
3c99a0f735 | |||
a667fc61d4 | |||
31d6a6be68 | |||
bab94c46e0 | |||
345dc8eb94 | |||
8056705ae9 | |||
c301a059bd | |||
5adff90b08 | |||
78c50f7af1 | |||
707f2e300c | |||
0417e79586 | |||
a0a5198a03 | |||
aed107cf4a | |||
45acf427a7 | |||
340c3b945e | |||
6b4ac3e7de | |||
50d0e1a988 | |||
c08acde589 | |||
7522f86d01 | |||
6701f07e66 |
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
*
|
||||
* $Id$
|
||||
* $Id: BOP_Merge2.cpp 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
*
|
||||
* $Id$
|
||||
* $Id: BOP_Misc.h 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: BLO_sys_types.h 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: mmap_win.c 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: mmap_win.h 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: BLO_sys_types.h 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
0
release/beos-4.5-i386/specific.sh
Executable file → Normal file
0
release/beos-4.5-i386/specific.sh
Executable file → Normal file
0
release/beos-5.0-i386/specific.sh
Executable file → Normal file
0
release/beos-5.0-i386/specific.sh
Executable file → Normal file
0
release/irix-6.2-mips/specific.sh
Executable file → Normal file
0
release/irix-6.2-mips/specific.sh
Executable file → Normal file
@@ -11,7 +11,7 @@ Tooltip: 'Export to M3G'
|
||||
#
|
||||
# Source: http://www.nelson-games.de/bl2m3g/source
|
||||
#
|
||||
# $Id$
|
||||
# $Id: export_m3g.py 17332 2008-11-05 11:42:34Z migius $
|
||||
#
|
||||
# Author: Gerhard V<>lkl
|
||||
#
|
||||
|
@@ -22,7 +22,7 @@ Be sure to set the framerate correctly
|
||||
|
||||
"""
|
||||
|
||||
# $Id$
|
||||
# $Id: import_lightwave_motion.py 17332 2008-11-05 11:42:34Z migius $
|
||||
# --------------------------------------------------------------------------
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
|
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* BMesh modeler structure and functions.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: BKE_bmesh.h 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* BMesh modeler structure and functions.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: BKE_bmeshCustomData.h 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
*
|
||||
* $Id$
|
||||
* $Id: BKE_bvhutils.h 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
@@ -134,4 +134,3 @@ void bvhcache_init(BVHCache *cache);
|
||||
void bvhcache_free(BVHCache *cache);
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* BKE_cloth.h
|
||||
*
|
||||
* $Id$
|
||||
* $Id: BKE_cloth.h,v 1.1 2007/08/01 02:07:27 daniel Exp $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* BKE_cloth.h
|
||||
*
|
||||
* $Id$
|
||||
* $Id: BKE_cloth.h,v 1.1 2007/08/01 02:07:27 daniel Exp $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
@@ -147,4 +147,3 @@ CollisionModifierData **get_collisionobjects(Object *self, int *numcollobj);
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id$
|
||||
* $Id: BKE_multires.h 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/* BKE_particle.h
|
||||
*
|
||||
*
|
||||
* $Id$
|
||||
* $Id: BKE_particle.h 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id$
|
||||
* $Id: BKE_sculpt.h 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
@@ -91,3 +91,4 @@ void texttool_docs_clear();
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -39,6 +39,8 @@ struct ColorBand;
|
||||
struct HaloRen;
|
||||
struct TexMapping;
|
||||
struct EnvMap;
|
||||
struct PointDensity;
|
||||
struct VoxelData;
|
||||
|
||||
/* in ColorBand struct */
|
||||
#define MAXCOLORBAND 32
|
||||
@@ -74,6 +76,16 @@ void BKE_free_envmap(struct EnvMap *env);
|
||||
struct EnvMap *BKE_add_envmap(void);
|
||||
struct EnvMap *BKE_copy_envmap(struct EnvMap *env);
|
||||
|
||||
void BKE_free_pointdensitydata(struct PointDensity *pd);
|
||||
void BKE_free_pointdensity(struct PointDensity *pd);
|
||||
struct PointDensity *BKE_add_pointdensity(void);
|
||||
struct PointDensity *BKE_copy_pointdensity(struct PointDensity *pd);
|
||||
|
||||
void BKE_free_voxeldatadata(struct VoxelData *vd);
|
||||
void BKE_free_voxeldata(struct VoxelData *vd);
|
||||
struct VoxelData *BKE_add_voxeldata(void);
|
||||
struct VoxelData *BKE_copy_voxeldata(struct VoxelData *vd);
|
||||
|
||||
int BKE_texture_dependsOnTime(const struct Tex *texture);
|
||||
|
||||
#endif
|
||||
|
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Custom Data functions for Bmesh
|
||||
*
|
||||
* $Id$
|
||||
* $Id: BME_Customdata.c 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* BMesh mesh level functions.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: BME_conversions.c 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* BMesh Euler construction API.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: BME_eulers.c 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* BMesh mesh level functions.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: BME_mesh.c 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Low level routines for manipulating the BMesh structure.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: BME_structure.c 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Functions for changing the topology of a mesh.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: BME_tools.c 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* low level, 'private' function prototypes for bmesh kernel.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: bmesh_private.h 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -617,7 +617,6 @@ void free_bvhtree_from_mesh(struct BVHTreeFromMesh *data)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* BVHCache */
|
||||
typedef struct BVHCacheItem
|
||||
{
|
||||
|
@@ -419,6 +419,28 @@ void do_physical_effector(Object *ob, float *opco, short type, float force_val,
|
||||
VecAddf(field,field,mag_vec);
|
||||
|
||||
break;
|
||||
case PFIELD_SPIN:
|
||||
{
|
||||
float inward[3];
|
||||
|
||||
Projf(temp, velocity, eff_vel);
|
||||
Crossf(mag_vec,eff_vel,vec_to_part);
|
||||
Crossf(inward, mag_vec, eff_vel);
|
||||
|
||||
Normalize(mag_vec);
|
||||
Normalize(inward);
|
||||
|
||||
VecSubf(mag_vec, mag_vec, inward);
|
||||
VecMulf(mag_vec,force_val*distance*falloff);
|
||||
|
||||
VecAddf(mag_vec, mag_vec, temp);
|
||||
|
||||
//VecCopyf(velocity, mag_vec);
|
||||
VecSubf(mag_vec, mag_vec, velocity);
|
||||
VecAddf(field, field, mag_vec);
|
||||
|
||||
break;
|
||||
}
|
||||
case PFIELD_MAGNET:
|
||||
if(planar)
|
||||
VecCopyf(temp,eff_vel);
|
||||
|
@@ -171,6 +171,14 @@ void init_material(Material *ma)
|
||||
ma->sss_front= 1.0f;
|
||||
ma->sss_back= 1.0f;
|
||||
|
||||
ma->vol_density_scale = 1.0f;
|
||||
ma->vol_stepsize = 0.2f;
|
||||
ma->vol_shade_stepsize = 0.2f;
|
||||
ma->vol_absorption = 1.0f;
|
||||
ma->vol_scattering = 1.0f;
|
||||
ma->vol_absorption_col[0] = ma->vol_absorption_col[1] = ma->vol_absorption_col[2] = 0.0f;
|
||||
ma->vol_precache_resolution = 50;
|
||||
|
||||
ma->mode= MA_TRACEBLE|MA_SHADBUF|MA_SHADOW|MA_RADIO|MA_RAYBIAS|MA_TANGENT_STR;
|
||||
|
||||
ma->preview = NULL;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id$
|
||||
* $Id: multires.c 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/* particle.c
|
||||
*
|
||||
*
|
||||
* $Id$
|
||||
* $Id: particle.c $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/* particle_system.c
|
||||
*
|
||||
*
|
||||
* $Id$
|
||||
* $Id: particle_system.c $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: suggestions.c 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -43,6 +43,7 @@
|
||||
#include "BLI_blenlib.h"
|
||||
#include "BLI_arithb.h"
|
||||
#include "BLI_rand.h"
|
||||
#include "BLI_kdopbvh.h"
|
||||
|
||||
#include "DNA_texture_types.h"
|
||||
#include "DNA_key_types.h"
|
||||
@@ -418,6 +419,8 @@ void free_texture(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);
|
||||
if(tex->vd) BKE_free_voxeldata(tex->vd);
|
||||
BKE_previewimg_free(&tex->preview);
|
||||
BKE_icon_delete((struct ID*)tex);
|
||||
tex->id.icon_id = 0;
|
||||
@@ -484,6 +487,16 @@ void default_tex(Tex *tex)
|
||||
tex->env->depth=0;
|
||||
}
|
||||
|
||||
if (tex->pd) {
|
||||
tex->pd->radius = 0.3f;
|
||||
tex->pd->falloff_type = TEX_PD_FALLOFF_STD;
|
||||
}
|
||||
|
||||
if (tex->vd) {
|
||||
tex->vd->resolX=50;
|
||||
tex->vd->interp_type=0;
|
||||
}
|
||||
|
||||
pit = tex->plugin;
|
||||
if (pit) {
|
||||
varstr= pit->varstr;
|
||||
@@ -580,6 +593,8 @@ Tex *copy_texture(Tex *tex)
|
||||
|
||||
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);
|
||||
if(texn->vd) texn->vd=BKE_copy_voxeldata(texn->vd);
|
||||
|
||||
if(tex->preview) texn->preview = BKE_previewimg_copy(tex->preview);
|
||||
|
||||
@@ -881,6 +896,104 @@ void BKE_free_envmap(EnvMap *env)
|
||||
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
PointDensity *BKE_add_pointdensity(void)
|
||||
{
|
||||
PointDensity *pd;
|
||||
|
||||
pd= MEM_callocN(sizeof(PointDensity), "pointdensity");
|
||||
pd->flag = 0;
|
||||
pd->radius = 0.3f;
|
||||
pd->falloff_type = TEX_PD_FALLOFF_STD;
|
||||
pd->falloff_softness = 2.0;
|
||||
pd->source = TEX_PD_PSYS;
|
||||
pd->point_tree = NULL;
|
||||
pd->point_data = NULL;
|
||||
pd->noise_size = 0.5f;
|
||||
pd->noise_depth = 1;
|
||||
pd->noise_fac = 1.0f;
|
||||
pd->noise_influence = TEX_PD_NOISE_STATIC;
|
||||
pd->coba = add_colorband(1);
|
||||
pd->speed_scale = 1.0f;
|
||||
pd->totpoints = 0;
|
||||
pd->coba = add_colorband(1);
|
||||
return pd;
|
||||
}
|
||||
|
||||
PointDensity *BKE_copy_pointdensity(PointDensity *pd)
|
||||
{
|
||||
PointDensity *pdn;
|
||||
|
||||
pdn= MEM_dupallocN(pd);
|
||||
pdn->point_tree = NULL;
|
||||
pdn->point_data = NULL;
|
||||
if(pdn->coba) pdn->coba= MEM_dupallocN(pdn->coba);
|
||||
|
||||
return pdn;
|
||||
}
|
||||
|
||||
void BKE_free_pointdensitydata(PointDensity *pd)
|
||||
{
|
||||
if (pd->point_tree) {
|
||||
BLI_bvhtree_free(pd->point_tree);
|
||||
pd->point_tree = NULL;
|
||||
}
|
||||
if (pd->point_data) {
|
||||
MEM_freeN(pd->point_data);
|
||||
pd->point_data = NULL;
|
||||
}
|
||||
if(pd->coba) MEM_freeN(pd->coba);
|
||||
}
|
||||
|
||||
void BKE_free_pointdensity(PointDensity *pd)
|
||||
{
|
||||
BKE_free_pointdensitydata(pd);
|
||||
MEM_freeN(pd);
|
||||
}
|
||||
|
||||
|
||||
void BKE_free_voxeldatadata(struct VoxelData *vd)
|
||||
{
|
||||
if (vd->dataset) {
|
||||
MEM_freeN(vd->dataset);
|
||||
vd->dataset = NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void BKE_free_voxeldata(struct VoxelData *vd)
|
||||
{
|
||||
BKE_free_voxeldatadata(vd);
|
||||
MEM_freeN(vd);
|
||||
}
|
||||
|
||||
struct VoxelData *BKE_add_voxeldata(void)
|
||||
{
|
||||
VoxelData *vd;
|
||||
|
||||
vd= MEM_callocN(sizeof(struct VoxelData), "voxeldata");
|
||||
vd->dataset = NULL;
|
||||
vd->resolX = 1;
|
||||
vd->resolY = 1;
|
||||
vd->resolZ = 1;
|
||||
vd->interp_type= TEX_VD_NEARESTNEIGHBOR;
|
||||
vd->int_multiplier = 1.0;
|
||||
|
||||
return vd;
|
||||
}
|
||||
|
||||
struct VoxelData *BKE_copy_voxeldata(struct VoxelData *vd)
|
||||
{
|
||||
VoxelData *vdn;
|
||||
|
||||
vdn= MEM_dupallocN(vd);
|
||||
vdn->dataset = NULL;
|
||||
|
||||
return vdn;
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
int BKE_texture_dependsOnTime(const struct Tex *texture)
|
||||
{
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: verse_method.c 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -253,6 +253,7 @@ void printvec4f(char *str, float v[4]);
|
||||
|
||||
void VecAddf(float *v, float *v1, float *v2);
|
||||
void VecSubf(float *v, float *v1, float *v2);
|
||||
void VecMulVecf(float *v, float *v1, float *v2);
|
||||
void VecLerpf(float *target, float *a, float *b, float t);
|
||||
void VecMidf(float *v, float *v1, float *v2);
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
*
|
||||
* $Id$
|
||||
* $Id: BLI_kdopbvh.h 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
@@ -71,6 +71,9 @@ typedef void (*BVHTree_NearestPointCallback) (void *userdata, int index, const f
|
||||
/* callback must update hit in case it finds a nearest successful hit */
|
||||
typedef void (*BVHTree_RayCastCallback) (void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit);
|
||||
|
||||
/* callback to range search query */
|
||||
typedef void (*BVHTree_RangeQuery) (void *userdata, int index, float squared_dist);
|
||||
|
||||
|
||||
BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis);
|
||||
void BLI_bvhtree_free(BVHTree *tree);
|
||||
@@ -93,5 +96,9 @@ int BLI_bvhtree_find_nearest(BVHTree *tree, const float *co, BVHTreeNearest *nea
|
||||
|
||||
int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata);
|
||||
|
||||
/* range query */
|
||||
int BLI_bvhtree_range_query(BVHTree *tree, const float *co, float radius, BVHTree_RangeQuery callback, void *userdata);
|
||||
|
||||
|
||||
#endif // BLI_KDOPBVH_H
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* A kd-tree for nearest neighbour search.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: BLI_kdtree.h 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
40
source/blender/blenlib/BLI_voxel.h
Normal file
40
source/blender/blenlib/BLI_voxel.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
*
|
||||
* ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): Matt Ebb, Raul Fernandez Hernandez (Farsthary).
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef BLI_VOXEL_H
|
||||
#define BLI_VOXEL_H
|
||||
|
||||
/* find the index number of a voxel, given x/y/z integer coords and resolution vector */
|
||||
#define V_I(x, y, z, res) ( (z)*(res)[1]*(res)[0] + (y)*(res)[0] + (x) )
|
||||
|
||||
/* all input coordinates must be in bounding box 0.0 - 1.0 */
|
||||
float voxel_sample_nearest(float *data, int *res, float *co);
|
||||
float voxel_sample_trilinear(float *data, int *res, float *co);
|
||||
float voxel_sample_tricubic(float *data, int *res, float *co);
|
||||
|
||||
#endif /* BLI_VOXEL_H */
|
@@ -1171,7 +1171,7 @@ static float squared_dist(const float *a, const float *b)
|
||||
}
|
||||
|
||||
//Determines the nearest point of the given node BV. Returns the squared distance to that point.
|
||||
static float calc_nearest_point(BVHNearestData *data, BVHNode *node, float *nearest)
|
||||
static float calc_nearest_point(const float *proj, BVHNode *node, float *nearest)
|
||||
{
|
||||
int i;
|
||||
const float *bv = node->bv;
|
||||
@@ -1179,12 +1179,12 @@ static float calc_nearest_point(BVHNearestData *data, BVHNode *node, float *near
|
||||
//nearest on AABB hull
|
||||
for(i=0; i != 3; i++, bv += 2)
|
||||
{
|
||||
if(bv[0] > data->proj[i])
|
||||
if(bv[0] > proj[i])
|
||||
nearest[i] = bv[0];
|
||||
else if(bv[1] < data->proj[i])
|
||||
else if(bv[1] < proj[i])
|
||||
nearest[i] = bv[1];
|
||||
else
|
||||
nearest[i] = data->proj[i];
|
||||
nearest[i] = proj[i];
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1206,7 +1206,7 @@ static float calc_nearest_point(BVHNearestData *data, BVHNode *node, float *near
|
||||
}
|
||||
}
|
||||
*/
|
||||
return squared_dist(data->co, nearest);
|
||||
return squared_dist(proj, nearest);
|
||||
}
|
||||
|
||||
|
||||
@@ -1229,7 +1229,7 @@ static void dfs_find_nearest_dfs(BVHNearestData *data, BVHNode *node)
|
||||
else
|
||||
{
|
||||
data->nearest.index = node->index;
|
||||
data->nearest.dist = calc_nearest_point(data, node, data->nearest.co);
|
||||
data->nearest.dist = calc_nearest_point(data->proj, node, data->nearest.co);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1243,7 +1243,7 @@ static void dfs_find_nearest_dfs(BVHNearestData *data, BVHNode *node)
|
||||
|
||||
for(i=0; i != node->totnode; i++)
|
||||
{
|
||||
if( calc_nearest_point(data, node->children[i], nearest) >= data->nearest.dist) continue;
|
||||
if( calc_nearest_point(data->proj, node->children[i], nearest) >= data->nearest.dist) continue;
|
||||
dfs_find_nearest_dfs(data, node->children[i]);
|
||||
}
|
||||
}
|
||||
@@ -1251,7 +1251,7 @@ static void dfs_find_nearest_dfs(BVHNearestData *data, BVHNode *node)
|
||||
{
|
||||
for(i=node->totnode-1; i >= 0 ; i--)
|
||||
{
|
||||
if( calc_nearest_point(data, node->children[i], nearest) >= data->nearest.dist) continue;
|
||||
if( calc_nearest_point(data->proj, node->children[i], nearest) >= data->nearest.dist) continue;
|
||||
dfs_find_nearest_dfs(data, node->children[i]);
|
||||
}
|
||||
}
|
||||
@@ -1261,7 +1261,7 @@ static void dfs_find_nearest_dfs(BVHNearestData *data, BVHNode *node)
|
||||
static void dfs_find_nearest_begin(BVHNearestData *data, BVHNode *node)
|
||||
{
|
||||
float nearest[3], sdist;
|
||||
sdist = calc_nearest_point(data, node, nearest);
|
||||
sdist = calc_nearest_point(data->proj, node, nearest);
|
||||
if(sdist >= data->nearest.dist) return;
|
||||
dfs_find_nearest_dfs(data, node);
|
||||
}
|
||||
@@ -1298,7 +1298,7 @@ static void bfs_find_nearest(BVHNearestData *data, BVHNode *node)
|
||||
}
|
||||
|
||||
current.node = node;
|
||||
current.dist = calc_nearest_point(data, node, nearest);
|
||||
current.dist = calc_nearest_point(data->proj, node, nearest);
|
||||
|
||||
while(current.dist < data->nearest.dist)
|
||||
{
|
||||
@@ -1326,7 +1326,7 @@ static void bfs_find_nearest(BVHNearestData *data, BVHNode *node)
|
||||
}
|
||||
|
||||
heap[heap_size].node = current.node->children[i];
|
||||
heap[heap_size].dist = calc_nearest_point(data, current.node->children[i], nearest);
|
||||
heap[heap_size].dist = calc_nearest_point(data->proj, current.node->children[i], nearest);
|
||||
|
||||
if(heap[heap_size].dist >= data->nearest.dist) continue;
|
||||
heap_size++;
|
||||
@@ -1524,3 +1524,90 @@ int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, float
|
||||
return data.hit.index;
|
||||
}
|
||||
|
||||
/*
|
||||
* Range Query - as request by broken :P
|
||||
*
|
||||
* Allocs and fills an array with the indexs of node that are on the given spherical range (center, radius)
|
||||
* Returns the size of the array.
|
||||
*/
|
||||
typedef struct RangeQueryData
|
||||
{
|
||||
BVHTree *tree;
|
||||
const float *center;
|
||||
float radius; //squared radius
|
||||
|
||||
int hits;
|
||||
|
||||
BVHTree_RangeQuery callback;
|
||||
void *userdata;
|
||||
|
||||
|
||||
} RangeQueryData;
|
||||
|
||||
|
||||
static void dfs_range_query(RangeQueryData *data, BVHNode *node)
|
||||
{
|
||||
if(node->totnode == 0)
|
||||
{
|
||||
|
||||
//Calculate the node min-coords (if the node was a point then this is the point coordinates)
|
||||
float co[3];
|
||||
co[0] = node->bv[0];
|
||||
co[1] = node->bv[2];
|
||||
co[2] = node->bv[4];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
int i;
|
||||
for(i=0; i != node->totnode; i++)
|
||||
{
|
||||
float nearest[3];
|
||||
float dist = calc_nearest_point(data->center, node->children[i], nearest);
|
||||
if(dist < data->radius)
|
||||
{
|
||||
//Its a leaf.. call the callback
|
||||
if(node->children[i]->totnode == 0)
|
||||
{
|
||||
data->hits++;
|
||||
data->callback( data->userdata, node->children[i]->index, dist );
|
||||
}
|
||||
else
|
||||
dfs_range_query( data, node->children[i] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int BLI_bvhtree_range_query(BVHTree *tree, const float *co, float radius, BVHTree_RangeQuery callback, void *userdata)
|
||||
{
|
||||
BVHNode * root = tree->nodes[tree->totleaf];
|
||||
|
||||
RangeQueryData data;
|
||||
data.tree = tree;
|
||||
data.center = co;
|
||||
data.radius = radius*radius;
|
||||
data.hits = 0;
|
||||
|
||||
data.callback = callback;
|
||||
data.userdata = userdata;
|
||||
|
||||
if(root != NULL)
|
||||
{
|
||||
float nearest[3];
|
||||
float dist = calc_nearest_point(data.center, root, nearest);
|
||||
if(dist < data.radius)
|
||||
{
|
||||
//Its a leaf.. call the callback
|
||||
if(root->totnode == 0)
|
||||
{
|
||||
data.hits++;
|
||||
data.callback( data.userdata, root->index, dist );
|
||||
}
|
||||
else
|
||||
dfs_range_query( &data, root );
|
||||
}
|
||||
}
|
||||
|
||||
return data.hits;
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: BLI_kdtree.c 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -2151,6 +2151,13 @@ void VecSubf(float *v, float *v1, float *v2)
|
||||
v[2]= v1[2]- v2[2];
|
||||
}
|
||||
|
||||
void VecMulVecf(float *v, float *v1, float *v2)
|
||||
{
|
||||
v[0] = v1[0] * v2[0];
|
||||
v[1] = v1[1] * v2[1];
|
||||
v[2] = v1[2] * v2[2];
|
||||
}
|
||||
|
||||
void VecLerpf(float *target, float *a, float *b, float t)
|
||||
{
|
||||
float s = 1.0f-t;
|
||||
@@ -3324,6 +3331,12 @@ float Normalize2(float *n)
|
||||
return d;
|
||||
}
|
||||
|
||||
float rgb_to_luminance(float r, float g, float b)
|
||||
{
|
||||
/* Rec. 709 HDTV */
|
||||
return (0.2126*r + 0.7152*g + 0.0722*b);
|
||||
}
|
||||
|
||||
void hsv_to_rgb(float h, float s, float v, float *r, float *g, float *b)
|
||||
{
|
||||
int i;
|
||||
|
311
source/blender/blenlib/intern/voxel.c
Normal file
311
source/blender/blenlib/intern/voxel.c
Normal file
@@ -0,0 +1,311 @@
|
||||
/**
|
||||
*
|
||||
* ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): Matt Ebb, Raul Fernandez Hernandez (Farsthary).
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
#include <math.h>
|
||||
|
||||
#include "BLI_voxel.h"
|
||||
|
||||
#include "BKE_utildefines.h"
|
||||
|
||||
|
||||
#if defined( _MSC_VER ) && !defined( __cplusplus )
|
||||
# define inline __inline
|
||||
#endif // defined( _MSC_VER ) && !defined( __cplusplus )
|
||||
|
||||
static inline float D(float *data, int *res, int x, int y, int z)
|
||||
{
|
||||
CLAMP(x, 0, res[0]-1);
|
||||
CLAMP(y, 0, res[1]-1);
|
||||
CLAMP(z, 0, res[2]-1);
|
||||
return data[ V_I(x, y, z, res) ];
|
||||
}
|
||||
|
||||
/* *** nearest neighbour *** */
|
||||
/* input coordinates must be in bounding box 0.0 - 1.0 */
|
||||
float voxel_sample_nearest(float *data, int *res, float *co)
|
||||
{
|
||||
int xi, yi, zi;
|
||||
|
||||
xi = co[0] * res[0];
|
||||
yi = co[1] * res[1];
|
||||
zi = co[2] * res[2];
|
||||
|
||||
return D(data, res, xi, yi, zi);
|
||||
}
|
||||
|
||||
|
||||
/* *** trilinear *** */
|
||||
/* input coordinates must be in bounding box 0.0 - 1.0 */
|
||||
|
||||
static inline float lerp(float t, float v1, float v2) {
|
||||
return (1.f - t) * v1 + t * v2;
|
||||
}
|
||||
|
||||
/* trilinear interpolation - taken partly from pbrt's implementation: http://www.pbrt.org */
|
||||
float voxel_sample_trilinear(float *data, int *res, float *co)
|
||||
{
|
||||
float voxx, voxy, voxz;
|
||||
int vx, vy, vz;
|
||||
float dx, dy, dz;
|
||||
float d00, d10, d01, d11, d0, d1, d_final;
|
||||
|
||||
if (!data) return 0.f;
|
||||
|
||||
voxx = co[0] * res[0] - 0.5f;
|
||||
voxy = co[1] * res[1] - 0.5f;
|
||||
voxz = co[2] * res[2] - 0.5f;
|
||||
|
||||
vx = (int)voxx; vy = (int)voxy; vz = (int)voxz;
|
||||
|
||||
dx = voxx - vx; dy = voxy - vy; dz = voxz - vz;
|
||||
|
||||
d00 = lerp(dx, D(data, res, vx, vy, vz), D(data, res, vx+1, vy, vz));
|
||||
d10 = lerp(dx, D(data, res, vx, vy+1, vz), D(data, res, vx+1, vy+1, vz));
|
||||
d01 = lerp(dx, D(data, res, vx, vy, vz+1), D(data, res, vx+1, vy, vz+1));
|
||||
d11 = lerp(dx, D(data, res, vx, vy+1, vz+1), D(data, res, vx+1, vy+1, vz+1));
|
||||
d0 = lerp(dy, d00, d10);
|
||||
d1 = lerp(dy, d01, d11);
|
||||
d_final = lerp(dz, d0, d1);
|
||||
|
||||
return d_final;
|
||||
}
|
||||
|
||||
/* *** tricubic *** */
|
||||
|
||||
int C[64][64] =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2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0},
|
||||
{-12,12,12,-12,12,-12,-12,12,-8,-4, 8, 4, 8, 4,-8,-4,-6, 6,-6, 6, 6,-6, 6,-6,-6, 6, 6,-6,-6, 6, 6,-6,-4,-2,-4,-2, 4, 2, 4, 2,-4,-2, 4, 2,-4,-2, 4, 2,-3, 3,-3, 3,-3, 3,-3, 3,-2,-1,-2,-1,-2,-1,-2,-1},
|
||||
{ 8,-8,-8, 8,-8, 8, 8,-8, 4, 4,-4,-4,-4,-4, 4, 4, 4,-4, 4,-4,-4, 4,-4, 4, 4,-4,-4, 4, 4,-4,-4, 4, 2, 2, 2, 2,-2,-2,-2,-2, 2, 2,-2,-2, 2, 2,-2,-2, 2,-2, 2,-2, 2,-2, 2,-2, 1, 1, 1, 1, 1, 1, 1, 1}};
|
||||
|
||||
static int ijk2n(int i, int j, int k) {
|
||||
return(i+4*j+16*k);
|
||||
}
|
||||
|
||||
static void tricubic_get_coeff_stacked(float a[64], float x[64]) {
|
||||
int i,j;
|
||||
for (i=0;i<64;i++) {
|
||||
a[i]=(float)(0.0);
|
||||
for (j=0;j<64;j++) {
|
||||
a[i]+=C[i][j]*x[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void point2xyz(int p, int *x, int *y, int *z) {
|
||||
switch (p) {
|
||||
case 0: *x=0; *y=0; *z=0; break;
|
||||
case 1: *x=1; *y=0; *z=0; break;
|
||||
case 2: *x=0; *y=1; *z=0; break;
|
||||
case 3: *x=1; *y=1; *z=0; break;
|
||||
case 4: *x=0; *y=0; *z=1; break;
|
||||
case 5: *x=1; *y=0; *z=1; break;
|
||||
case 6: *x=0; *y=1; *z=1; break;
|
||||
case 7: *x=1; *y=1; *z=1; break;
|
||||
default:*x=0; *y=0; *z=0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void tricubic_get_coeff(float a[64], float f[8], float dfdx[8], float dfdy[8], float dfdz[8], float d2fdxdy[8], float d2fdxdz[8], float d2fdydz[8], float d3fdxdydz[8]) {
|
||||
int i;
|
||||
float x[64];
|
||||
for (i=0;i<8;i++) {
|
||||
x[0+i]=f[i];
|
||||
x[8+i]=dfdx[i];
|
||||
x[16+i]=dfdy[i];
|
||||
x[24+i]=dfdz[i];
|
||||
x[32+i]=d2fdxdy[i];
|
||||
x[40+i]=d2fdxdz[i];
|
||||
x[48+i]=d2fdydz[i];
|
||||
x[56+i]=d3fdxdydz[i];
|
||||
}
|
||||
tricubic_get_coeff_stacked(a,x);
|
||||
}
|
||||
|
||||
static float tricubic_eval(float a[64], float x, float y, float z) {
|
||||
int i,j,k;
|
||||
float ret=(float)(0.0);
|
||||
|
||||
for (i=0;i<4;i++) {
|
||||
for (j=0;j<4;j++) {
|
||||
for (k=0;k<4;k++) {
|
||||
ret+=a[ijk2n(i,j,k)]*pow(x,i)*pow(y,j)*pow(z,k);
|
||||
}
|
||||
}
|
||||
}
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/* tricubic interpolation
|
||||
* from 'libtricubic': http://www.lekien.com/~francois/software/tricubic/
|
||||
* input coordinates must be in bounding box 0.0 - 1.0 */
|
||||
float voxel_sample_tricubic(float *data, int *res, float *co)
|
||||
{
|
||||
float xx, yy, zz;
|
||||
int xi,yi,zi;
|
||||
int *n = res;
|
||||
float dx,dy,dz;
|
||||
float a[64];
|
||||
|
||||
xx = co[0] * res[0] - 0.5f;
|
||||
yy = co[1] * res[1] - 0.5f;
|
||||
zz = co[2] * res[2] - 0.5f;
|
||||
|
||||
xi = (int)xx; yi = (int)yy; zi = (int)zz;
|
||||
|
||||
{
|
||||
float fval[8]={data[V_I(xi,yi,zi,n)],data[V_I(xi+1,yi,zi,n)],data[V_I(xi,yi+1,zi,n)],data[V_I(xi+1,yi+1,zi,n)],data[V_I(xi,yi,zi+1,n)],data[V_I(xi+1,yi,zi+1,n)],data[V_I(xi,yi+1,zi+1,n)],data[V_I(xi+1,yi+1,zi+1,n)]};
|
||||
|
||||
float dfdxval[8]={0.5f*(data[V_I(xi+1,yi,zi,n)]-data[V_I(xi-1,yi,zi,n)]),0.5f*(data[V_I(xi+2,yi,zi,n)]-data[V_I(xi,yi,zi,n)]),
|
||||
0.5f*(data[V_I(xi+1,yi+1,zi,n)]-data[V_I(xi-1,yi+1,zi,n)]),0.5f*(data[V_I(xi+2,yi+1,zi,n)]-data[V_I(xi,yi+1,zi,n)]),
|
||||
0.5f*(data[V_I(xi+1,yi,zi+1,n)]-data[V_I(xi-1,yi,zi+1,n)]),0.5f*(data[V_I(xi+2,yi,zi+1,n)]-data[V_I(xi,yi,zi+1,n)]),
|
||||
0.5f*(data[V_I(xi+1,yi+1,zi+1,n)]-data[V_I(xi-1,yi+1,zi+1,n)]),
|
||||
0.5f*(data[V_I(xi+2,yi+1,zi+1,n)]-data[V_I(xi,yi+1,zi+1,n)])};
|
||||
|
||||
float dfdyval[8]={0.5f*(data[V_I(xi,yi+1,zi,n)]-data[V_I(xi,yi-1,zi,n)]),0.5f*(data[V_I(xi+1,yi+1,zi,n)]-data[V_I(xi+1,yi-1,zi,n)]),
|
||||
0.5f*(data[V_I(xi,yi+2,zi,n)]-data[V_I(xi,yi,zi,n)]),0.5f*(data[V_I(xi+1,yi+2,zi,n)]-data[V_I(xi+1,yi,zi,n)]),
|
||||
0.5f*(data[V_I(xi,yi+1,zi+1,n)]-data[V_I(xi,yi-1,zi+1,n)]),0.5f*(data[V_I(xi+1,yi+1,zi+1,n)]-data[V_I(xi+1,yi-1,zi+1,n)]),
|
||||
0.5f*(data[V_I(xi,yi+2,zi+1,n)]-data[V_I(xi,yi,zi+1,n)]),
|
||||
0.5f*(data[V_I(xi+1,yi+2,zi+1,n)]-data[V_I(xi+1,yi,zi+1,n)])};
|
||||
|
||||
float dfdzval[8]={0.5f*(data[V_I(xi,yi,zi+1,n)]-data[V_I(xi,yi,zi-1,n)]),0.5f*(data[V_I(xi+1,yi,zi+1,n)]-data[V_I(xi+1,yi,zi-1,n)]),
|
||||
0.5f*(data[V_I(xi,yi+1,zi+1,n)]-data[V_I(xi,yi+1,zi-1,n)]),0.5f*(data[V_I(xi+1,yi+1,zi+1,n)]-data[V_I(xi+1,yi+1,zi-1,n)]),
|
||||
0.5f*(data[V_I(xi,yi,zi+2,n)]-data[V_I(xi,yi,zi,n)]),0.5f*(data[V_I(xi+1,yi,zi+2,n)]-data[V_I(xi+1,yi,zi,n)]),
|
||||
0.5f*(data[V_I(xi,yi+1,zi+2,n)]-data[V_I(xi,yi+1,zi,n)]),
|
||||
0.5f*(data[V_I(xi+1,yi+1,zi+2,n)]-data[V_I(xi+1,yi+1,zi,n)])};
|
||||
|
||||
float d2fdxdyval[8]={0.25*(data[V_I(xi+1,yi+1,zi,n)]-data[V_I(xi-1,yi+1,zi,n)]-data[V_I(xi+1,yi-1,zi,n)]+data[V_I(xi-1,yi-1,zi,n)]),
|
||||
0.25*(data[V_I(xi+2,yi+1,zi,n)]-data[V_I(xi,yi+1,zi,n)]-data[V_I(xi+2,yi-1,zi,n)]+data[V_I(xi,yi-1,zi,n)]),
|
||||
0.25*(data[V_I(xi+1,yi+2,zi,n)]-data[V_I(xi-1,yi+2,zi,n)]-data[V_I(xi+1,yi,zi,n)]+data[V_I(xi-1,yi,zi,n)]),
|
||||
0.25*(data[V_I(xi+2,yi+2,zi,n)]-data[V_I(xi,yi+2,zi,n)]-data[V_I(xi+2,yi,zi,n)]+data[V_I(xi,yi,zi,n)]),
|
||||
0.25*(data[V_I(xi+1,yi+1,zi+1,n)]-data[V_I(xi-1,yi+1,zi+1,n)]-data[V_I(xi+1,yi-1,zi+1,n)]+data[V_I(xi-1,yi-1,zi+1,n)]),
|
||||
0.25*(data[V_I(xi+2,yi+1,zi+1,n)]-data[V_I(xi,yi+1,zi+1,n)]-data[V_I(xi+2,yi-1,zi+1,n)]+data[V_I(xi,yi-1,zi+1,n)]),
|
||||
0.25*(data[V_I(xi+1,yi+2,zi+1,n)]-data[V_I(xi-1,yi+2,zi+1,n)]-data[V_I(xi+1,yi,zi+1,n)]+data[V_I(xi-1,yi,zi+1,n)]),
|
||||
0.25*(data[V_I(xi+2,yi+2,zi+1,n)]-data[V_I(xi,yi+2,zi+1,n)]-data[V_I(xi+2,yi,zi+1,n)]+data[V_I(xi,yi,zi+1,n)])};
|
||||
|
||||
float d2fdxdzval[8]={0.25f*(data[V_I(xi+1,yi,zi+1,n)]-data[V_I(xi-1,yi,zi+1,n)]-data[V_I(xi+1,yi,zi-1,n)]+data[V_I(xi-1,yi,zi-1,n)]),
|
||||
0.25f*(data[V_I(xi+2,yi,zi+1,n)]-data[V_I(xi,yi,zi+1,n)]-data[V_I(xi+2,yi,zi-1,n)]+data[V_I(xi,yi,zi-1,n)]),
|
||||
0.25f*(data[V_I(xi+1,yi+1,zi+1,n)]-data[V_I(xi-1,yi+1,zi+1,n)]-data[V_I(xi+1,yi+1,zi-1,n)]+data[V_I(xi-1,yi+1,zi-1,n)]),
|
||||
0.25f*(data[V_I(xi+2,yi+1,zi+1,n)]-data[V_I(xi,yi+1,zi+1,n)]-data[V_I(xi+2,yi+1,zi-1,n)]+data[V_I(xi,yi+1,zi-1,n)]),
|
||||
0.25f*(data[V_I(xi+1,yi,zi+2,n)]-data[V_I(xi-1,yi,zi+2,n)]-data[V_I(xi+1,yi,zi,n)]+data[V_I(xi-1,yi,zi,n)]),
|
||||
0.25f*(data[V_I(xi+2,yi,zi+2,n)]-data[V_I(xi,yi,zi+2,n)]-data[V_I(xi+2,yi,zi,n)]+data[V_I(xi,yi,zi,n)]),
|
||||
0.25f*(data[V_I(xi+1,yi+1,zi+2,n)]-data[V_I(xi-1,yi+1,zi+2,n)]-data[V_I(xi+1,yi+1,zi,n)]+data[V_I(xi-1,yi+1,zi,n)]),
|
||||
0.25f*(data[V_I(xi+2,yi+1,zi+2,n)]-data[V_I(xi,yi+1,zi+2,n)]-data[V_I(xi+2,yi+1,zi,n)]+data[V_I(xi,yi+1,zi,n)])};
|
||||
|
||||
|
||||
float d2fdydzval[8]={0.25f*(data[V_I(xi,yi+1,zi+1,n)]-data[V_I(xi,yi-1,zi+1,n)]-data[V_I(xi,yi+1,zi-1,n)]+data[V_I(xi,yi-1,zi-1,n)]),
|
||||
0.25f*(data[V_I(xi+1,yi+1,zi+1,n)]-data[V_I(xi+1,yi-1,zi+1,n)]-data[V_I(xi+1,yi+1,zi-1,n)]+data[V_I(xi+1,yi-1,zi-1,n)]),
|
||||
0.25f*(data[V_I(xi,yi+2,zi+1,n)]-data[V_I(xi,yi,zi+1,n)]-data[V_I(xi,yi+2,zi-1,n)]+data[V_I(xi,yi,zi-1,n)]),
|
||||
0.25f*(data[V_I(xi+1,yi+2,zi+1,n)]-data[V_I(xi+1,yi,zi+1,n)]-data[V_I(xi+1,yi+2,zi-1,n)]+data[V_I(xi+1,yi,zi-1,n)]),
|
||||
0.25f*(data[V_I(xi,yi+1,zi+2,n)]-data[V_I(xi,yi-1,zi+2,n)]-data[V_I(xi,yi+1,zi,n)]+data[V_I(xi,yi-1,zi,n)]),
|
||||
0.25f*(data[V_I(xi+1,yi+1,zi+2,n)]-data[V_I(xi+1,yi-1,zi+2,n)]-data[V_I(xi+1,yi+1,zi,n)]+data[V_I(xi+1,yi-1,zi,n)]),
|
||||
0.25f*(data[V_I(xi,yi+2,zi+2,n)]-data[V_I(xi,yi,zi+2,n)]-data[V_I(xi,yi+2,zi,n)]+data[V_I(xi,yi,zi,n)]),
|
||||
0.25f*(data[V_I(xi+1,yi+2,zi+2,n)]-data[V_I(xi+1,yi,zi+2,n)]-data[V_I(xi+1,yi+2,zi,n)]+data[V_I(xi+1,yi,zi,n)])};
|
||||
|
||||
|
||||
float d3fdxdydzval[8]={0.125f*(data[V_I(xi+1,yi+1,zi+1,n)]-data[V_I(xi-1,yi+1,zi+1,n)]-data[V_I(xi+1,yi-1,zi+1,n)]+data[V_I(xi-1,yi-1,zi+1,n)]-data[V_I(xi+1,yi+1,zi-1,n)]+data[V_I(xi-1,yi+1,zi-1,n)]+data[V_I(xi+1,yi-1,zi-1,n)]-data[V_I(xi-1,yi-1,zi-1,n)]),
|
||||
0.125f*(data[V_I(xi+2,yi+1,zi+1,n)]-data[V_I(xi,yi+1,zi+1,n)]-data[V_I(xi+2,yi-1,zi+1,n)]+data[V_I(xi,yi-1,zi+1,n)]-data[V_I(xi+2,yi+1,zi-1,n)]+data[V_I(xi,yi+1,zi-1,n)]+data[V_I(xi+2,yi-1,zi-1,n)]-data[V_I(xi,yi-1,zi-1,n)]),
|
||||
0.125f*(data[V_I(xi+1,yi+2,zi+1,n)]-data[V_I(xi-1,yi+2,zi+1,n)]-data[V_I(xi+1,yi,zi+1,n)]+data[V_I(xi-1,yi,zi+1,n)]-data[V_I(xi+1,yi+2,zi-1,n)]+data[V_I(xi-1,yi+2,zi-1,n)]+data[V_I(xi+1,yi,zi-1,n)]-data[V_I(xi-1,yi,zi-1,n)]),
|
||||
0.125f*(data[V_I(xi+2,yi+2,zi+1,n)]-data[V_I(xi,yi+2,zi+1,n)]-data[V_I(xi+2,yi,zi+1,n)]+data[V_I(xi,yi,zi+1,n)]-data[V_I(xi+2,yi+2,zi-1,n)]+data[V_I(xi,yi+2,zi-1,n)]+data[V_I(xi+2,yi,zi-1,n)]-data[V_I(xi,yi,zi-1,n)]),
|
||||
0.125f*(data[V_I(xi+1,yi+1,zi+2,n)]-data[V_I(xi-1,yi+1,zi+2,n)]-data[V_I(xi+1,yi-1,zi+2,n)]+data[V_I(xi-1,yi-1,zi+2,n)]-data[V_I(xi+1,yi+1,zi,n)]+data[V_I(xi-1,yi+1,zi,n)]+data[V_I(xi+1,yi-1,zi,n)]-data[V_I(xi-1,yi-1,zi,n)]),
|
||||
0.125f*(data[V_I(xi+2,yi+1,zi+2,n)]-data[V_I(xi,yi+1,zi+2,n)]-data[V_I(xi+2,yi-1,zi+2,n)]+data[V_I(xi,yi-1,zi+2,n)]-data[V_I(xi+2,yi+1,zi,n)]+data[V_I(xi,yi+1,zi,n)]+data[V_I(xi+2,yi-1,zi,n)]-data[V_I(xi,yi-1,zi,n)]),
|
||||
0.125f*(data[V_I(xi+1,yi+2,zi+2,n)]-data[V_I(xi-1,yi+2,zi+2,n)]-data[V_I(xi+1,yi,zi+2,n)]+data[V_I(xi-1,yi,zi+2,n)]-data[V_I(xi+1,yi+2,zi,n)]+data[V_I(xi-1,yi+2,zi,n)]+data[V_I(xi+1,yi,zi,n)]-data[V_I(xi-1,yi,zi,n)]),
|
||||
0.125f*(data[V_I(xi+2,yi+2,zi+2,n)]-data[V_I(xi,yi+2,zi+2,n)]-data[V_I(xi+2,yi,zi+2,n)]+data[V_I(xi,yi,zi+2,n)]-data[V_I(xi+2,yi+2,zi,n)]+data[V_I(xi,yi+2,zi,n)]+data[V_I(xi+2,yi,zi,n)]-data[V_I(xi,yi,zi,n)])};
|
||||
|
||||
|
||||
tricubic_get_coeff(a,fval,dfdxval,dfdyval,dfdzval,d2fdxdyval,d2fdxdzval,d2fdydzval,d3fdxdydzval);
|
||||
}
|
||||
|
||||
dx = xx-xi;
|
||||
dy = yy-yi;
|
||||
dz = zz-zi;
|
||||
|
||||
return tricubic_eval(a,dx,dy,dz);
|
||||
|
||||
}
|
||||
|
@@ -2505,6 +2505,7 @@ static void lib_link_texture(FileData *fd, Main *main)
|
||||
tex->ima= newlibadr_us(fd, tex->id.lib, tex->ima);
|
||||
tex->ipo= newlibadr_us(fd, tex->id.lib, tex->ipo);
|
||||
if(tex->env) tex->env->object= newlibadr(fd, tex->id.lib, tex->env->object);
|
||||
if(tex->pd) tex->pd->object= newlibadr(fd, tex->id.lib, tex->pd->object);
|
||||
|
||||
if(tex->nodetree)
|
||||
lib_link_ntree(fd, &tex->id, tex->nodetree);
|
||||
@@ -2535,6 +2536,17 @@ static void direct_link_texture(FileData *fd, Tex *tex)
|
||||
tex->env->ok= 0;
|
||||
}
|
||||
|
||||
tex->pd= newdataadr(fd, tex->pd);
|
||||
if(tex->pd) {
|
||||
tex->pd->point_tree = NULL;
|
||||
tex->pd->coba= newdataadr(fd, tex->pd->coba);
|
||||
}
|
||||
|
||||
tex->vd= newdataadr(fd, tex->vd);
|
||||
if(tex->vd) {
|
||||
tex->vd->dataset = NULL;
|
||||
}
|
||||
|
||||
tex->nodetree= newdataadr(fd, tex->nodetree);
|
||||
if(tex->nodetree)
|
||||
direct_link_nodetree(fd, tex->nodetree);
|
||||
@@ -7741,6 +7753,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
Object *ob;
|
||||
bActionStrip *strip;
|
||||
|
||||
|
||||
/* nla-strips - scale */
|
||||
for (ob= main->object.first; ob; ob= ob->id.next) {
|
||||
for (strip= ob->nlastrips.first; strip; strip= strip->next) {
|
||||
@@ -7763,6 +7776,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
ob->soft->shearstiff = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ((main->versionfile < 245) || (main->versionfile == 245 && main->subversionfile < 14)) {
|
||||
@@ -7908,6 +7922,57 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
la->skyblendtype= MA_RAMP_ADD;
|
||||
la->skyblendfac= 1.0f;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (main->versionfile <= 247) {
|
||||
Material *ma;
|
||||
Tex *tex;
|
||||
|
||||
for(ma=main->mat.first; ma; ma= ma->id.next) {
|
||||
/* trigger for non-volumetric file */
|
||||
if (ma->vol_shade_stepsize < 0.0001f) {
|
||||
ma->vol_shade_stepsize = 0.2f;
|
||||
ma->vol_stepsize = 0.2f;
|
||||
ma->vol_absorption = 1.0f;
|
||||
ma->vol_scattering = 1.0f;
|
||||
ma->vol_absorption_col[0] = ma->vol_absorption_col[1] = ma->vol_absorption_col[2] = 0.0f;
|
||||
}
|
||||
if (ma->vol_density_scale < 0.0001f)
|
||||
ma->vol_density_scale = 1.0f;
|
||||
if (ma->vol_precache_resolution == 0)
|
||||
ma->vol_precache_resolution = 50;
|
||||
if (ma->vol_depth_cutoff < 0.0001)
|
||||
ma->vol_depth_cutoff = 0.05;
|
||||
}
|
||||
|
||||
for(tex=main->tex.first; tex; tex= tex->id.next) {
|
||||
if (tex->pd == NULL)
|
||||
tex->pd = BKE_add_pointdensity();
|
||||
else if (tex->pd->noise_size < 0.0001f) {
|
||||
tex->pd->noise_size = 0.5f;
|
||||
tex->pd->noise_depth = 1;
|
||||
tex->pd->noise_fac = 1.0f;
|
||||
tex->pd->noise_influence = TEX_PD_NOISE_STATIC;
|
||||
}
|
||||
if (tex->pd->falloff_softness < 1.0f)
|
||||
tex->pd->falloff_softness = 2.0f;
|
||||
if (tex->pd->coba == NULL) {
|
||||
tex->pd->coba = add_colorband(1);
|
||||
tex->pd->speed_scale = 1.0f;
|
||||
}
|
||||
|
||||
if (tex->vd == NULL) {
|
||||
tex->vd = BKE_add_voxeldata();
|
||||
} else if (tex->vd->resolX == 0) {
|
||||
tex->vd->dataset = NULL;
|
||||
tex->vd->resolX = 1;
|
||||
tex->vd->resolY = 1;
|
||||
tex->vd->resolZ = 1;
|
||||
tex->vd->interp_type= TEX_VD_NEARESTNEIGHBOR;
|
||||
tex->vd->int_multiplier = 1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* set the curve radius interpolation to 2.47 default - easy */
|
||||
@@ -7932,6 +7997,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* direction constraint actuators were always local in previous version */
|
||||
if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 7)) {
|
||||
bActuator *act;
|
||||
@@ -8005,6 +8071,26 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
}
|
||||
}
|
||||
|
||||
if (main->versionfile < 248 || (main->versionfile == 248 && main->subversionfile < 3)) {
|
||||
Tex *tex;
|
||||
Material *ma;
|
||||
|
||||
/* blend texture extrapolation */
|
||||
for(tex=main->tex.first; tex; tex= tex->id.next) {
|
||||
if (tex->type == TEX_BLEND)
|
||||
tex->extend = TEX_EXTEND;
|
||||
}
|
||||
|
||||
for(ma=main->mat.first; ma; ma= ma->id.next) {
|
||||
if (ma->vol_shadeflag & 2) { // old MA_VOL_ATTENUATED
|
||||
ma->vol_shade_type = MA_VOL_SHADE_SINGLE;
|
||||
ma->vol_ms_diff = 0.5f;
|
||||
ma->vol_ms_steps = 5;
|
||||
ma->vol_ms_intensity = 1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (main->versionfile < 248 || (main->versionfile == 248 && main->subversionfile < 2)) {
|
||||
Scene *sce;
|
||||
|
||||
|
@@ -1335,6 +1335,11 @@ static void write_textures(WriteData *wd, ListBase *idbase)
|
||||
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->pd) {
|
||||
writestruct(wd, DATA, "PointDensity", 1, tex->pd);
|
||||
if(tex->pd->coba) writestruct(wd, DATA, "ColorBand", 1, tex->pd->coba);
|
||||
}
|
||||
if(tex->vd) writestruct(wd, DATA, "VoxelData", 1, tex->vd);
|
||||
|
||||
/* nodetree is integral part of texture, no libdata */
|
||||
if(tex->nodetree) {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: GPU_draw.h 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: GPU_extensions.h 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: GPU_material.h 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# $Id$
|
||||
# $Id: Makefile 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
#
|
||||
# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
|
||||
#
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# $Id$
|
||||
# $Id: Makefile 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
#
|
||||
# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
|
||||
#
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: gpu_codegen.c 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: gpu_codegen.h 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: gpu_draw.c 19616 2009-04-09 10:05:17Z campbellbarton $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: gpu_extensions.c 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: gpu_material.c 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* IMB_jp2.h
|
||||
*
|
||||
* $Id$
|
||||
* $Id: IMB_bmp.h 14444 2008-04-16 22:40:48Z hos $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: BlockDXT.cpp 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: BlockDXT.h 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: Color.h 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: ColorBlock.cpp 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: ColorBlock.h 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: Common.h 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: DirectDrawSurface.cpp 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: DirectDrawSurface.h 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: Image.cpp 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: Image.h 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,7 @@
|
||||
<<<<<<< .working
|
||||
#
|
||||
# $Id$
|
||||
<<<<<<< .working
|
||||
# $Id: Makefile 19805 2009-04-20 00:19:16Z genscher $
|
||||
#
|
||||
# ***** BEGIN GPL LICENSE BLOCK *****
|
||||
#
|
||||
@@ -58,3 +60,68 @@ CPPFLAGS += -I../..
|
||||
CPPFLAGS += -I..
|
||||
CPPFLAGS += -I.
|
||||
CPPFLAGS += -DWITH_DDS
|
||||
=======
|
||||
#
|
||||
# $Id: Makefile 7037 2006-03-12 14:11:23Z ton $
|
||||
=======
|
||||
# $Id$
|
||||
>>>>>>> .merge-right.r19825
|
||||
#
|
||||
# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
# All rights reserved.
|
||||
#
|
||||
# The Original Code is: all of this file.
|
||||
#
|
||||
# Contributor(s): none yet.
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
#
|
||||
#
|
||||
|
||||
LIBNAME = dds
|
||||
DIR = $(OCGDIR)/blender/imbuf/dds
|
||||
SOURCEDIR = source/blender/imbuf/intern/dds
|
||||
|
||||
include nan_compile.mk
|
||||
include nan_definitions.mk
|
||||
|
||||
CFLAGS += $(LEVEL_1_C_WARNINGS)
|
||||
|
||||
CPPFLAGS += -I$(NAN_JPEG)/include
|
||||
CPPFLAGS += -I$(NAN_PNG)/include
|
||||
CPPFLAGS += -I$(NAN_ZLIB)/include
|
||||
CPPFLAGS += -I$(NAN_TIFF)/include
|
||||
CPPFLAGS += -I../../../include
|
||||
CPPFLAGS += -I../../../blenkernel
|
||||
CPPFLAGS += -I../../../blenlib
|
||||
CPPFLAGS += -I../../../avi
|
||||
CPPFLAGS += -I../../../quicktime
|
||||
# path to the guarded memory allocator
|
||||
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
|
||||
CPPFLAGS += -I$(NAN_MEMUTIL)/include
|
||||
# This is not really needed, but until /include is cleaned, it must be
|
||||
# there for proper compilation.
|
||||
# - No, it is also needed in antialias, for listbase (nzc)
|
||||
CPPFLAGS += -I../../../makesdna
|
||||
# external interface of this module
|
||||
CPPFLAGS += -I../..
|
||||
CPPFLAGS += -I..
|
||||
CPPFLAGS += -I.
|
||||
CPPFLAGS += -DWITH_DDS
|
||||
>>>>>>> .merge-right.r19804
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: PixelFormat.h 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: Stream.cpp 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: Stream.h 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: dds_api.cpp 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: dds_api.h 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/* BIF_editparticle.h
|
||||
*
|
||||
*
|
||||
* $Id$
|
||||
* $Id: BIF_editparticle.h $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: BIF_meshlaplacian.h 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id$
|
||||
* $Id: multires.h 13015 2007-12-27 07:27:03Z nicholasbishop $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: BIF_editaction.h 10519 2007-04-13 11:15:08Z aligorith $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -267,6 +267,8 @@ void curvemap_buttons(struct uiBlock *block, struct CurveMapping *cumap, char la
|
||||
#define B_ENV_FREE_ALL 1357
|
||||
#define B_TEX_USENODES 1358
|
||||
|
||||
#define B_VOXELDATA_LOAD 1359
|
||||
|
||||
|
||||
/* **************** animbuts = object buttons ******* */
|
||||
#define B_ANIMBUTS 1500
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: DNA_cloth_types.h,v 1.1 2007/08/01 02:28:34 daniel Exp $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -62,6 +62,27 @@ typedef struct Material {
|
||||
float translucency;
|
||||
/* end synced with render_types.h */
|
||||
|
||||
short material_type; /* solid, halo, volumetric */
|
||||
short pad5;
|
||||
|
||||
/* volumetrics */
|
||||
short vol_stepsize_type;
|
||||
short vol_precache_resolution;
|
||||
float vol_stepsize, vol_shade_stepsize;
|
||||
float vol_depth_cutoff;
|
||||
short vol_shade_type;
|
||||
short vpad;
|
||||
float vol_density_scale;
|
||||
float vol_absorption, vol_scattering;
|
||||
float vol_absorption_col[3];
|
||||
short vol_shadeflag;
|
||||
short vol_phasefunc_type;
|
||||
float vol_phasefunc_g;
|
||||
float vpad2;
|
||||
|
||||
float vol_ms_diff, vol_ms_intensity;
|
||||
int vol_ms_steps;
|
||||
|
||||
float fresnel_mir, fresnel_mir_i;
|
||||
float fresnel_tra, fresnel_tra_i;
|
||||
float filter; /* filter added, for raytrace transparency and transmissivity */
|
||||
@@ -153,6 +174,13 @@ typedef struct Material {
|
||||
/* flag */
|
||||
/* for render */
|
||||
#define MA_IS_USED 1
|
||||
#define MA_IS_TEXTURED 2
|
||||
|
||||
/* material_type */
|
||||
#define MA_SOLID 0
|
||||
#define MA_PTHALO 1
|
||||
#define MA_VOLUME 2
|
||||
#define MA_VOLUMESOLID 3
|
||||
|
||||
/* mode (is int) */
|
||||
#define MA_TRACEBLE 1
|
||||
@@ -328,5 +356,30 @@ typedef struct Material {
|
||||
/* sss_flag */
|
||||
#define MA_DIFF_SSS 1
|
||||
|
||||
/* vol_stepsize_type */
|
||||
#define MA_VOL_STEP_RANDOMIZED 0
|
||||
#define MA_VOL_STEP_CONSTANT 1
|
||||
#define MA_VOL_STEP_ADAPTIVE 2
|
||||
|
||||
/* vol_shadeflag */
|
||||
#define MA_VOL_SHADED 1
|
||||
#define MA_VOL_RECVSHADOW 4
|
||||
#define MA_VOL_PRECACHESHADING 8
|
||||
#define MA_VOL_USEALPHA 16
|
||||
|
||||
/* vol_shading_type */
|
||||
#define MA_VOL_SHADE_NONE 0
|
||||
#define MA_VOL_SHADE_SINGLE 1
|
||||
#define MA_VOL_SHADE_MULTIPLE 2
|
||||
#define MA_VOL_SHADE_SINGLEPLUSMULTIPLE 3
|
||||
|
||||
/* vol_phasefunc_type */
|
||||
#define MA_VOL_PH_ISOTROPIC 0
|
||||
#define MA_VOL_PH_MIEHAZY 1
|
||||
#define MA_VOL_PH_MIEMURKY 2
|
||||
#define MA_VOL_PH_RAYLEIGH 3
|
||||
#define MA_VOL_PH_HG 4
|
||||
#define MA_VOL_PH_SCHLICK 5
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -210,6 +210,7 @@ typedef struct SoftBody {
|
||||
#define PFIELD_HARMONIC 7
|
||||
#define PFIELD_CHARGE 8
|
||||
#define PFIELD_LENNARDJ 9
|
||||
#define PFIELD_SPIN 10
|
||||
|
||||
|
||||
/* pd->flag: various settings */
|
||||
|
@@ -1,7 +1,8 @@
|
||||
/* DNA_particle_types.h
|
||||
*
|
||||
*
|
||||
* $Id$
|
||||
<<<<<<< .working
|
||||
* $Id: DNA_particle_types.h 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -127,6 +127,55 @@ typedef struct EnvMap {
|
||||
short recalc, lastsize;
|
||||
} EnvMap;
|
||||
|
||||
typedef struct PointDensity {
|
||||
short flag;
|
||||
|
||||
short falloff_type;
|
||||
float falloff_softness;
|
||||
float radius;
|
||||
short source;
|
||||
short color_source;
|
||||
int totpoints;
|
||||
|
||||
int pdpad;
|
||||
|
||||
struct Object *object; /* for 'Object' or 'Particle system' type - source object */
|
||||
short psys_cache_space; /* cache points in worldspace, object space, ... ? */
|
||||
short psysindex; /* for 'Particle system' type - object's psys number */
|
||||
|
||||
short ob_cache_space; /* cache points in worldspace, object space, ... ? */
|
||||
|
||||
short pdpad2;
|
||||
|
||||
void *point_tree; /* the acceleration tree containing points */
|
||||
float *point_data; /* dynamically allocated extra for extra information, like particle age */
|
||||
|
||||
float noise_size;
|
||||
short noise_depth;
|
||||
short noise_influence;
|
||||
short noise_basis;
|
||||
short pdpad3[3];
|
||||
float noise_fac;
|
||||
|
||||
float speed_scale;
|
||||
struct ColorBand *coba; /* for time -> color */
|
||||
|
||||
} PointDensity;
|
||||
|
||||
typedef struct VoxelData {
|
||||
int resolX, resolY, resolZ;
|
||||
int interp_type;
|
||||
short file_format;
|
||||
short flag;
|
||||
|
||||
float int_multiplier;
|
||||
|
||||
int still, still_frame;
|
||||
char source_path[240];
|
||||
float *dataset;
|
||||
|
||||
} VoxelData;
|
||||
|
||||
typedef struct Tex {
|
||||
ID id;
|
||||
|
||||
@@ -173,6 +222,8 @@ typedef struct Tex {
|
||||
struct ColorBand *coba;
|
||||
struct EnvMap *env;
|
||||
struct PreviewImage * preview;
|
||||
struct PointDensity *pd;
|
||||
struct VoxelData *vd;
|
||||
|
||||
char use_nodes;
|
||||
char pad[7];
|
||||
@@ -212,6 +263,9 @@ typedef struct TexMapping {
|
||||
#define TEX_MUSGRAVE 11
|
||||
#define TEX_VORONOI 12
|
||||
#define TEX_DISTNOISE 13
|
||||
/* predicting ocean texture for 14 */
|
||||
#define TEX_POINTDENSITY 15
|
||||
#define TEX_VOXELDATA 16
|
||||
|
||||
/* musgrave stype */
|
||||
#define TEX_MFRACTAL 0
|
||||
@@ -389,5 +443,58 @@ typedef struct TexMapping {
|
||||
#define ENV_NORMAL 1
|
||||
#define ENV_OSA 2
|
||||
|
||||
/* **************** PointDensity ********************* */
|
||||
|
||||
/* source */
|
||||
#define TEX_PD_PSYS 0
|
||||
#define TEX_PD_OBJECT 1
|
||||
#define TEX_PD_FILE 2
|
||||
|
||||
/* falloff_type */
|
||||
#define TEX_PD_FALLOFF_STD 0
|
||||
#define TEX_PD_FALLOFF_SMOOTH 1
|
||||
#define TEX_PD_FALLOFF_SOFT 2
|
||||
#define TEX_PD_FALLOFF_CONSTANT 3
|
||||
#define TEX_PD_FALLOFF_ROOT 4
|
||||
|
||||
/* psys_cache_space */
|
||||
#define TEX_PD_OBJECTLOC 0
|
||||
#define TEX_PD_OBJECTSPACE 1
|
||||
#define TEX_PD_WORLDSPACE 2
|
||||
|
||||
/* flag */
|
||||
#define TEX_PD_TURBULENCE 1
|
||||
|
||||
|
||||
/* noise_influence */
|
||||
#define TEX_PD_NOISE_STATIC 0
|
||||
#define TEX_PD_NOISE_VEL 1
|
||||
#define TEX_PD_NOISE_AGE 2
|
||||
#define TEX_PD_NOISE_TIME 3
|
||||
|
||||
/* color_source */
|
||||
#define TEX_PD_COLOR_CONSTANT 0
|
||||
#define TEX_PD_COLOR_PARTAGE 1
|
||||
#define TEX_PD_COLOR_PARTSPEED 2
|
||||
#define TEX_PD_COLOR_PARTVEL 3
|
||||
|
||||
#define POINT_DATA_VEL 1
|
||||
#define POINT_DATA_LIFE 2
|
||||
|
||||
/******************** Voxel Data *****************************/
|
||||
/* flag */
|
||||
|
||||
|
||||
/* interpolation */
|
||||
#define TEX_VD_NEARESTNEIGHBOR 0
|
||||
#define TEX_VD_LINEAR 1
|
||||
#define TEX_VD_TRICUBIC 2
|
||||
|
||||
/* file format */
|
||||
#define TEX_VD_BLENDERVOXEL 0
|
||||
#define TEX_VD_RAW_8BIT 1
|
||||
#define TEX_VD_RAW_16BIT 2
|
||||
#define TEX_VD_IMAGE_SEQUENCE 3
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: TEX_node.h 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: CMP_normalize.c 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: CMP_premulkey.c 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: SHD_invert.c 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# $Id$
|
||||
# $Id: Makefile 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
#
|
||||
# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
|
||||
#
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: TEX_image.c 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: TEX_valToRgb.c 19485 2009-03-31 22:34:34Z gsrb3d $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -1,3 +1,4 @@
|
||||
<<<<<<< .working
|
||||
# Blender.Object module and the Object PyType object
|
||||
|
||||
"""
|
||||
@@ -40,6 +41,7 @@ This module provides access to the B{Particle} in Blender.
|
||||
- LINE: Draw as lines
|
||||
- PATH: Draw pathes
|
||||
- OBJECT: Draw object
|
||||
<<<<<<< .working
|
||||
- GROUP: Draw group
|
||||
- BILLBOARD: Draw as billboard
|
||||
@type CHILDTYPE: readonly dictionary
|
||||
@@ -250,3 +252,260 @@ class Particle:
|
||||
@rtype: list of floats
|
||||
@return: list of floats or list of tuples if id is not zero (size,id) or None if system is disabled.
|
||||
"""
|
||||
=======
|
||||
# Blender.Object module and the Object PyType object
|
||||
|
||||
"""
|
||||
The Blender.Particle submodule
|
||||
|
||||
|
||||
Particle
|
||||
========
|
||||
|
||||
This module provides access to the B{Particle} in Blender.
|
||||
|
||||
@type TYPE: readonly dictionary
|
||||
@var TYPE: Constant dict used for with L{Particle.TYPE}
|
||||
- HAIR: set particle system to hair mode.
|
||||
- REACTOR: set particle system to reactor mode.
|
||||
- EMITTER: set particle system to emitter mode.
|
||||
@type DISTRIBUTION: readonly dictionary
|
||||
@var DISTRIBUTION: Constant dict used for with L{Particle.DISTRIBUTION}
|
||||
- GRID: set grid distribution.
|
||||
- RANDOM: set random distribution.
|
||||
- JITTERED: set jittered distribution.
|
||||
@type EMITFROM: readonly dictionary
|
||||
@var EMITFROM: Constant dict used for with L{Particle.EMITFROM}
|
||||
- VERTS: set particles emit from vertices
|
||||
- FACES: set particles emit from faces
|
||||
- VOLUME: set particles emit from volume
|
||||
- PARTICLE: set particles emit from particles
|
||||
@type REACTON: readonly dictionary
|
||||
@var REACTON: Constant dict used for with L{Particle.REACTON}
|
||||
- NEAR: react on near
|
||||
- COLLISION: react on collision
|
||||
- DEATH: react on death
|
||||
@type DRAWAS: readonly dictionary
|
||||
@var DRAWAS: Constant dict used for with L{Particle.DRAWAS}
|
||||
- NONE: Don't draw
|
||||
- POINT: Draw as point
|
||||
- CIRCLE: Draw as circles
|
||||
- CROSS: Draw as crosses
|
||||
- AXIS: Draw as axis
|
||||
- LINE: Draw as lines
|
||||
- PATH: Draw pathes
|
||||
- OBJECT: Draw object
|
||||
- GROUP: Draw goup
|
||||
=======
|
||||
- GROUP: Draw group
|
||||
>>>>>>> .merge-right.r19825
|
||||
- BILLBOARD: Draw as billboard
|
||||
@type CHILDTYPE: readonly dictionary
|
||||
@var CHILDTYPE: Constant dict used for whith L{Particle.CHILDTYPE}
|
||||
- NONE: set no children
|
||||
- PARTICLES: set children born from particles
|
||||
- FACES: set children born from faces
|
||||
@type CHILDKINK: readonly dictionary
|
||||
@var CHILDKINK: Type of periodic offset on the path
|
||||
- NOTHING: set no offset on the path
|
||||
- CURL: set curl offset on the path
|
||||
- RADIAL: set radial offset on the path
|
||||
- WAVE: set wave offset on the path
|
||||
- BRAID: set braid offset on the path
|
||||
@type CHILDKINKAXIS: readonly dictionary
|
||||
@var CHILDKINKAXIS: Which axis to use for offset
|
||||
- X: set X axis for offset
|
||||
- Y: set Y axis for offset
|
||||
- Z: set Z axis for offset
|
||||
"""
|
||||
|
||||
class Particle:
|
||||
"""
|
||||
The Particle object
|
||||
===================
|
||||
This object gives access to paticles data.
|
||||
|
||||
@ivar seed: Set an offset in the random table.
|
||||
@type seed: int
|
||||
@ivar type: Type of particle system ( Particle.TYPE[ 'HAIR' | 'REACTOR' | 'EMITTER' ] ).
|
||||
@type type: int
|
||||
@ivar resolutionGrid: The resolution of the particle grid.
|
||||
@type resolutionGrid: int
|
||||
@ivar startFrame: Frame number to start emitting particles.
|
||||
@type startFrame: float
|
||||
@ivar endFrame: Frame number to stop emitting particles.
|
||||
@type endFrame: float
|
||||
@ivar editable: Finalize hair to enable editing in particle mode.
|
||||
@type editable: int
|
||||
@ivar amount: The total number of particles.
|
||||
@type amount: int
|
||||
@ivar multireact: React multiple times ( Particle.REACTON[ 'NEAR' | 'COLLISION' | 'DEATH' ] ).
|
||||
@type multireact: int
|
||||
@ivar reactshape: Power of reaction strength, dependent on distance to target.
|
||||
@type reactshape: float
|
||||
@ivar hairSegments: Amount of hair segments.
|
||||
@type hairSegments: int
|
||||
@ivar lifetime: Specify the life span of the particles.
|
||||
@type lifetime: float
|
||||
@ivar randlife: Give the particle life a random variation.
|
||||
@type randlife: float
|
||||
@ivar randemission: Emit particles in random order.
|
||||
@type randemission: int
|
||||
@ivar particleDistribution: Where to emit particles from ( Particle.EMITFROM[ 'PARTICLE' | 'VOLUME' | 'FACES' | 'VERTS' ] )
|
||||
@type particleDistribution: int
|
||||
@ivar evenDistribution: Use even distribution from faces based on face areas or edge lengths.
|
||||
@type evenDistribution: int
|
||||
@ivar distribution: How to distribute particles on selected element ( Particle.DISTRIBUTION[ 'GRID' | 'RANDOM' | 'JITTERED' ] ).
|
||||
@type distribution: int
|
||||
@ivar jitterAmount: Amount of jitter applied to the sampling.
|
||||
@type jitterAmount: float
|
||||
@ivar pf: Emission locations / face (0 = automatic).
|
||||
@type pf:int
|
||||
@ivar invert: Invert what is considered object and what is not.
|
||||
@type invert: int
|
||||
@ivar targetObject: The object that has the target particle system (empty if same object).
|
||||
@type targetObject: Blender object
|
||||
@ivar targetpsys: The target particle system number in the object.
|
||||
@type targetpsys: int
|
||||
@ivar 2d: Constrain boids to a surface.
|
||||
@type 2d: float
|
||||
@ivar maxvel: Maximum velocity.
|
||||
@type maxvel: float
|
||||
@ivar avvel: The usual speed % of max velocity.
|
||||
@type avvel: float
|
||||
@ivar latacc: Lateral acceleration % of max velocity
|
||||
@type latacc: float
|
||||
@ivar tanacc: Tangential acceleration % of max velocity
|
||||
@type tanacc: float
|
||||
@ivar groundz: Default Z value.
|
||||
@type groundz: float
|
||||
@ivar object: Constrain boids to object's surface.
|
||||
@type object: Blender Object
|
||||
@ivar renderEmitter: Render emitter object.
|
||||
@type renderEmitter: int
|
||||
@ivar displayPercentage: Particle display percentage.
|
||||
@type displayPercentage: int
|
||||
@ivar hairDisplayStep: How many steps paths are drawn with (power of 2) in visu mode.
|
||||
@type hairDisplayStep: int
|
||||
@ivar hairRenderStep: How many steps paths are rendered with (power of 2) in render mode."
|
||||
@type hairRenderStep: int
|
||||
@ivar duplicateObject: Get the duplicate object.
|
||||
@type duplicateObject: Blender Object
|
||||
@ivar drawAs: Get draw type Particle.DRAWAS([ 'NONE' | 'OBJECT' | 'POINT' | ... ]).
|
||||
@type drawAs: int
|
||||
@ivar childAmount: The total number of children
|
||||
@type childAmount: int
|
||||
@ivar childType: Type of childrens ( Particle.CHILDTYPE[ 'FACES' | 'PARTICLES' | 'NONE' ] )
|
||||
@type childType: int
|
||||
@ivar childRenderAmount: Amount of children/parent for rendering
|
||||
@type childRenderAmount: int
|
||||
@ivar childRadius: Radius of children around parent
|
||||
@type childRadius: float
|
||||
@ivar childRound: Roundness of children around parent
|
||||
@type childRound: float
|
||||
@ivar childClump: Amount of clumpimg
|
||||
@type childClump: float
|
||||
@ivar childShape: Shape of clumpimg
|
||||
@type childShape: float
|
||||
@ivar childSize: A multiplier for the child particle size
|
||||
@type childSize: float
|
||||
@ivar childRand: Random variation to the size of the child particles
|
||||
@type childRand: float
|
||||
@ivar childRough1: Amount of location dependant rough
|
||||
@type childRough1: float
|
||||
@ivar childRough1Size: Size of location dependant rough
|
||||
@type childRough1Size: float
|
||||
@ivar childRough2: Amount of random rough
|
||||
@type childRough2: float
|
||||
@ivar childRough2Size: Size of random rough
|
||||
@type childRough2Size: float
|
||||
@ivar childRough2Thresh: Amount of particles left untouched by random rough
|
||||
@type childRough2Thresh: float
|
||||
@ivar childRoughE: Amount of end point rough
|
||||
@type childRoughE: float
|
||||
@ivar childRoughEShape: Shape of end point rough
|
||||
@type childRoughEShape: float
|
||||
@ivar childKink: Type of periodic offset on the path (Particle.CHILDKINK[ 'BRAID' | 'WAVE' | 'RADIAL' | 'CURL' | 'NOTHING' ])
|
||||
@type childKink: int
|
||||
@ivar childKinkAxis: Which axis to use for offset (Particle.CHILDKINKAXIS[ 'Z' | 'Y' | 'X' ])
|
||||
@type childKinkAxis: int
|
||||
@ivar childKinkFreq: The frequency of the offset (1/total length)
|
||||
@type childKinkFreq: float
|
||||
@ivar childKinkShape: Adjust the offset to the beginning/end
|
||||
@type childKinkShape: float
|
||||
@ivar childKinkAmp: The amplitude of the offset
|
||||
@type childKinkAmp: float
|
||||
@ivar childBranch: Branch child paths from eachother
|
||||
@type childBranch: int
|
||||
@ivar childBranch: Animate branching
|
||||
@type childBranch: int
|
||||
@ivar childBranch: Start and end points are the same
|
||||
@type childBranch: int
|
||||
@ivar childBranch: Threshold of branching
|
||||
@type childBranch: float
|
||||
"""
|
||||
|
||||
def freeEdit():
|
||||
"""
|
||||
Free edit mode.
|
||||
@return: None
|
||||
"""
|
||||
|
||||
def getLoc(all=0,id=0):
|
||||
"""
|
||||
Get the particles locations.
|
||||
A list of tuple is returned in particle mode.
|
||||
A list of list of tuple is returned in hair mode.
|
||||
The tuple is a vector of 3 or 4 floats in world space (x,y,z, optionally the particle's id).
|
||||
@type all: int
|
||||
@param all: if not 0 export all particles (uninitialized (unborn or died)particles exported as None).
|
||||
@type id: int
|
||||
@param id: add the particle id in the end of the vector tuple
|
||||
@rtype: list of vectors (tuple of 3 floats and optionally the id) or list of list of vectors
|
||||
@return: list of vectors or list of list of vectors (hair mode) or None if system is disabled
|
||||
"""
|
||||
def getRot(all=0,id=0):
|
||||
"""
|
||||
Get the particles' rotations as quaternion.
|
||||
A list of tuple is returned in particle mode.
|
||||
The tuple is vector of 4 or 5 floats (x,y,z,w, optionally the id of the particle).
|
||||
|
||||
@type all: int
|
||||
@param all: if not 0, export all particles (uninitialized (unborn or died) particles exported as None).
|
||||
@type id: int
|
||||
@param id: add the particle id in the return tuple
|
||||
@rtype: list of tuple of 4 or 5 elements (if id is not zero)
|
||||
@return: list of 4-tuples or None if system is disabled
|
||||
"""
|
||||
|
||||
def getMat():
|
||||
"""
|
||||
Get the particles' material.
|
||||
@rtype: Blender Material
|
||||
@return: The material assigned to particles
|
||||
"""
|
||||
|
||||
def getSize(all=0,id=0):
|
||||
"""
|
||||
Get the particles' size.
|
||||
A list of float or list of tuple (particle's size,particle's id).
|
||||
@type all: int
|
||||
@param all: if not 0, export all particles (uninitialized (unborn or died) particles exported as None).
|
||||
@type id: int
|
||||
@param id: add the particle id in the return tuple
|
||||
@rtype: list of floats
|
||||
@return: list of floats or list of tuples if id is not zero (size,id) or None if system is disabled.
|
||||
"""
|
||||
|
||||
def getAge(all=0,id=0):
|
||||
"""
|
||||
Get the particles' age.
|
||||
A list of float or list of tuple (particle's age, particle's id).
|
||||
@type all: int
|
||||
@param all: if not 0, export all particles (uninitialized (unborn or died) particles exported as None).
|
||||
@type id: int
|
||||
@param id: add the particle id in the return tuple
|
||||
@rtype: list of floats
|
||||
@return: list of floats or list of tuples if id is not zero (size,id) or None if system is disabled.
|
||||
"""
|
||||
>>>>>>> .merge-right.r19804
|
||||
|
0
source/blender/python/api2_2x/doc/epy_docgen.sh
Executable file → Normal file
0
source/blender/python/api2_2x/doc/epy_docgen.sh
Executable file → Normal file
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $Id: RE_raytrace.h 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
@@ -113,7 +113,7 @@ typedef struct ShadeInput
|
||||
|
||||
/* internal face coordinates */
|
||||
float u, v, dx_u, dx_v, dy_u, dy_v;
|
||||
float co[3], view[3];
|
||||
float co[3], view[3], camera_co[3];
|
||||
|
||||
/* copy from material, keep synced so we can do memcopy */
|
||||
/* current size: 23*4 */
|
||||
@@ -161,6 +161,7 @@ typedef struct ShadeInput
|
||||
|
||||
int samplenr; /* sample counter, to detect if we should do shadow again */
|
||||
int depth; /* 1 or larger on raytrace shading */
|
||||
int volume_depth; /* number of intersections through volumes */
|
||||
|
||||
/* stored copy of original face normal (facenor)
|
||||
* before flipping. Used in Front/back output on geometry node */
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id$
|
||||
* $Id: occlusion.h 19805 2009-04-20 00:19:16Z genscher $
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
|
44
source/blender/render/intern/include/pointdensity.h
Normal file
44
source/blender/render/intern/include/pointdensity.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
*
|
||||
* ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): Matt Ebb
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#ifndef POINTDENSITY_H
|
||||
#define POINTDENSITY_H
|
||||
|
||||
/**
|
||||
* Make point density kd-trees for all point density textures in the scene
|
||||
*/
|
||||
|
||||
struct Render;
|
||||
struct TexResult;
|
||||
|
||||
void make_pointdensities(struct Render *re);
|
||||
void free_pointdensities(struct Render *re);
|
||||
int pointdensitytex(struct Tex *tex, float *texvec, struct TexResult *texres);
|
||||
|
||||
#endif /* POINTDENSITY_H */
|
||||
|
@@ -202,6 +202,10 @@ struct Render
|
||||
|
||||
struct Object *excludeob;
|
||||
|
||||
ListBase render_volumes_inside;
|
||||
ListBase volumes;
|
||||
ListBase volume_precache_parts;
|
||||
|
||||
/* arena for allocating data for use during render, for
|
||||
* example dynamic TFaces to go in the VlakRen structure.
|
||||
*/
|
||||
@@ -286,6 +290,8 @@ typedef struct ObjectInstanceRen {
|
||||
float dupliorco[3], dupliuv[2];
|
||||
float (*duplitexmat)[4];
|
||||
|
||||
struct VolumePrecache *volume_precache;
|
||||
|
||||
float *vectors;
|
||||
int totvector;
|
||||
} ObjectInstanceRen;
|
||||
@@ -345,6 +351,7 @@ typedef struct HaloRen
|
||||
struct Material *mat;
|
||||
} HaloRen;
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
typedef struct StrandVert {
|
||||
@@ -395,6 +402,45 @@ typedef struct StrandRen {
|
||||
float orco[3];
|
||||
} StrandRen;
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
typedef struct VolumeOb
|
||||
{
|
||||
struct VolumeOb *next, *prev;
|
||||
struct Material *ma;
|
||||
struct ObjectRen *obr;
|
||||
} VolumeOb;
|
||||
|
||||
typedef struct MatInside {
|
||||
struct MatInside *next, *prev;
|
||||
struct Material *ma;
|
||||
} MatInside;
|
||||
|
||||
typedef struct VolPrecachePart
|
||||
{
|
||||
struct VolPrecachePart *next, *prev;
|
||||
struct RayTree *tree;
|
||||
struct ShadeInput *shi;
|
||||
struct ObjectInstanceRen *obi;
|
||||
int num;
|
||||
int minx, maxx;
|
||||
int miny, maxy;
|
||||
int minz, maxz;
|
||||
int res[3];
|
||||
float bbmin[3];
|
||||
float voxel[3];
|
||||
int working, done;
|
||||
} VolPrecachePart;
|
||||
|
||||
typedef struct VolumePrecache
|
||||
{
|
||||
int res[3];
|
||||
float *data_r;
|
||||
float *data_g;
|
||||
float *data_b;
|
||||
} VolumePrecache;
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
struct LampRen;
|
||||
struct MTex;
|
||||
|
@@ -48,6 +48,7 @@ struct RenderPart;
|
||||
struct RenderLayer;
|
||||
struct ObjectRen;
|
||||
struct ListBase;
|
||||
struct Isect;
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
@@ -98,6 +99,7 @@ extern void makeraytree(Render *re);
|
||||
|
||||
extern void ray_shadow(ShadeInput *, LampRen *, float *);
|
||||
extern void ray_trace(ShadeInput *, ShadeResult *);
|
||||
extern void ray_trace_shadow_tra(struct Isect *is, int depth, int traflag);
|
||||
extern void ray_ao(ShadeInput *, float *);
|
||||
extern void init_jitter_plane(LampRen *lar);
|
||||
extern void init_ao_sphere(struct World *wrld);
|
||||
|
@@ -33,6 +33,7 @@ struct VlakRen;
|
||||
struct StrandSegment;
|
||||
struct StrandPoint;
|
||||
struct ObjectInstanceRen obi;
|
||||
struct Isect;
|
||||
|
||||
/* shadeinput.c */
|
||||
|
||||
@@ -52,6 +53,7 @@ typedef struct ShadeSample {
|
||||
|
||||
/* also the node shader callback */
|
||||
void shade_material_loop(struct ShadeInput *shi, struct ShadeResult *shr);
|
||||
void shade_volume_loop(struct ShadeInput *shi, struct ShadeResult *shr);
|
||||
|
||||
void shade_input_set_triangle_i(struct ShadeInput *shi, struct ObjectInstanceRen *obi, struct VlakRen *vlr, short i1, short i2, short i3);
|
||||
void shade_input_set_triangle(struct ShadeInput *shi, volatile int obi, volatile int facenr, int normal_flip);
|
||||
@@ -86,7 +88,11 @@ void shade_color(struct ShadeInput *shi, ShadeResult *shr);
|
||||
void ambient_occlusion_to_diffuse(struct ShadeInput *shi, float *diff);
|
||||
void ambient_occlusion(struct ShadeInput *shi);
|
||||
|
||||
ListBase *get_lights(struct ShadeInput *shi);
|
||||
float lamp_get_visibility(struct LampRen *lar, float *co, float *lv, float *dist);
|
||||
void lamp_get_shadow(struct LampRen *lar, ShadeInput *shi, float inp, float *shadfac, int do_real);
|
||||
|
||||
float fresnel_fac(float *view, float *vn, float fresnel, float fac);
|
||||
|
||||
/* rayshade.c */
|
||||
extern void shade_ray(struct Isect *is, struct ShadeInput *shi, struct ShadeResult *shr);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user