Merging r57934 through r57953 from trunk into soc-2013-depsgraph_mt

This commit is contained in:
2013-07-03 08:31:46 +00:00
11 changed files with 1070 additions and 825 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -22,7 +22,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
/** \file audaspace/jack/AUD_JacLibrary.cpp
/** \file audaspace/jack/AUD_JackLibrary.cpp
* \ingroup audjack
*/

View File

@@ -22,7 +22,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
/** \file audaspace/jack/AUD_JacLibrary.cpp
/** \file audaspace/jack/AUD_JackLibrary.cpp
* \ingroup audjack
*/

View File

@@ -16,6 +16,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "background.h"
#include "device.h"
#include "integrator.h"
#include "film.h"
@@ -568,9 +569,24 @@ void LightManager::device_update_points(Device *device, DeviceScene *dscene, Sce
light_data[i*LIGHT_SIZE + 3] = make_float4(samples, 0.0f, 0.0f, 0.0f);
}
else if(light->type == LIGHT_BACKGROUND) {
uint visibility = scene->background->visibility;
shader_id &= ~SHADER_AREA_LIGHT;
shader_id |= SHADER_USE_MIS;
if(!(visibility & PATH_RAY_DIFFUSE)) {
shader_id |= SHADER_EXCLUDE_DIFFUSE;
use_light_visibility = true;
}
if(!(visibility & PATH_RAY_GLOSSY)) {
shader_id |= SHADER_EXCLUDE_GLOSSY;
use_light_visibility = true;
}
if(!(visibility & PATH_RAY_TRANSMIT)) {
shader_id |= SHADER_EXCLUDE_TRANSMIT;
use_light_visibility = true;
}
light_data[i*LIGHT_SIZE + 0] = make_float4(__int_as_float(light->type), 0.0f, 0.0f, 0.0f);
light_data[i*LIGHT_SIZE + 1] = make_float4(__int_as_float(shader_id), 0.0f, 0.0f, 0.0f);
light_data[i*LIGHT_SIZE + 2] = make_float4(0.0f, 0.0f, 0.0f, 0.0f);

View File

@@ -369,7 +369,6 @@ def reset_all(reload_scripts=False):
Sets the addon state based on the user preferences.
"""
import sys
import imp
# RELEASE SCRIPTS: official scripts distributed in Blender releases
paths_list = paths()
@@ -381,6 +380,7 @@ def reset_all(reload_scripts=False):
# first check if reload is needed before changing state.
if reload_scripts:
import imp
mod = sys.modules.get(mod_name)
if mod:
imp.reload(mod)

View File

@@ -27,8 +27,6 @@ from bpy.props import (StringProperty,
EnumProperty,
)
from rna_prop_ui import rna_idprop_ui_prop_get, rna_idprop_ui_prop_clear
from bpy.app.translations import pgettext_tip as tip_
@@ -1029,6 +1027,8 @@ class WM_OT_properties_edit(Operator):
)
def execute(self, context):
from rna_prop_ui import rna_idprop_ui_prop_get, rna_idprop_ui_prop_clear
data_path = self.data_path
value = self.value
prop = self.property
@@ -1080,6 +1080,8 @@ class WM_OT_properties_edit(Operator):
return {'FINISHED'}
def invoke(self, context, event):
from rna_prop_ui import rna_idprop_ui_prop_get
data_path = self.data_path
if not data_path:
@@ -1109,6 +1111,8 @@ class WM_OT_properties_add(Operator):
data_path = rna_path
def execute(self, context):
from rna_prop_ui import rna_idprop_ui_prop_get
data_path = self.data_path
item = eval("context.%s" % data_path)

View File

@@ -421,23 +421,24 @@ void psys_calc_dmcache(Object *ob, DerivedMesh *dm, ParticleSystem *psys)
continue;
}
if (psys->part->from == PART_FROM_VERT) {
if (pa->num < totelem && nodearray[pa->num])
pa->num_dmcache= GET_INT_FROM_POINTER(nodearray[pa->num]->link);
if (use_modifier_stack) {
if (pa->num < totelem)
pa->num_dmcache = DMCACHE_ISCHILD;
else
pa->num_dmcache = DMCACHE_NOTFOUND;
}
else { /* FROM_FACE/FROM_VOLUME */
/* Note that sometimes the pa->num is over the nodearray size, this is bad, maybe there is a better place to fix this,
* but for now passing NULL is OK. every face will be searched for the particle so its slower - Campbell */
if (use_modifier_stack) {
else {
if (psys->part->from == PART_FROM_VERT) {
if (pa->num < totelem && nodearray[pa->num])
pa->num_dmcache = GET_INT_FROM_POINTER(nodearray[pa->num]->link);
pa->num_dmcache= GET_INT_FROM_POINTER(nodearray[pa->num]->link);
else
pa->num_dmcache = DMCACHE_NOTFOUND;
}
else
else { /* FROM_FACE/FROM_VOLUME */
/* Note that sometimes the pa->num is over the nodearray size, this is bad, maybe there is a better place to fix this,
* but for now passing NULL is OK. every face will be searched for the particle so its slower - Campbell */
pa->num_dmcache= psys_particle_dm_face_lookup(ob, dm, pa->num, pa->fuv, pa->num < totelem ? nodearray[pa->num] : NULL);
}
}
}

View File

@@ -290,7 +290,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
MVert *mvert = dm->getVertArray(dm);
int totvert = dm->getNumVerts(dm);
int totface = dm->getNumPolys(dm);
int i, j, j_next, seam;
int i, seam;
UvMapVert *v;
UvVertMap *vmap;
float limit[2];
@@ -339,6 +339,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
for (i = 0; i < totface; i++) {
MPoly *mp = &((MPoly *) mpoly)[i];
int nverts = mp->totloop;
int j, j_next;
CCGFace *origf = ccgSubSurf_getFace(origss, SET_INT_IN_POINTER(i));
/* unsigned int *fv = &mp->v1; */
MLoop *ml = mloop + mp->loopstart;
@@ -353,14 +354,14 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
get_face_uv_map_vert(vmap, mpoly, ml, i, fverts);
for (j = 0, j_next = nverts - 1; j < nverts; j_next = j++) {
unsigned int v0 = GET_UINT_FROM_POINTER(fverts[j]);
unsigned int v1 = GET_UINT_FROM_POINTER(fverts[j_next]);
MVert *mv0 = mvert + (ml[j].v);
MVert *mv1 = mvert + (ml[j_next].v);
unsigned int v0 = GET_UINT_FROM_POINTER(fverts[j_next]);
unsigned int v1 = GET_UINT_FROM_POINTER(fverts[j]);
MVert *mv0 = mvert + (ml[j_next].v);
MVert *mv1 = mvert + (ml[j].v);
if (!BLI_edgehash_haskey(ehash, v0, v1)) {
CCGEdge *e, *orige = ccgSubSurf_getFaceEdge(origf, j);
CCGEdgeHDL ehdl = SET_INT_IN_POINTER(mp->loopstart + j);
CCGEdge *e, *orige = ccgSubSurf_getFaceEdge(origf, j_next);
CCGEdgeHDL ehdl = SET_INT_IN_POINTER(mp->loopstart + j_next);
float crease;
if ((mv0->flag & mv1->flag) & ME_VERT_MERGED)
@@ -368,7 +369,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
else
crease = ccgSubSurf_getEdgeCrease(orige);
ccgSubSurf_syncEdge(ss, ehdl, fverts[j], fverts[j_next], crease, &e);
ccgSubSurf_syncEdge(ss, ehdl, fverts[j_next], fverts[j], crease, &e);
BLI_edgehash_insert(ehash, v0, v1, NULL);
}
}

View File

@@ -304,7 +304,7 @@ static BMFace *bev_create_quad_tri(BMesh *bm, BMVert *v1, BMVert *v2, BMVert *v3
}
static BMFace *bev_create_quad_tri_ex(BMesh *bm, BMVert *v1, BMVert *v2, BMVert *v3, BMVert *v4,
BMFace *f1, BMFace *f2, BMFace *f3, BMFace *f4)
BMFace *f1, BMFace *f2, BMFace *f3, BMFace *f4)
{
BMVert *varr[4] = {v1, v2, v3, v4};
BMFace *farr[4] = {f1, f2, f3, f4};
@@ -314,18 +314,18 @@ static BMFace *bev_create_quad_tri_ex(BMesh *bm, BMVert *v1, BMVert *v2, BMVert
/* Is Loop layer layer_index contiguous across shared vertex of l1 and l2? */
static bool contig_ldata_across_loops(BMesh *bm, BMLoop *l1, BMLoop *l2,
int layer_index)
int layer_index)
{
const int offset = bm->ldata.layers[layer_index].offset;
const int type = bm->ldata.layers[layer_index].type;
return CustomData_data_equals(type,
(char *)l1->head.data + offset,
(char *)l2->head.data + offset);
(char *)l1->head.data + offset,
(char *)l2->head.data + offset);
}
/* Are all loop layers with have math (e.g., UVs) contiguous from face f1 to face f2 across edge e? */
static bool contig_ldata_across_edge(BMesh *bm, BMEdge *e, BMFace* f1, BMFace *f2)
static bool contig_ldata_across_edge(BMesh *bm, BMEdge *e, BMFace *f1, BMFace *f2)
{
BMLoop *lef1, *lef2;
BMLoop *lv1f1, *lv1f2, *lv2f1, *lv2f2;
@@ -342,17 +342,21 @@ static bool contig_ldata_across_edge(BMesh *bm, BMEdge *e, BMFace* f1, BMFace *f
if (lef1->f == f2) {
SWAP(BMLoop *, lef1, lef2);
}
if (lef1->v == v1) {
lv1f1 = lef1;
lv2f1 = BM_face_other_edge_loop(f1, e, v2);
} else {
}
else {
lv2f1 = lef1;
lv1f1 = BM_face_other_edge_loop(f1, e, v1);
}
if (lef2->v == v1) {
lv1f2 = lef2;
lv2f2 = BM_face_other_edge_loop(f2, e, v2);
} else {
}
else {
lv2f2 = lef2;
lv1f2 = BM_face_other_edge_loop(f2, e, v1);
}
@@ -360,7 +364,8 @@ static bool contig_ldata_across_edge(BMesh *bm, BMEdge *e, BMFace* f1, BMFace *f
for (i = 0; i < bm->ldata.totlayer; i++) {
if (CustomData_layer_has_math(&bm->ldata, i) &&
(!contig_ldata_across_loops(bm, lv1f1, lv1f2, i) ||
!contig_ldata_across_loops(bm, lv2f1, lv2f2, i))) {
!contig_ldata_across_loops(bm, lv2f1, lv2f2, i)))
{
return false;
}
}
@@ -406,7 +411,8 @@ static BMFace *bev_create_quad_straddle(BMesh *bm, BMVert *v1, BMVert *v2, BMVer
/* Merge (using average) all the UV values for loops of v's faces.
* Caller should ensure that no seams are violated by doing this. */
static void bev_merge_uvs(BMesh *bm, BMVert *v) {
static void bev_merge_uvs(BMesh *bm, BMVert *v)
{
BMIter iter;
MLoopUV *luv;
BMLoop *l;
@@ -425,7 +431,7 @@ static void bev_merge_uvs(BMesh *bm, BMVert *v) {
n++;
}
if (n > 1) {
mul_v2_fl(uv, 1.0f/(float)n);
mul_v2_fl(uv, 1.0f / (float)n);
BM_ITER_ELEM(l, &iter, v, BM_LOOPS_OF_VERT) {
luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
copy_v2_v2(luv->uv, uv);
@@ -1165,9 +1171,9 @@ static void bevel_build_rings(BMesh *bm, BevVert *bv)
/* f23 is interp face for bmv2 and bmv3 */
f23 = f;
if (odd && k == ns2 && f2 && !v->any_seam)
f23 = f2;
f23 = f2;
bev_create_quad_tri_ex(bm, bmv1, bmv2, bmv3, bmv4,
f, f23, f23, f);
f, f23, f23, f);
}
}
else if (v->prev->ebev && v->prev->prev->ebev) {
@@ -1187,9 +1193,9 @@ static void bevel_build_rings(BMesh *bm, BevVert *bv)
}
f23 = f;
if (odd && k == ns2 && f2 && !v->any_seam)
f23 = f2;
f23 = f2;
bev_create_quad_tri_ex(bm, bmv1, bmv2, bmv3, bmv4,
f, f23, f23, f);
f, f23, f23, f);
}
}
} while ((v = v->next) != vm->boundstart);
@@ -1681,7 +1687,7 @@ static void bevel_build_rings_subdiv(BevelParams *bp, BMesh *bm, BevVert *bv)
if (odd && k == ns2 && f2 && !v->any_seam)
f23 = f2;
bev_create_quad_tri_ex(bm, bmv1, bmv2, bmv3, bmv4,
f, f23, f23, f);
f, f23, f23, f);
}
}
} while ((v = v->next) != vm->boundstart);

View File

@@ -310,8 +310,9 @@ float ED_view3d_calc_zfac(const RegionView3D *rv3d, const float co[3], bool *r_f
* \param ar The region (used for the window width and height).
* \param v3d The 3d viewport (used for near clipping value).
* \param mval The area relative 2d location (such as event->mval, converted into float[2]).
* \param ray_start The world-space starting point of the segment.
* \param ray_normal The normalized world-space direction of towards mval.
* \param r_ray_start The world-space starting point of the segment.
* \param r_ray_normal The normalized world-space direction of towards mval.
* \param do_clip Optionally clip the ray by the view clipping planes.
* \return success, false if the segment is totally clipped.
*/
bool ED_view3d_win_to_ray(const ARegion *ar, View3D *v3d, const float mval[2],
@@ -504,7 +505,7 @@ void ED_view3d_win_to_vector(const ARegion *ar, const float mval[2], float out[3
* \return success, false if the segment is totally clipped.
*/
bool ED_view3d_win_to_segment(const ARegion *ar, View3D *v3d, const float mval[2],
float ray_start[3], float ray_end[3], const bool do_clip)
float r_ray_start[3], float r_ray_end[3], const bool do_clip)
{
RegionView3D *rv3d = ar->regiondata;
@@ -512,9 +513,9 @@ bool ED_view3d_win_to_segment(const ARegion *ar, View3D *v3d, const float mval[2
float vec[3];
ED_view3d_win_to_vector(ar, mval, vec);
copy_v3_v3(ray_start, rv3d->viewinv[3]);
madd_v3_v3v3fl(ray_start, rv3d->viewinv[3], vec, v3d->near);
madd_v3_v3v3fl(ray_end, rv3d->viewinv[3], vec, v3d->far);
copy_v3_v3(r_ray_start, rv3d->viewinv[3]);
madd_v3_v3v3fl(r_ray_start, rv3d->viewinv[3], vec, v3d->near);
madd_v3_v3v3fl(r_ray_end, rv3d->viewinv[3], vec, v3d->far);
}
else {
float vec[4];
@@ -525,13 +526,13 @@ bool ED_view3d_win_to_segment(const ARegion *ar, View3D *v3d, const float mval[2
mul_m4_v4(rv3d->persinv, vec);
madd_v3_v3v3fl(ray_start, vec, rv3d->viewinv[2], 1000.0f);
madd_v3_v3v3fl(ray_end, vec, rv3d->viewinv[2], -1000.0f);
madd_v3_v3v3fl(r_ray_start, vec, rv3d->viewinv[2], 1000.0f);
madd_v3_v3v3fl(r_ray_end, vec, rv3d->viewinv[2], -1000.0f);
}
/* bounds clipping */
if (do_clip && (rv3d->rflag & RV3D_CLIPPING)) {
if (clip_segment_v3_plane_n(ray_start, ray_end, rv3d->clip, 6) == false) {
if (clip_segment_v3_plane_n(r_ray_start, r_ray_end, rv3d->clip, 6) == false) {
return false;
}
}

View File

@@ -88,7 +88,7 @@ public:
/*! operator=
* \attention In the scripting language, you must call \code it2 = StrokeVertexIterator(it1) \endcode instead of
* \code it2 = it1 \endcode, where \a it1 and \a it2 are 2 StrokeVertexIterator.
* \code it2 = it1 \endcode where \a it1 and \a it2 are 2 StrokeVertexIterator.
* Otherwise, incrementing \a it1 will also increment \a it2.
*/
StrokeVertexIterator& operator=(const StrokeVertexIterator& vi)